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 sys import numpy as np import copy import roslib roslib.load_manifest("hrl_pr2_arms") roslib.load_manifest("kelsey_sandbox") import rospy from visualization_msgs.msg import Marker, MarkerArray from geometry_msgs.msg import Point, Quaternion, Vector3, PoseStamped from std_msgs.msg import ColorRGBA from sensor_msgs.msg import JointState import tf.transformations as tf_trans from hrl_generic_arms.pose_converter import PoseConverter from spheroid_space import SpheroidSpace JOINT_STATE_INDS_R = [17, 18, 16, 20, 19, 21, 22] JOINT_STATE_INDS_L = [29, 30, 28, 32, 31, 33, 34] class SpheroidViz: def __init__(self): ellipse_rot = np.mat([[-1., 0., 0.], [0., -1., 0.], [0., 0., 1.]]) self.sspace = SpheroidSpace(0.15, np.mat([0.78, -0.18, 0.1]).T, ellipse_rot) self.colors = [ColorRGBA(1., 0., 0., 1.), ColorRGBA(0., 1., 0., 1.)] self.vis_pub = rospy.Publisher("/force_torque_markers_array", MarkerArray) self.pose_pub = rospy.Publisher("/spheroid_poses", PoseStamped) m = Marker() m.header.frame_id = "torso_lift_link" m.header.stamp = rospy.Time() m.ns = "force_torque" m.id = 0 m.type = Marker.ARROW m.action = Marker.ADD #m.points.append(Point(0, 0, 0)) m.scale = Vector3(0.01, 0.01, 0.01) m.color = self.colors[0] #self.vis_pub.publish(m) self.m = m self.ma = MarkerArray() def publish_vector(self, m_id): new_m = copy.deepcopy(self.m) new_m.id = m_id u, v, p = 1.0, np.random.uniform(0, np.pi), np.random.uniform(0, 2 * np.pi) pos = self.sspace.spheroidal_to_cart((u, v, p)) new_m.points.append(Point(*pos)) df_du = self.sspace.partial_u((u, v, p)) df_du *= 0.1 / np.linalg.norm(df_du) new_m.points.append(Point(*(pos+df_du))) self.ma.markers.append(new_m) self.vis_pub.publish(self.ma) rot_gripper = np.pi/4. pos, rot = self.sspace.spheroidal_to_pose((u,v,p), rot_gripper) ps_msg = PoseConverter.to_pose_stamped_msg("torso_lift_link", pos, rot) self.pose_pub.publish(ps_msg) def main(): rospy.init_node("test_markers") jfv = SpheroidViz() i = 0 while not rospy.is_shutdown(): jfv.publish_vector(i) i += 1 rospy.sleep(0.1) return if __name__ == "__main__": main()
ajibawa-2023/Python-Code-Large/train/row_99288
58
80
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0375, 0.0125, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Import_L4_C0", "label": "numpy import np", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.05, 0.0125, 0, 0.66, 0.0556, 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_99288:Import_L5_C0", "label": "copy import copy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0125, 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_99288:Import_L7_C0", "label": "roslib import roslib", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0875, 0.0125, 0, 0.66, 0.1667, 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_99288:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.1, 0.0125, 0, 0.66, 0.2222, 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_99288:Expr_L9_C0", "label": "load_manifest()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.1125, 0.0125, 0, 0.66, 0.2778, 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(\"kelsey_sandbox\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Import_L10_C0", "label": "rospy import rospy", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.0125, 0, 0.66, 0.3333, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:ImportFrom_L11_C0", "label": "from visualization_msgs.msg import Marker, MarkerArray", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1375, 0.0125, 0, 0.66, 0.3889, 124, 0, 2, 0, 0, 124, 0, 0], "semantic": {"name": "visualization_msgs.msg", "arg_names": [], "import_names": ["Marker", "MarkerArray"], "rhs_call_name": "", "annotation": ""}, "snippet": "from visualization_msgs.msg import Marker, MarkerArray"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:ImportFrom_L12_C0", "label": "from geometry_msgs.msg import Point, Quaternion, Vector3\u2026", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.15, 0.0125, 0, 0.66, 0.4444, 951, 0, 4, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Point", "Quaternion", "Vector3", "PoseStamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Point, Quaternion, Vector3, PoseStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:ImportFrom_L13_C0", "label": "from std_msgs.msg import ColorRGBA", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.1625, 0.0125, 0, 0.66, 0.5, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["ColorRGBA"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import ColorRGBA"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:ImportFrom_L14_C0", "label": "from sensor_msgs.msg import JointState", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.175, 0.0125, 0, 0.66, 0.5556, 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_99288:Import_L15_C0", "label": "tf.transformations import tf_trans", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1875, 0.0125, 0, 0.66, 0.6111, 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_99288:ImportFrom_L16_C0", "label": "from hrl_generic_arms.pose_converter import PoseConverter", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.0125, 0, 0.66, 0.6667, 752, 0, 1, 0, 0, 752, 0, 0], "semantic": {"name": "hrl_generic_arms.pose_converter", "arg_names": [], "import_names": ["PoseConverter"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_generic_arms.pose_converter import PoseConverter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:ImportFrom_L18_C0", "label": "from spheroid_space import SpheroidSpace", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.225, 0.0125, 0, 0.66, 0.7222, 746, 0, 1, 0, 0, 746, 0, 0], "semantic": {"name": "spheroid_space", "arg_names": [], "import_names": ["SpheroidSpace"], "rhs_call_name": "", "annotation": ""}, "snippet": "from spheroid_space import SpheroidSpace"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L20_C0", "label": "JOINT_STATE_INDS_R =", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.0125, 0, 0.66, 0.7778, 720, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "JOINT_STATE_INDS_R", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "JOINT_STATE_INDS_R = [17, 18, 16, 20, 19, 21, 22]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L21_C0", "label": "JOINT_STATE_INDS_L =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.2625, 0.0125, 0, 0.66, 0.8333, 742, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "JOINT_STATE_INDS_L", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "JOINT_STATE_INDS_L = [29, 30, 28, 32, 31, 33, 34]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:ClassDef_L23_C0", "label": "SpheroidViz", "type": "class", "loc": [23, 65], "level": 0, "parent": null, "vector": [3, 0, 0.55, 0.5375, 0, 0.66, 0.8889, 119, 0, 2, 0, 0, 0, 0, 26], "semantic": {"name": "SpheroidViz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SpheroidViz:\n def __init__(self):\n ellipse_rot = np.mat([[-1., 0., 0.], [0., -1., 0.], [0., 0., 1.]])\n self.sspace = SpheroidSpace(0.15, np.mat([0.78, -0.18, 0.1]).T, ellipse_rot)\n self.colors = [ColorRGBA(1., 0., 0., 1.), ColorRGBA(0., 1., 0., 1.)]\n self.vis_pub = rospy.Publisher(\"/force_torque_markers_array\", MarkerArray)\n self.pose_pub = rospy.Publisher(\"/spheroid_poses\", PoseStamped)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "label": "__init__", "type": "function", "loc": [24, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:ClassDef_L23_C0", "vector": [2, 1, 0.425, 0.2625, 1, 0.48, 0.0, 555, 0, 1, 0, 0, 0, 0, 11], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n ellipse_rot = np.mat([[-1., 0., 0.], [0., -1., 0.], [0., 0., 1.]])\n self.sspace = SpheroidSpace(0.15, np.mat([0.78, -0.18, 0.1]).T, ellipse_rot)\n self.colors = [ColorRGBA(1., 0., 0., 1.), ColorRGBA(0., 1., 0., 1.)]\n self.vis_pub = rospy.Publisher(\"/force_torque_markers_array\", MarkerArray)\n self.pose_pub = rospy.Publisher(\"/spheroid_poses\", PoseStamped)\n\n m = Marker()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L25_C8", "label": "ellipse_rot = mat()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "vector": [14, 2, 0.3125, 0.0125, 2, 0.63, 0.0, 256, 3, 1, 0, 0, 882, 10, 1], "semantic": {"name": "ellipse_rot", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " ellipse_rot = np.mat([[-1., 0., 0.], [0., -1., 0.], [0., 0., 1.]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L26_C8", "label": "self.sspace = SpheroidSpace()", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "vector": [14, 2, 0.325, 0.0125, 2, 0.63, 0.0667, 744, 3, 3, 0, 0, 883, 10, 2], "semantic": {"name": "self.sspace", "arg_names": [], "import_names": [], "rhs_call_name": "SpheroidSpace", "annotation": ""}, "snippet": " self.sspace = SpheroidSpace(0.15, np.mat([0.78, -0.18, 0.1]).T, ellipse_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L27_C8", "label": "self.colors =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "vector": [14, 2, 0.3375, 0.0125, 2, 0.63, 0.1333, 375, 0, 0, 0, 0, 0, 5, 2], "semantic": {"name": "self.colors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.colors = [ColorRGBA(1., 0., 0., 1.), ColorRGBA(0., 1., 0., 1.)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L28_C8", "label": "self.vis_pub = Publisher()", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "vector": [14, 2, 0.35, 0.0125, 2, 0.63, 0.2, 911, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.vis_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.vis_pub = rospy.Publisher(\"/force_torque_markers_array\", MarkerArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L29_C8", "label": "self.pose_pub = Publisher()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "vector": [14, 2, 0.3625, 0.0125, 2, 0.63, 0.2667, 26, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.pose_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.pose_pub = rospy.Publisher(\"/spheroid_poses\", PoseStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L31_C8", "label": "m = Marker()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "vector": [14, 2, 0.3875, 0.0125, 2, 0.63, 0.3333, 711, 3, 0, 0, 0, 923, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "Marker", "annotation": ""}, "snippet": " m = Marker()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L32_C8", "label": "m.header.frame_id =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "vector": [14, 2, 0.4, 0.0125, 2, 0.63, 0.4, 636, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "m.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.header.frame_id = \"torso_lift_link\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L33_C8", "label": "m.header.stamp = Time()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "vector": [14, 2, 0.4125, 0.0125, 2, 0.63, 0.4667, 726, 3, 0, 0, 0, 451, 10, 1], "semantic": {"name": "m.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " m.header.stamp = rospy.Time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L34_C8", "label": "m.ns =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "vector": [14, 2, 0.425, 0.0125, 2, 0.63, 0.5333, 889, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "m.ns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.ns = \"force_torque\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L35_C8", "label": "m.id =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "vector": [14, 2, 0.4375, 0.0125, 2, 0.63, 0.6, 46, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "m.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.id = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L36_C8", "label": "m.type =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "vector": [14, 2, 0.45, 0.0125, 2, 0.63, 0.6667, 148, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.type = Marker.ARROW"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L37_C8", "label": "m.action =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "vector": [14, 2, 0.4625, 0.0125, 2, 0.63, 0.7333, 654, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.action = Marker.ADD"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L39_C8", "label": "m.scale = Vector3()", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "vector": [14, 2, 0.4875, 0.0125, 2, 0.63, 0.8, 508, 3, 3, 0, 0, 759, 10, 1], "semantic": {"name": "m.scale", "arg_names": [], "import_names": [], "rhs_call_name": "Vector3", "annotation": ""}, "snippet": " m.scale = Vector3(0.01, 0.01, 0.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L40_C8", "label": "m.color =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "vector": [14, 2, 0.5, 0.0125, 2, 0.63, 0.8667, 882, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.color", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.color = self.colors[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L42_C8", "label": "self.m =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "vector": [14, 2, 0.525, 0.0125, 2, 0.63, 0.9333, 561, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.m = m"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L44_C8", "label": "self.ma = MarkerArray()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "vector": [14, 2, 0.55, 0.0125, 2, 0.63, 1.0, 291, 3, 0, 0, 0, 49, 10, 1], "semantic": {"name": "self.ma", "arg_names": [], "import_names": [], "rhs_call_name": "MarkerArray", "annotation": ""}, "snippet": " self.ma = MarkerArray()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "label": "publish_vector", "type": "function", "loc": [46, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:ClassDef_L23_C0", "vector": [2, 1, 0.6937, 0.25, 1, 0.48, 1.0, 415, 0, 2, 0, 0, 0, 0, 15], "semantic": {"name": "publish_vector", "arg_names": ["self", "m_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def publish_vector(self, m_id):\n new_m = copy.deepcopy(self.m)\n new_m.id = m_id\n u, v, p = 1.0, np.random.uniform(0, np.pi), np.random.uniform(0, 2 * np.pi)\n pos = self.sspace.spheroidal_to_cart((u, v, p))\n new_m.points.append(Point(*pos))\n\n df_du = self.sspace.partial_u((u, v, p))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L47_C8", "label": "new_m = deepcopy()", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "vector": [14, 2, 0.5875, 0.0125, 2, 0.31, 0.0, 428, 3, 1, 0, 0, 44, 10, 1], "semantic": {"name": "new_m", "arg_names": [], "import_names": [], "rhs_call_name": "deepcopy", "annotation": ""}, "snippet": " new_m = copy.deepcopy(self.m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L48_C8", "label": "new_m.id =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "vector": [14, 2, 0.6, 0.0125, 2, 0.31, 0.0833, 385, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "new_m.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_m.id = m_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L49_C8", "label": "u, v, p =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "vector": [14, 2, 0.6125, 0.0125, 2, 0.31, 0.1667, 60, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "u, v, p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " u, v, p = 1.0, np.random.uniform(0, np.pi), np.random.uniform(0, 2 * np.pi)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L50_C8", "label": "pos = spheroidal_to_cart()", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "vector": [14, 2, 0.625, 0.0125, 2, 0.31, 0.25, 627, 3, 1, 0, 0, 654, 10, 1], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "spheroidal_to_cart", "annotation": ""}, "snippet": " pos = self.sspace.spheroidal_to_cart((u, v, p))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Expr_L51_C8", "label": "append()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "vector": [8, 2, 0.6375, 0.0125, 2, 0.31, 0.3333, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " new_m.points.append(Point(*pos))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L53_C8", "label": "df_du = partial_u()", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "vector": [14, 2, 0.6625, 0.0125, 2, 0.31, 0.4167, 365, 3, 1, 0, 0, 662, 10, 1], "semantic": {"name": "df_du", "arg_names": [], "import_names": [], "rhs_call_name": "partial_u", "annotation": ""}, "snippet": " df_du = self.sspace.partial_u((u, v, p))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Expr_L55_C8", "label": "append()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "vector": [8, 2, 0.6875, 0.0125, 2, 0.31, 0.5, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " new_m.points.append(Point(*(pos+df_du)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Expr_L57_C8", "label": "append()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "vector": [8, 2, 0.7125, 0.0125, 2, 0.31, 0.5833, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.ma.markers.append(new_m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Expr_L58_C8", "label": "publish()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "vector": [8, 2, 0.725, 0.0125, 2, 0.31, 0.6667, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.vis_pub.publish(self.ma)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L60_C8", "label": "rot_gripper =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "vector": [14, 2, 0.75, 0.0125, 2, 0.31, 0.75, 283, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rot_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_gripper = np.pi/4."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L62_C8", "label": "pos, rot = spheroidal_to_pose()", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "vector": [14, 2, 0.775, 0.0125, 2, 0.31, 0.8333, 298, 3, 2, 0, 0, 57, 10, 1], "semantic": {"name": "pos, rot", "arg_names": [], "import_names": [], "rhs_call_name": "spheroidal_to_pose", "annotation": ""}, "snippet": " pos, rot = self.sspace.spheroidal_to_pose((u,v,p), rot_gripper)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L64_C8", "label": "ps_msg = to_pose_stamped_msg()", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "vector": [14, 2, 0.8, 0.0125, 2, 0.31, 0.9167, 682, 3, 3, 0, 0, 996, 10, 1], "semantic": {"name": "ps_msg", "arg_names": [], "import_names": [], "rhs_call_name": "to_pose_stamped_msg", "annotation": ""}, "snippet": " ps_msg = PoseConverter.to_pose_stamped_msg(\"torso_lift_link\", pos, rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Expr_L65_C8", "label": "publish()", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "vector": [8, 2, 0.8125, 0.0125, 2, 0.31, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.pose_pub.publish(ps_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L68_C0", "label": "main", "type": "function", "loc": [68, 77], "level": 0, "parent": null, "vector": [2, 0, 0.9062, 0.125, 0, 0.66, 0.9444, 624, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n rospy.init_node(\"test_markers\")\n\n jfv = SpheroidViz()\n i = 0\n while not rospy.is_shutdown():\n jfv.publish_vector(i)\n i += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Expr_L69_C4", "label": "init_node()", "type": "expression", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L68_C0", "vector": [8, 1, 0.8625, 0.0125, 1, 0.57, 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(\"test_markers\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L71_C4", "label": "jfv = SpheroidViz()", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L68_C0", "vector": [14, 1, 0.8875, 0.0125, 1, 0.57, 0.25, 177, 3, 0, 0, 0, 119, 10, 1], "semantic": {"name": "jfv", "arg_names": [], "import_names": [], "rhs_call_name": "SpheroidViz", "annotation": ""}, "snippet": " jfv = SpheroidViz()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L72_C4", "label": "i =", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L68_C0", "vector": [14, 1, 0.9, 0.0125, 1, 0.57, 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_99288:While_L73_C4", "label": "while", "type": "while", "loc": [73, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L68_C0", "vector": [5, 1, 0.9313, 0.05, 1, 0.57, 0.75, 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 jfv.publish_vector(i)\n i += 1\n rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Expr_L74_C8", "label": "publish_vector()", "type": "expression", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:While_L73_C4", "vector": [8, 2, 0.925, 0.0125, 2, 0.63, 0.0, 415, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish_vector", "arg_names": [], "import_names": [], "rhs_call_name": "publish_vector", "annotation": ""}, "snippet": " jfv.publish_vector(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Expr_L76_C8", "label": "sleep()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:While_L73_C4", "vector": [8, 2, 0.95, 0.0125, 2, 0.63, 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_99288:Return_L77_C4", "label": "return", "type": "return", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L68_C0", "vector": [13, 1, 0.9625, 0.0125, 1, 0.57, 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_99288:If_L79_C0", "label": "if", "type": "if", "loc": [79, 80], "level": 0, "parent": null, "vector": [4, 0, 0.9938, 0.025, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99288:Expr_L80_C4", "label": "main()", "type": "expression", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99288:If_L79_C0", "vector": [8, 1, 1.0, 0.0125, 1, 0.34, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99288:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Expr_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Expr_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:While_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:While_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:While_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Return_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99288:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99288:Expr_L80_C4"}]
#! /usr/bin/python import sys from PyQt4 import QtCore, QtGui, uic import roslib roslib.load_manifest("std_msgs") roslib.load_manifest("rospy") roslib.load_manifest("smach_ros") import rospy from std_msgs.msg import Bool from smach_msgs.msg import SmachContainerStatus from servoing_ui import Ui_Frame as QTServoingFrame disabled_button_ss = """QPushButton { font: 75 18pt; background-color: rgb(190, 190, 190);}""" STATUS_DICT = { "UI_FIND_TAG_WAIT" : "Navigate the robot so it can see\nthe AR tag.", "FIND_AR_TAG" : "Locating tag...", "UI_SERVO_WAIT" : "Confirm the robot has found the\ntag in rviz.", "SERVOING" : "Servoing to tag..."} class ServoingFrame(QtGui.QFrame): def __init__(self): super(ServoingFrame, self).__init__() self.init_ui() rospy.Subscriber("/pr2_servo/smach/container_status", SmachContainerStatus, self.smach_status_cb) self.cur_smach_state = None self.find_tag_pub = rospy.Publisher("/pr2_ar_servo/find_tag", Bool) self.tag_confirm_pub = rospy.Publisher("/pr2_ar_servo/tag_confirm", Bool) self.preempt_pub = rospy.Publisher("/pr2_ar_servo/preempt", Bool) def smach_status_cb(self, msg): for state in msg.active_states: if state == self.cur_smach_state: continue if state in STATUS_DICT: self.ui.state_information.setText(STATUS_DICT[state]) self.cur_smach_state = state if state == "UI_FIND_TAG_WAIT" or state == "FIND_AR_TAG": self.enable_button(self.ui.find_ar_tag, self.find_ar_tag_ss) self.disable_button(self.ui.begin_servoing) if state == "UI_SERVO_WAIT": self.enable_button(self.ui.begin_servoing, self.begin_servoing_ss) self.disable_button(self.ui.find_ar_tag) if state == "SERVOING": self.disable_button(self.ui.find_ar_tag) self.disable_button(self.ui.begin_servoing) def enable_button(self, button, ss): button.setStyleSheet(ss) button.setEnabled(True) def disable_button(self, button): button.setStyleSheet(disabled_button_ss) button.setDisabled(True) def init_ui(self): self.ui = QTServoingFrame() self.ui.setupUi(self) self.ui.stop_moving.clicked.connect(self.stop_moving_clk) self.ui.find_ar_tag.clicked.connect(self.find_ar_tag_clk) self.ui.begin_servoing.clicked.connect(self.begin_servoing_clk) self.ui.state_information.setText("State Information") self.stop_moving_ss = self.ui.stop_moving.styleSheet() self.find_ar_tag_ss = self.ui.find_ar_tag.styleSheet() self.begin_servoing_ss = self.ui.begin_servoing.styleSheet() def stop_moving_clk(self): self.preempt_pub.publish(Bool(True)) def find_ar_tag_clk(self): self.find_tag_pub.publish(Bool(True)) def begin_servoing_clk(self): self.tag_confirm_pub.publish(Bool(True)) def main(): rospy.init_node("servoing_interface") app = QtGui.QApplication(sys.argv) sframe = ServoingFrame() sframe.show() sys.exit(app.exec_()) if __name__ == "__main__": main()
ajibawa-2023/Python-Code-Large/train/row_99289
66
91
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.033, 0.011, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:ImportFrom_L4_C0", "label": "from PyQt4 import QtCore, QtGui, uic", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.044, 0.011, 0, 0.66, 0.0714, 154, 0, 3, 0, 0, 154, 0, 0], "semantic": {"name": "PyQt4", "arg_names": [], "import_names": ["QtCore", "QtGui", "uic"], "rhs_call_name": "", "annotation": ""}, "snippet": "from PyQt4 import QtCore, QtGui, uic"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Import_L6_C0", "label": "roslib import roslib", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0659, 0.011, 0, 0.66, 0.1429, 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_99289:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0769, 0.011, 0, 0.66, 0.2143, 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_99289:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0879, 0.011, 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": "roslib.load_manifest(\"rospy\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L9_C0", "label": "load_manifest()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0989, 0.011, 0, 0.66, 0.3571, 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(\"smach_ros\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Import_L11_C0", "label": "rospy import rospy", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1209, 0.011, 0, 0.66, 0.4286, 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_99289:ImportFrom_L12_C0", "label": "from std_msgs.msg import Bool", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1319, 0.011, 0, 0.66, 0.5, 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_99289:ImportFrom_L13_C0", "label": "from smach_msgs.msg import SmachContainerStatus", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.011, 0, 0.66, 0.5714, 508, 0, 1, 0, 0, 508, 0, 0], "semantic": {"name": "smach_msgs.msg", "arg_names": [], "import_names": ["SmachContainerStatus"], "rhs_call_name": "", "annotation": ""}, "snippet": "from smach_msgs.msg import SmachContainerStatus"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:ImportFrom_L15_C0", "label": "from servoing_ui import QTServoingFrame", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1648, 0.011, 0, 0.66, 0.6429, 538, 0, 1, 0, 0, 538, 0, 0], "semantic": {"name": "servoing_ui", "arg_names": [], "import_names": ["QTServoingFrame"], "rhs_call_name": "", "annotation": ""}, "snippet": "from servoing_ui import Ui_Frame as QTServoingFrame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Assign_L17_C0", "label": "disabled_button_ss =", "type": "assigned_variable", "loc": [17, 18], "level": 0, "parent": null, "vector": [14, 0, 0.1923, 0.022, 0, 0.66, 0.7143, 429, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "disabled_button_ss", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "disabled_button_ss = \"\"\"QPushButton { font: 75 18pt;\n background-color: rgb(190, 190, 190);}\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Assign_L20_C0", "label": "STATUS_DICT =", "type": "assigned_variable", "loc": [20, 23], "level": 0, "parent": null, "vector": [14, 0, 0.2363, 0.044, 0, 0.66, 0.7857, 389, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "STATUS_DICT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "STATUS_DICT = { \"UI_FIND_TAG_WAIT\" : \"Navigate the robot so it can see\\nthe AR tag.\",\n \"FIND_AR_TAG\" : \"Locating tag...\",\n \"UI_SERVO_WAIT\" : \"Confirm the robot has found the\\ntag in rviz.\",\n \"SERVOING\" : \"Servoing to tag...\"}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:ClassDef_L25_C0", "label": "ServoingFrame", "type": "class", "loc": [25, 81], "level": 0, "parent": null, "vector": [3, 0, 0.5824, 0.6264, 0, 0.66, 0.8571, 976, 0, 8, 0, 0, 574, 0, 33], "semantic": {"name": "ServoingFrame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ServoingFrame(QtGui.QFrame):\n def __init__(self):\n super(ServoingFrame, self).__init__()\n self.init_ui()\n\n rospy.Subscriber(\"/pr2_servo/smach/container_status\", SmachContainerStatus, \n self.smach_status_cb)\n self.cur_smach_state = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L26_C4", "label": "__init__", "type": "function", "loc": [26, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:ClassDef_L25_C0", "vector": [2, 1, 0.3407, 0.1209, 1, 0.97, 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 super(ServoingFrame, self).__init__()\n self.init_ui()\n\n rospy.Subscriber(\"/pr2_servo/smach/container_status\", SmachContainerStatus, \n self.smach_status_cb)\n self.cur_smach_state = None\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L27_C8", "label": "__init__()", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L26_C4", "vector": [8, 2, 0.2967, 0.011, 2, 0.99, 0.0, 555, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(ServoingFrame, self).__init__()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L28_C8", "label": "init_ui()", "type": "expression", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L26_C4", "vector": [8, 2, 0.3077, 0.011, 2, 0.99, 0.1667, 643, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init_ui", "arg_names": [], "import_names": [], "rhs_call_name": "init_ui", "annotation": ""}, "snippet": " self.init_ui()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L30_C8", "label": "Subscriber()", "type": "expression", "loc": [30, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L26_C4", "vector": [8, 2, 0.3352, 0.022, 2, 0.99, 0.3333, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber(\"/pr2_servo/smach/container_status\", SmachContainerStatus, \n self.smach_status_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Assign_L32_C8", "label": "self.cur_smach_state =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L26_C4", "vector": [14, 2, 0.3516, 0.011, 2, 0.99, 0.5, 252, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.cur_smach_state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cur_smach_state = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Assign_L34_C8", "label": "self.find_tag_pub = Publisher()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L26_C4", "vector": [14, 2, 0.3736, 0.011, 2, 0.99, 0.6667, 692, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.find_tag_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.find_tag_pub = rospy.Publisher(\"/pr2_ar_servo/find_tag\", Bool)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Assign_L35_C8", "label": "self.tag_confirm_pub = Publisher()", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L26_C4", "vector": [14, 2, 0.3846, 0.011, 2, 0.99, 0.8333, 628, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.tag_confirm_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.tag_confirm_pub = rospy.Publisher(\"/pr2_ar_servo/tag_confirm\", Bool)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Assign_L36_C8", "label": "self.preempt_pub = Publisher()", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L26_C4", "vector": [14, 2, 0.3956, 0.011, 2, 0.99, 1.0, 1, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.preempt_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.preempt_pub = rospy.Publisher(\"/pr2_ar_servo/preempt\", Bool)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L38_C4", "label": "smach_status_cb", "type": "function", "loc": [38, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:ClassDef_L25_C0", "vector": [2, 1, 0.5, 0.1758, 1, 0.97, 0.1429, 916, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "smach_status_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def smach_status_cb(self, msg):\n for state in msg.active_states:\n if state == self.cur_smach_state:\n continue\n if state in STATUS_DICT:\n self.ui.state_information.setText(STATUS_DICT[state])\n self.cur_smach_state = state\n if state == \"UI_FIND_TAG_WAIT\" or state == \"FIND_AR_TAG\":"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:For_L39_C8", "label": "for state", "type": "for", "loc": [39, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L38_C4", "vector": [6, 2, 0.5055, 0.1648, 2, 0.27, 0.0, 688, 7, 0, 0, 0, 0, 0, 7], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for state in msg.active_states:\n if state == self.cur_smach_state:\n continue\n if state in STATUS_DICT:\n self.ui.state_information.setText(STATUS_DICT[state])\n self.cur_smach_state = state\n if state == \"UI_FIND_TAG_WAIT\" or state == \"FIND_AR_TAG\":\n self.enable_button(self.ui.find_ar_tag, self.find_ar_tag_ss)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L40_C12", "label": "if", "type": "if", "loc": [40, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:For_L39_C8", "vector": [4, 3, 0.4451, 0.022, 3, 0.71, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if state == self.cur_smach_state:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L42_C12", "label": "if", "type": "if", "loc": [42, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:For_L39_C8", "vector": [4, 3, 0.4725, 0.033, 3, 0.71, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if state in STATUS_DICT:\n self.ui.state_information.setText(STATUS_DICT[state])\n self.cur_smach_state = state"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L43_C16", "label": "setText()", "type": "expression", "loc": [43, 43], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L42_C12", "vector": [8, 4, 0.4725, 0.011, 4, 0.46, 0.0, 40, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.ui.state_information.setText(STATUS_DICT[state])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Assign_L44_C16", "label": "self.cur_smach_state =", "type": "assigned_variable", "loc": [44, 44], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L42_C12", "vector": [14, 4, 0.4835, 0.011, 4, 0.46, 1.0, 252, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cur_smach_state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cur_smach_state = state"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L45_C12", "label": "if", "type": "if", "loc": [45, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:For_L39_C8", "vector": [4, 3, 0.5055, 0.033, 3, 0.71, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if state == \"UI_FIND_TAG_WAIT\" or state == \"FIND_AR_TAG\":\n self.enable_button(self.ui.find_ar_tag, self.find_ar_tag_ss)\n self.disable_button(self.ui.begin_servoing)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L46_C16", "label": "enable_button()", "type": "expression", "loc": [46, 46], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L45_C12", "vector": [8, 4, 0.5055, 0.011, 4, 0.57, 0.0, 703, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "enable_button", "arg_names": [], "import_names": [], "rhs_call_name": "enable_button", "annotation": ""}, "snippet": " self.enable_button(self.ui.find_ar_tag, self.find_ar_tag_ss)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L47_C16", "label": "disable_button()", "type": "expression", "loc": [47, 47], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L45_C12", "vector": [8, 4, 0.5165, 0.011, 4, 0.57, 1.0, 327, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "disable_button", "arg_names": [], "import_names": [], "rhs_call_name": "disable_button", "annotation": ""}, "snippet": " self.disable_button(self.ui.begin_servoing)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L48_C12", "label": "if", "type": "if", "loc": [48, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:For_L39_C8", "vector": [4, 3, 0.5385, 0.033, 3, 0.71, 0.75, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if state == \"UI_SERVO_WAIT\":\n self.enable_button(self.ui.begin_servoing, self.begin_servoing_ss)\n self.disable_button(self.ui.find_ar_tag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L49_C16", "label": "enable_button()", "type": "expression", "loc": [49, 49], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L48_C12", "vector": [8, 4, 0.5385, 0.011, 4, 0.5, 0.0, 703, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "enable_button", "arg_names": [], "import_names": [], "rhs_call_name": "enable_button", "annotation": ""}, "snippet": " self.enable_button(self.ui.begin_servoing, self.begin_servoing_ss)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L50_C16", "label": "disable_button()", "type": "expression", "loc": [50, 50], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L48_C12", "vector": [8, 4, 0.5495, 0.011, 4, 0.5, 1.0, 327, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "disable_button", "arg_names": [], "import_names": [], "rhs_call_name": "disable_button", "annotation": ""}, "snippet": " self.disable_button(self.ui.find_ar_tag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L51_C12", "label": "if", "type": "if", "loc": [51, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:For_L39_C8", "vector": [4, 3, 0.5714, 0.033, 3, 0.71, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if state == \"SERVOING\":\n self.disable_button(self.ui.find_ar_tag)\n self.disable_button(self.ui.begin_servoing)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L52_C16", "label": "disable_button()", "type": "expression", "loc": [52, 52], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L51_C12", "vector": [8, 4, 0.5714, 0.011, 4, 0.58, 0.0, 327, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "disable_button", "arg_names": [], "import_names": [], "rhs_call_name": "disable_button", "annotation": ""}, "snippet": " self.disable_button(self.ui.find_ar_tag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L53_C16", "label": "disable_button()", "type": "expression", "loc": [53, 53], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L51_C12", "vector": [8, 4, 0.5824, 0.011, 4, 0.58, 1.0, 327, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "disable_button", "arg_names": [], "import_names": [], "rhs_call_name": "disable_button", "annotation": ""}, "snippet": " self.disable_button(self.ui.begin_servoing)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L55_C4", "label": "enable_button", "type": "function", "loc": [55, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:ClassDef_L25_C0", "vector": [2, 1, 0.6154, 0.033, 1, 0.97, 0.2857, 703, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "enable_button", "arg_names": ["self", "button", "ss"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def enable_button(self, button, ss):\n button.setStyleSheet(ss)\n button.setEnabled(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L56_C8", "label": "setStyleSheet()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L55_C4", "vector": [8, 2, 0.6154, 0.011, 2, 0.95, 0.0, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " button.setStyleSheet(ss)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L57_C8", "label": "setEnabled()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L55_C4", "vector": [8, 2, 0.6264, 0.011, 2, 0.95, 1.0, 503, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setEnabled", "arg_names": [], "import_names": [], "rhs_call_name": "setEnabled", "annotation": ""}, "snippet": " button.setEnabled(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L59_C4", "label": "disable_button", "type": "function", "loc": [59, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:ClassDef_L25_C0", "vector": [2, 1, 0.6593, 0.033, 1, 0.97, 0.4286, 327, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "disable_button", "arg_names": ["self", "button"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def disable_button(self, button):\n button.setStyleSheet(disabled_button_ss)\n button.setDisabled(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L60_C8", "label": "setStyleSheet()", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L59_C4", "vector": [8, 2, 0.6593, 0.011, 2, 0.15, 0.0, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " button.setStyleSheet(disabled_button_ss)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L61_C8", "label": "setDisabled()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L59_C4", "vector": [8, 2, 0.6703, 0.011, 2, 0.15, 1.0, 533, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setDisabled", "arg_names": [], "import_names": [], "rhs_call_name": "setDisabled", "annotation": ""}, "snippet": " button.setDisabled(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L63_C4", "label": "init_ui", "type": "function", "loc": [63, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:ClassDef_L25_C0", "vector": [2, 1, 0.7418, 0.1099, 1, 0.97, 0.5714, 643, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "init_ui", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def init_ui(self):\n self.ui = QTServoingFrame()\n self.ui.setupUi(self)\n self.ui.stop_moving.clicked.connect(self.stop_moving_clk)\n self.ui.find_ar_tag.clicked.connect(self.find_ar_tag_clk)\n self.ui.begin_servoing.clicked.connect(self.begin_servoing_clk)\n self.ui.state_information.setText(\"State Information\")\n self.stop_moving_ss = self.ui.stop_moving.styleSheet()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Assign_L64_C8", "label": "self.ui = QTServoingFrame()", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L63_C4", "vector": [14, 2, 0.7033, 0.011, 2, 0.53, 0.0, 413, 3, 0, 0, 0, 588, 10, 1], "semantic": {"name": "self.ui", "arg_names": [], "import_names": [], "rhs_call_name": "QTServoingFrame", "annotation": ""}, "snippet": " self.ui = QTServoingFrame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L65_C8", "label": "setupUi()", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L63_C4", "vector": [8, 2, 0.7143, 0.011, 2, 0.53, 0.125, 419, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setupUi", "arg_names": [], "import_names": [], "rhs_call_name": "setupUi", "annotation": ""}, "snippet": " self.ui.setupUi(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L66_C8", "label": "connect()", "type": "expression", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L63_C4", "vector": [8, 2, 0.7253, 0.011, 2, 0.53, 0.25, 242, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.ui.stop_moving.clicked.connect(self.stop_moving_clk)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L67_C8", "label": "connect()", "type": "expression", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L63_C4", "vector": [8, 2, 0.7363, 0.011, 2, 0.53, 0.375, 242, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.ui.find_ar_tag.clicked.connect(self.find_ar_tag_clk)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L68_C8", "label": "connect()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L63_C4", "vector": [8, 2, 0.7473, 0.011, 2, 0.53, 0.5, 242, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.ui.begin_servoing.clicked.connect(self.begin_servoing_clk)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L69_C8", "label": "setText()", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L63_C4", "vector": [8, 2, 0.7582, 0.011, 2, 0.53, 0.625, 40, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.ui.state_information.setText(\"State Information\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Assign_L70_C8", "label": "self.stop_moving_ss = styleSheet()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L63_C4", "vector": [14, 2, 0.7692, 0.011, 2, 0.53, 0.75, 951, 3, 0, 0, 0, 485, 10, 1], "semantic": {"name": "self.stop_moving_ss", "arg_names": [], "import_names": [], "rhs_call_name": "styleSheet", "annotation": ""}, "snippet": " self.stop_moving_ss = self.ui.stop_moving.styleSheet()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Assign_L71_C8", "label": "self.find_ar_tag_ss = styleSheet()", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L63_C4", "vector": [14, 2, 0.7802, 0.011, 2, 0.53, 0.875, 263, 3, 0, 0, 0, 485, 10, 1], "semantic": {"name": "self.find_ar_tag_ss", "arg_names": [], "import_names": [], "rhs_call_name": "styleSheet", "annotation": ""}, "snippet": " self.find_ar_tag_ss = self.ui.find_ar_tag.styleSheet()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Assign_L72_C8", "label": "self.begin_servoing_ss = styleSheet()", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L63_C4", "vector": [14, 2, 0.7912, 0.011, 2, 0.53, 1.0, 177, 3, 0, 0, 0, 485, 10, 1], "semantic": {"name": "self.begin_servoing_ss", "arg_names": [], "import_names": [], "rhs_call_name": "styleSheet", "annotation": ""}, "snippet": " self.begin_servoing_ss = self.ui.begin_servoing.styleSheet()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L74_C4", "label": "stop_moving_clk", "type": "function", "loc": [74, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:ClassDef_L25_C0", "vector": [2, 1, 0.8187, 0.022, 1, 0.97, 0.7143, 598, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "stop_moving_clk", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop_moving_clk(self):\n self.preempt_pub.publish(Bool(True))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L75_C8", "label": "publish()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L74_C4", "vector": [8, 2, 0.8242, 0.011, 2, 0.92, 0.0, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.preempt_pub.publish(Bool(True))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L77_C4", "label": "find_ar_tag_clk", "type": "function", "loc": [77, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:ClassDef_L25_C0", "vector": [2, 1, 0.8516, 0.022, 1, 0.97, 0.8571, 971, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "find_ar_tag_clk", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def find_ar_tag_clk(self):\n self.find_tag_pub.publish(Bool(True))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L78_C8", "label": "publish()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L77_C4", "vector": [8, 2, 0.8571, 0.011, 2, 0.82, 0.0, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.find_tag_pub.publish(Bool(True))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L80_C4", "label": "begin_servoing_clk", "type": "function", "loc": [80, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:ClassDef_L25_C0", "vector": [2, 1, 0.8846, 0.022, 1, 0.97, 1.0, 221, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "begin_servoing_clk", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def begin_servoing_clk(self):\n self.tag_confirm_pub.publish(Bool(True))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L81_C8", "label": "publish()", "type": "expression", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L80_C4", "vector": [8, 2, 0.8901, 0.011, 2, 0.83, 0.0, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.tag_confirm_pub.publish(Bool(True))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L83_C0", "label": "main", "type": "function", "loc": [83, 88], "level": 0, "parent": null, "vector": [2, 0, 0.9396, 0.0659, 0, 0.66, 0.9286, 624, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n rospy.init_node(\"servoing_interface\")\n app = QtGui.QApplication(sys.argv)\n sframe = ServoingFrame()\n sframe.show()\n sys.exit(app.exec_())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L84_C4", "label": "init_node()", "type": "expression", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L83_C0", "vector": [8, 1, 0.9231, 0.011, 1, 0.49, 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(\"servoing_interface\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Assign_L85_C4", "label": "app = QApplication()", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L83_C0", "vector": [14, 1, 0.9341, 0.011, 1, 0.49, 0.25, 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_99289:Assign_L86_C4", "label": "sframe = ServoingFrame()", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L83_C0", "vector": [14, 1, 0.9451, 0.011, 1, 0.49, 0.5, 456, 3, 0, 0, 0, 976, 10, 1], "semantic": {"name": "sframe", "arg_names": [], "import_names": [], "rhs_call_name": "ServoingFrame", "annotation": ""}, "snippet": " sframe = ServoingFrame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L87_C4", "label": "show()", "type": "expression", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L83_C0", "vector": [8, 1, 0.956, 0.011, 1, 0.49, 0.75, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " sframe.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L88_C4", "label": "exit()", "type": "expression", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L83_C0", "vector": [8, 1, 0.967, 0.011, 1, 0.49, 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_())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L90_C0", "label": "if", "type": "if", "loc": [90, 91], "level": 0, "parent": null, "vector": [4, 0, 0.9945, 0.022, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L91_C4", "label": "main()", "type": "expression", "loc": [91, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L90_C0", "vector": [8, 1, 1.0, 0.011, 1, 0.92, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99289:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:For_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:For_L39_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L40_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:For_L39_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L42_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L42_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L43_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L42_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Assign_L44_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:For_L39_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L45_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L46_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L45_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L47_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:For_L39_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L48_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L49_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L48_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L50_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:For_L39_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L51_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L52_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L51_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L53_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:FunctionDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99289:If_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99289:Expr_L91_C4"}]
#! /usr/bin/python import sys from PyQt4 import QtCore, QtGui, uic import roslib roslib.load_manifest("rospy") roslib.load_manifest("std_msgs") import rospy from std_msgs.msg import String from arm_cart_control_gui import Ui_Frame as QTArmControlGUIFrame from arm_cart_control_backend import MOVE_BUTTONS, MONITOR_RATE, MOVE_STATE_TOPIC, LOAD_ARM_TOPIC ARM_STYLESHEET = """image: url(:/resources/arm_%s_%s.png); background-image: url(:/resources/empty.png);""" class ArmCartControlGUIFrame(QtGui.QFrame): def __init__(self): super(ArmCartControlGUIFrame, self).__init__() self.move_state_pub = rospy.Publisher(MOVE_STATE_TOPIC, String) self.arm_state_pub = rospy.Publisher(LOAD_ARM_TOPIC, String) self.cur_arm = "l" self.init_ui() self.arm_left_clk() def init_ui(self): self.ui = QTArmControlGUIFrame() self.ui.setupUi(self) self.ui.arm_left.clicked.connect(self.arm_left_clk) self.ui.arm_right.clicked.connect(self.arm_right_clk) self.monitor_timer = QtCore.QTimer(self) QtCore.QObject.connect(self.monitor_timer, QtCore.SIGNAL("timeout()"), self.monitor_cb) self.monitor_timer.start(MONITOR_RATE) def monitor_cb(self): move_button = "" for button in MOVE_BUTTONS: exec("is_down = self.ui.%s.isDown()" % button) if is_down: move_button = button self.move_state_pub.publish(String(move_button)) self.arm_state_pub.publish(String(self.cur_arm)) def arm_left_clk(self): self.ui.arm_left.setDisabled(True) self.ui.arm_right.setEnabled(True) self.ui.arm_left.setStyleSheet(ARM_STYLESHEET % ("left", "on")) self.ui.arm_right.setStyleSheet(ARM_STYLESHEET % ("right", "off")) self.cur_arm = "l" def arm_right_clk(self): self.arm_state_pub.publish(String("r")) self.ui.arm_right.setDisabled(True) self.ui.arm_left.setEnabled(True) self.ui.arm_left.setStyleSheet(ARM_STYLESHEET % ("left", "off")) self.ui.arm_right.setStyleSheet(ARM_STYLESHEET % ("right", "on")) self.cur_arm = "r" def main(): rospy.init_node("arm_cart_control_interface") app = QtGui.QApplication(sys.argv) frame = ArmCartControlGUIFrame() frame.show() sys.exit(app.exec_()) if __name__ == "__main__": main()
ajibawa-2023/Python-Code-Large/train/row_99290
55
71
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0423, 0.0141, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:ImportFrom_L4_C0", "label": "from PyQt4 import QtCore, QtGui, uic", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0563, 0.0141, 0, 0.66, 0.0833, 154, 0, 3, 0, 0, 154, 0, 0], "semantic": {"name": "PyQt4", "arg_names": [], "import_names": ["QtCore", "QtGui", "uic"], "rhs_call_name": "", "annotation": ""}, "snippet": "from PyQt4 import QtCore, QtGui, uic"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Import_L6_C0", "label": "roslib import roslib", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0845, 0.0141, 0, 0.66, 0.1667, 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_99290:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0986, 0.0141, 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(\"rospy\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.1127, 0.0141, 0, 0.66, 0.3333, 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_99290:Import_L9_C0", "label": "rospy import rospy", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1268, 0.0141, 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_99290:ImportFrom_L10_C0", "label": "from std_msgs.msg import String", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1408, 0.0141, 0, 0.66, 0.5, 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_99290:ImportFrom_L12_C0", "label": "from arm_cart_control_gui import QTArmControlGUIFrame", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.169, 0.0141, 0, 0.66, 0.5833, 920, 0, 1, 0, 0, 920, 0, 0], "semantic": {"name": "arm_cart_control_gui", "arg_names": [], "import_names": ["QTArmControlGUIFrame"], "rhs_call_name": "", "annotation": ""}, "snippet": "from arm_cart_control_gui import Ui_Frame as QTArmControlGUIFrame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:ImportFrom_L13_C0", "label": "from arm_cart_control_backend import MOVE_BUTTONS, MONITOR_RATE, MOVE_STATE_TOPIC\u2026", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.1831, 0.0141, 0, 0.66, 0.6667, 388, 0, 4, 0, 0, 388, 0, 0], "semantic": {"name": "arm_cart_control_backend", "arg_names": [], "import_names": ["MOVE_BUTTONS", "MONITOR_RATE", "MOVE_STATE_TOPIC", "LOAD_ARM_TOPIC"], "rhs_call_name": "", "annotation": ""}, "snippet": "from arm_cart_control_backend import MOVE_BUTTONS, MONITOR_RATE, MOVE_STATE_TOPIC, LOAD_ARM_TOPIC"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Assign_L15_C0", "label": "ARM_STYLESHEET =", "type": "assigned_variable", "loc": [15, 16], "level": 0, "parent": null, "vector": [14, 0, 0.2183, 0.0282, 0, 0.66, 0.75, 593, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ARM_STYLESHEET", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ARM_STYLESHEET = \"\"\"image: url(:/resources/arm_%s_%s.png);\n background-image: url(:/resources/empty.png);\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:ClassDef_L18_C0", "label": "ArmCartControlGUIFrame", "type": "class", "loc": [18, 61], "level": 0, "parent": null, "vector": [3, 0, 0.5563, 0.6197, 0, 0.66, 0.8333, 770, 0, 5, 0, 0, 574, 0, 29], "semantic": {"name": "ArmCartControlGUIFrame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ArmCartControlGUIFrame(QtGui.QFrame):\n def __init__(self):\n super(ArmCartControlGUIFrame, self).__init__()\n\n self.move_state_pub = rospy.Publisher(MOVE_STATE_TOPIC, String)\n self.arm_state_pub = rospy.Publisher(LOAD_ARM_TOPIC, String)\n\n self.cur_arm = \"l\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L19_C4", "label": "__init__", "type": "function", "loc": [19, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:ClassDef_L18_C0", "vector": [2, 1, 0.3239, 0.1268, 1, 0.51, 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 super(ArmCartControlGUIFrame, self).__init__()\n\n self.move_state_pub = rospy.Publisher(MOVE_STATE_TOPIC, String)\n self.arm_state_pub = rospy.Publisher(LOAD_ARM_TOPIC, String)\n\n self.cur_arm = \"l\"\n self.init_ui()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L20_C8", "label": "__init__()", "type": "expression", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L19_C4", "vector": [8, 2, 0.2817, 0.0141, 2, 0.75, 0.0, 555, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(ArmCartControlGUIFrame, self).__init__()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Assign_L22_C8", "label": "self.move_state_pub = Publisher()", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L19_C4", "vector": [14, 2, 0.3099, 0.0141, 2, 0.75, 0.2, 365, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.move_state_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.move_state_pub = rospy.Publisher(MOVE_STATE_TOPIC, String)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Assign_L23_C8", "label": "self.arm_state_pub = Publisher()", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L19_C4", "vector": [14, 2, 0.3239, 0.0141, 2, 0.75, 0.4, 786, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.arm_state_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.arm_state_pub = rospy.Publisher(LOAD_ARM_TOPIC, String)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Assign_L25_C8", "label": "self.cur_arm =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L19_C4", "vector": [14, 2, 0.3521, 0.0141, 2, 0.75, 0.6, 847, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.cur_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cur_arm = \"l\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L26_C8", "label": "init_ui()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L19_C4", "vector": [8, 2, 0.3662, 0.0141, 2, 0.75, 0.8, 643, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init_ui", "arg_names": [], "import_names": [], "rhs_call_name": "init_ui", "annotation": ""}, "snippet": " self.init_ui()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L27_C8", "label": "arm_left_clk()", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L19_C4", "vector": [8, 2, 0.3803, 0.0141, 2, 0.75, 1.0, 698, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "arm_left_clk", "arg_names": [], "import_names": [], "rhs_call_name": "arm_left_clk", "annotation": ""}, "snippet": " self.arm_left_clk()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L29_C4", "label": "init_ui", "type": "function", "loc": [29, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:ClassDef_L18_C0", "vector": [2, 1, 0.4648, 0.1268, 1, 0.51, 0.25, 643, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "init_ui", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def init_ui(self):\n self.ui = QTArmControlGUIFrame()\n self.ui.setupUi(self)\n\n self.ui.arm_left.clicked.connect(self.arm_left_clk)\n self.ui.arm_right.clicked.connect(self.arm_right_clk)\n self.monitor_timer = QtCore.QTimer(self)\n QtCore.QObject.connect(self.monitor_timer, QtCore.SIGNAL(\"timeout()\"), self.monitor_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Assign_L30_C8", "label": "self.ui = QTArmControlGUIFrame()", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L29_C4", "vector": [14, 2, 0.4225, 0.0141, 2, 0.57, 0.0, 413, 3, 0, 0, 0, 649, 10, 1], "semantic": {"name": "self.ui", "arg_names": [], "import_names": [], "rhs_call_name": "QTArmControlGUIFrame", "annotation": ""}, "snippet": " self.ui = QTArmControlGUIFrame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L31_C8", "label": "setupUi()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L29_C4", "vector": [8, 2, 0.4366, 0.0141, 2, 0.57, 0.1667, 419, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setupUi", "arg_names": [], "import_names": [], "rhs_call_name": "setupUi", "annotation": ""}, "snippet": " self.ui.setupUi(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L33_C8", "label": "connect()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L29_C4", "vector": [8, 2, 0.4648, 0.0141, 2, 0.57, 0.3333, 242, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.ui.arm_left.clicked.connect(self.arm_left_clk)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L34_C8", "label": "connect()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L29_C4", "vector": [8, 2, 0.4789, 0.0141, 2, 0.57, 0.5, 242, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.ui.arm_right.clicked.connect(self.arm_right_clk)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Assign_L35_C8", "label": "self.monitor_timer = QTimer()", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L29_C4", "vector": [14, 2, 0.493, 0.0141, 2, 0.57, 0.6667, 61, 3, 1, 0, 0, 937, 10, 1], "semantic": {"name": "self.monitor_timer", "arg_names": [], "import_names": [], "rhs_call_name": "QTimer", "annotation": ""}, "snippet": " self.monitor_timer = QtCore.QTimer(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L36_C8", "label": "connect()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L29_C4", "vector": [8, 2, 0.507, 0.0141, 2, 0.57, 0.8333, 242, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " QtCore.QObject.connect(self.monitor_timer, QtCore.SIGNAL(\"timeout()\"), self.monitor_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L37_C8", "label": "start()", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L29_C4", "vector": [8, 2, 0.5211, 0.0141, 2, 0.57, 1.0, 511, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.monitor_timer.start(MONITOR_RATE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L39_C4", "label": "monitor_cb", "type": "function", "loc": [39, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:ClassDef_L18_C0", "vector": [2, 1, 0.5986, 0.1127, 1, 0.51, 0.5, 821, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "monitor_cb", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def monitor_cb(self):\n move_button = \"\"\n for button in MOVE_BUTTONS:\n exec(\"is_down = self.ui.%s.isDown()\" % button)\n if is_down:\n move_button = button\n self.move_state_pub.publish(String(move_button))\n self.arm_state_pub.publish(String(self.cur_arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Assign_L40_C8", "label": "move_button =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L39_C4", "vector": [14, 2, 0.5634, 0.0141, 2, 0.45, 0.0, 368, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "move_button", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " move_button = \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:For_L41_C8", "label": "for button", "type": "for", "loc": [41, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L39_C4", "vector": [6, 2, 0.5986, 0.0563, 2, 0.45, 0.3333, 95, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "button", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for button in MOVE_BUTTONS:\n exec(\"is_down = self.ui.%s.isDown()\" % button)\n if is_down:\n move_button = button"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L42_C12", "label": "exec()", "type": "expression", "loc": [42, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:For_L41_C8", "vector": [8, 3, 0.5915, 0.0141, 3, 0.99, 0.0, 272, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exec", "arg_names": [], "import_names": [], "rhs_call_name": "exec", "annotation": ""}, "snippet": " exec(\"is_down = self.ui.%s.isDown()\" % button)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:If_L43_C12", "label": "if", "type": "if", "loc": [43, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:For_L41_C8", "vector": [4, 3, 0.6127, 0.0282, 3, 0.99, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if is_down:\n move_button = button"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Assign_L44_C16", "label": "move_button =", "type": "assigned_variable", "loc": [44, 44], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:If_L43_C12", "vector": [14, 4, 0.6197, 0.0141, 4, 0.39, 0.0, 368, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "move_button", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " move_button = button"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L45_C8", "label": "publish()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L39_C4", "vector": [8, 2, 0.6338, 0.0141, 2, 0.45, 0.6667, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.move_state_pub.publish(String(move_button))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L46_C8", "label": "publish()", "type": "expression", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L39_C4", "vector": [8, 2, 0.6479, 0.0141, 2, 0.45, 1.0, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.arm_state_pub.publish(String(self.cur_arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L48_C4", "label": "arm_left_clk", "type": "function", "loc": [48, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:ClassDef_L18_C0", "vector": [2, 1, 0.7113, 0.0845, 1, 0.51, 0.75, 698, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "arm_left_clk", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def arm_left_clk(self):\n self.ui.arm_left.setDisabled(True)\n self.ui.arm_right.setEnabled(True)\n self.ui.arm_left.setStyleSheet(ARM_STYLESHEET % (\"left\", \"on\"))\n self.ui.arm_right.setStyleSheet(ARM_STYLESHEET % (\"right\", \"off\"))\n self.cur_arm = \"l\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L49_C8", "label": "setDisabled()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L48_C4", "vector": [8, 2, 0.6901, 0.0141, 2, 0.27, 0.0, 533, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setDisabled", "arg_names": [], "import_names": [], "rhs_call_name": "setDisabled", "annotation": ""}, "snippet": " self.ui.arm_left.setDisabled(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L50_C8", "label": "setEnabled()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L48_C4", "vector": [8, 2, 0.7042, 0.0141, 2, 0.27, 0.25, 503, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setEnabled", "arg_names": [], "import_names": [], "rhs_call_name": "setEnabled", "annotation": ""}, "snippet": " self.ui.arm_right.setEnabled(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L51_C8", "label": "setStyleSheet()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L48_C4", "vector": [8, 2, 0.7183, 0.0141, 2, 0.27, 0.5, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.ui.arm_left.setStyleSheet(ARM_STYLESHEET % (\"left\", \"on\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L52_C8", "label": "setStyleSheet()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L48_C4", "vector": [8, 2, 0.7324, 0.0141, 2, 0.27, 0.75, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.ui.arm_right.setStyleSheet(ARM_STYLESHEET % (\"right\", \"off\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Assign_L53_C8", "label": "self.cur_arm =", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L48_C4", "vector": [14, 2, 0.7465, 0.0141, 2, 0.27, 1.0, 847, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.cur_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cur_arm = \"l\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L55_C4", "label": "arm_right_clk", "type": "function", "loc": [55, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:ClassDef_L18_C0", "vector": [2, 1, 0.8169, 0.0986, 1, 0.51, 1.0, 89, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "arm_right_clk", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def arm_right_clk(self):\n self.arm_state_pub.publish(String(\"r\"))\n self.ui.arm_right.setDisabled(True)\n self.ui.arm_left.setEnabled(True)\n self.ui.arm_left.setStyleSheet(ARM_STYLESHEET % (\"left\", \"off\"))\n self.ui.arm_right.setStyleSheet(ARM_STYLESHEET % (\"right\", \"on\"))\n self.cur_arm = \"r\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L56_C8", "label": "publish()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L55_C4", "vector": [8, 2, 0.7887, 0.0141, 2, 0.55, 0.0, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.arm_state_pub.publish(String(\"r\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L57_C8", "label": "setDisabled()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L55_C4", "vector": [8, 2, 0.8028, 0.0141, 2, 0.55, 0.2, 533, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setDisabled", "arg_names": [], "import_names": [], "rhs_call_name": "setDisabled", "annotation": ""}, "snippet": " self.ui.arm_right.setDisabled(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L58_C8", "label": "setEnabled()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L55_C4", "vector": [8, 2, 0.8169, 0.0141, 2, 0.55, 0.4, 503, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setEnabled", "arg_names": [], "import_names": [], "rhs_call_name": "setEnabled", "annotation": ""}, "snippet": " self.ui.arm_left.setEnabled(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L59_C8", "label": "setStyleSheet()", "type": "expression", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L55_C4", "vector": [8, 2, 0.831, 0.0141, 2, 0.55, 0.6, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.ui.arm_left.setStyleSheet(ARM_STYLESHEET % (\"left\", \"off\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L60_C8", "label": "setStyleSheet()", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L55_C4", "vector": [8, 2, 0.8451, 0.0141, 2, 0.55, 0.8, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.ui.arm_right.setStyleSheet(ARM_STYLESHEET % (\"right\", \"on\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Assign_L61_C8", "label": "self.cur_arm =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L55_C4", "vector": [14, 2, 0.8592, 0.0141, 2, 0.55, 1.0, 847, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.cur_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cur_arm = \"r\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L63_C0", "label": "main", "type": "function", "loc": [63, 68], "level": 0, "parent": null, "vector": [2, 0, 0.9225, 0.0845, 0, 0.66, 0.9167, 624, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n rospy.init_node(\"arm_cart_control_interface\")\n app = QtGui.QApplication(sys.argv)\n frame = ArmCartControlGUIFrame()\n frame.show()\n sys.exit(app.exec_())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L64_C4", "label": "init_node()", "type": "expression", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L63_C0", "vector": [8, 1, 0.9014, 0.0141, 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(\"arm_cart_control_interface\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Assign_L65_C4", "label": "app = QApplication()", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L63_C0", "vector": [14, 1, 0.9155, 0.0141, 1, 0.64, 0.25, 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_99290:Assign_L66_C4", "label": "frame = ArmCartControlGUIFrame()", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L63_C0", "vector": [14, 1, 0.9296, 0.0141, 1, 0.64, 0.5, 313, 3, 0, 0, 0, 770, 10, 1], "semantic": {"name": "frame", "arg_names": [], "import_names": [], "rhs_call_name": "ArmCartControlGUIFrame", "annotation": ""}, "snippet": " frame = ArmCartControlGUIFrame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L67_C4", "label": "show()", "type": "expression", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L63_C0", "vector": [8, 1, 0.9437, 0.0141, 1, 0.64, 0.75, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " frame.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L68_C4", "label": "exit()", "type": "expression", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L63_C0", "vector": [8, 1, 0.9577, 0.0141, 1, 0.64, 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_())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:If_L70_C0", "label": "if", "type": "if", "loc": [70, 71], "level": 0, "parent": null, "vector": [4, 0, 0.993, 0.0282, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L71_C4", "label": "main()", "type": "expression", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99290:If_L70_C0", "vector": [8, 1, 1.0, 0.0141, 1, 0.81, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99290:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:For_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:For_L41_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L42_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:For_L41_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:If_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:If_L43_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Assign_L44_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99290:If_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99290:Expr_L71_C4"}]
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'servoing_ui.ui' # # Created: Fri Jan 27 04:16:54 2012 # by: PyQt4 UI code generator 4.7.2 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui class Ui_Frame(object): def setupUi(self, Frame): Frame.setObjectName("Frame") Frame.resize(403, 274) Frame.setFrameShape(QtGui.QFrame.StyledPanel) Frame.setFrameShadow(QtGui.QFrame.Raised) self.stop_moving = QtGui.QPushButton(Frame) self.stop_moving.setEnabled(True) self.stop_moving.setGeometry(QtCore.QRect(30, 20, 141, 131)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(18, 33, 126)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(193, 193, 193)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(18, 33, 126)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(18, 33, 126)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(197, 197, 197)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(163, 163, 163)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(255, 57, 252)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Highlight, brush) brush = QtGui.QBrush(QtGui.QColor(18, 33, 126)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(193, 193, 193)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(18, 33, 126)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(18, 33, 126)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(197, 197, 197)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(163, 163, 163)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(255, 57, 252)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Highlight, brush) brush = QtGui.QBrush(QtGui.QColor(18, 33, 126)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(193, 193, 193)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(18, 33, 126)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(18, 33, 126)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(163, 163, 163)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(163, 163, 163)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(255, 57, 252)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Highlight, brush) self.stop_moving.setPalette(palette) self.stop_moving.setStyleSheet("font: 75 18pt \"AlArabiya\";\n" "selection-background-color: rgb(255, 57, 252);\n" "background-color: rgb(255, 0, 0);\n" "color: rgb(18, 33, 126);") self.stop_moving.setObjectName("stop_moving") self.find_ar_tag = QtGui.QPushButton(Frame) self.find_ar_tag.setGeometry(QtCore.QRect(190, 20, 181, 61)) self.find_ar_tag.setStyleSheet("font: 75 18pt \"AlArabiya\";\n" "background-color: rgb(55, 168, 255);") self.find_ar_tag.setObjectName("find_ar_tag") self.begin_servoing = QtGui.QPushButton(Frame) self.begin_servoing.setGeometry(QtCore.QRect(190, 90, 181, 61)) self.begin_servoing.setStyleSheet("font: 75 18pt \"AlArabiya\";\n" "background-color: rgb(34, 255, 78);") self.begin_servoing.setObjectName("begin_servoing") self.state_information = QtGui.QLabel(Frame) self.state_information.setGeometry(QtCore.QRect(30, 160, 341, 91)) self.state_information.setStyleSheet("font: 16pt \"AlArabiya\";") self.state_information.setObjectName("state_information") self.retranslateUi(Frame) QtCore.QMetaObject.connectSlotsByName(Frame) def retranslateUi(self, Frame): Frame.setWindowTitle(QtGui.QApplication.translate("Frame", "Frame", None, QtGui.QApplication.UnicodeUTF8)) self.stop_moving.setText(QtGui.QApplication.translate("Frame", "Stop\n" "Moving", None, QtGui.QApplication.UnicodeUTF8)) self.find_ar_tag.setText(QtGui.QApplication.translate("Frame", "Find AR Tag", None, QtGui.QApplication.UnicodeUTF8)) self.begin_servoing.setText(QtGui.QApplication.translate("Frame", "Begin Servoing", None, QtGui.QApplication.UnicodeUTF8)) self.state_information.setText(QtGui.QApplication.translate("Frame", "State Information\n" "", None, QtGui.QApplication.UnicodeUTF8))
ajibawa-2023/Python-Code-Large/train/row_99291
97
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_99291:ImportFrom_L10_C0", "label": "from PyQt4 import QtCore, QtGui", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0855, 0.0085, 0, 0.66, 0.0, 154, 0, 2, 0, 0, 154, 0, 0], "semantic": {"name": "PyQt4", "arg_names": [], "import_names": ["QtCore", "QtGui"], "rhs_call_name": "", "annotation": ""}, "snippet": "from PyQt4 import QtCore, QtGui"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:ClassDef_L12_C0", "label": "Ui_Frame", "type": "class", "loc": [12, 116], "level": 0, "parent": null, "vector": [3, 0, 0.547, 0.8974, 0, 0.66, 1.0, 206, 0, 2, 0, 0, 186, 0, 99], "semantic": {"name": "Ui_Frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Ui_Frame(object):\n def setupUi(self, Frame):\n Frame.setObjectName(\"Frame\")\n Frame.resize(403, 274)\n Frame.setFrameShape(QtGui.QFrame.StyledPanel)\n Frame.setFrameShadow(QtGui.QFrame.Raised)\n self.stop_moving = QtGui.QPushButton(Frame)\n self.stop_moving.setEnabled(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "label": "setupUi", "type": "function", "loc": [13, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:ClassDef_L12_C0", "vector": [2, 1, 0.5128, 0.812, 1, 0.51, 0.0, 419, 0, 2, 0, 0, 0, 0, 99], "semantic": {"name": "setupUi", "arg_names": ["self", "Frame"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setupUi(self, Frame):\n Frame.setObjectName(\"Frame\")\n Frame.resize(403, 274)\n Frame.setFrameShape(QtGui.QFrame.StyledPanel)\n Frame.setFrameShadow(QtGui.QFrame.Raised)\n self.stop_moving = QtGui.QPushButton(Frame)\n self.stop_moving.setEnabled(True)\n self.stop_moving.setGeometry(QtCore.QRect(30, 20, 141, 131))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L14_C8", "label": "setObjectName()", "type": "expression", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.1197, 0.0085, 2, 0.35, 0.0, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " Frame.setObjectName(\"Frame\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L15_C8", "label": "resize()", "type": "expression", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.1282, 0.0085, 2, 0.35, 0.0115, 834, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "resize", "arg_names": [], "import_names": [], "rhs_call_name": "resize", "annotation": ""}, "snippet": " Frame.resize(403, 274)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L16_C8", "label": "setFrameShape()", "type": "expression", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.1368, 0.0085, 2, 0.35, 0.023, 970, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setFrameShape", "arg_names": [], "import_names": [], "rhs_call_name": "setFrameShape", "annotation": ""}, "snippet": " Frame.setFrameShape(QtGui.QFrame.StyledPanel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L17_C8", "label": "setFrameShadow()", "type": "expression", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.1453, 0.0085, 2, 0.35, 0.0345, 695, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setFrameShadow", "arg_names": [], "import_names": [], "rhs_call_name": "setFrameShadow", "annotation": ""}, "snippet": " Frame.setFrameShadow(QtGui.QFrame.Raised)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L18_C8", "label": "self.stop_moving = QPushButton()", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.1538, 0.0085, 2, 0.35, 0.046, 111, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.stop_moving", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.stop_moving = QtGui.QPushButton(Frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L19_C8", "label": "setEnabled()", "type": "expression", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.1624, 0.0085, 2, 0.35, 0.0575, 503, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setEnabled", "arg_names": [], "import_names": [], "rhs_call_name": "setEnabled", "annotation": ""}, "snippet": " self.stop_moving.setEnabled(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L20_C8", "label": "setGeometry()", "type": "expression", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.1709, 0.0085, 2, 0.35, 0.069, 648, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setGeometry", "arg_names": [], "import_names": [], "rhs_call_name": "setGeometry", "annotation": ""}, "snippet": " self.stop_moving.setGeometry(QtCore.QRect(30, 20, 141, 131))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L21_C8", "label": "palette = QPalette()", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.1795, 0.0085, 2, 0.35, 0.0805, 737, 3, 0, 0, 0, 220, 10, 1], "semantic": {"name": "palette", "arg_names": [], "import_names": [], "rhs_call_name": "QPalette", "annotation": ""}, "snippet": " palette = QtGui.QPalette()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L22_C8", "label": "brush = QBrush()", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.188, 0.0085, 2, 0.35, 0.092, 357, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "brush", "arg_names": [], "import_names": [], "rhs_call_name": "QBrush", "annotation": ""}, "snippet": " brush = QtGui.QBrush(QtGui.QColor(18, 33, 126))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L23_C8", "label": "setStyle()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.1966, 0.0085, 2, 0.35, 0.1034, 691, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyle", "arg_names": [], "import_names": [], "rhs_call_name": "setStyle", "annotation": ""}, "snippet": " brush.setStyle(QtCore.Qt.SolidPattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L24_C8", "label": "setBrush()", "type": "expression", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.2051, 0.0085, 2, 0.35, 0.1149, 254, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setBrush", "arg_names": [], "import_names": [], "rhs_call_name": "setBrush", "annotation": ""}, "snippet": " palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L25_C8", "label": "brush = QBrush()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.2137, 0.0085, 2, 0.35, 0.1264, 357, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "brush", "arg_names": [], "import_names": [], "rhs_call_name": "QBrush", "annotation": ""}, "snippet": " brush = QtGui.QBrush(QtGui.QColor(193, 193, 193))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L26_C8", "label": "setStyle()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.2222, 0.0085, 2, 0.35, 0.1379, 691, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyle", "arg_names": [], "import_names": [], "rhs_call_name": "setStyle", "annotation": ""}, "snippet": " brush.setStyle(QtCore.Qt.SolidPattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L27_C8", "label": "setBrush()", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.2308, 0.0085, 2, 0.35, 0.1494, 254, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setBrush", "arg_names": [], "import_names": [], "rhs_call_name": "setBrush", "annotation": ""}, "snippet": " palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L28_C8", "label": "brush = QBrush()", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.2393, 0.0085, 2, 0.35, 0.1609, 357, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "brush", "arg_names": [], "import_names": [], "rhs_call_name": "QBrush", "annotation": ""}, "snippet": " brush = QtGui.QBrush(QtGui.QColor(18, 33, 126))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L29_C8", "label": "setStyle()", "type": "expression", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.2479, 0.0085, 2, 0.35, 0.1724, 691, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyle", "arg_names": [], "import_names": [], "rhs_call_name": "setStyle", "annotation": ""}, "snippet": " brush.setStyle(QtCore.Qt.SolidPattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L30_C8", "label": "setBrush()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.2564, 0.0085, 2, 0.35, 0.1839, 254, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setBrush", "arg_names": [], "import_names": [], "rhs_call_name": "setBrush", "annotation": ""}, "snippet": " palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L31_C8", "label": "brush = QBrush()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.265, 0.0085, 2, 0.35, 0.1954, 357, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "brush", "arg_names": [], "import_names": [], "rhs_call_name": "QBrush", "annotation": ""}, "snippet": " brush = QtGui.QBrush(QtGui.QColor(18, 33, 126))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L32_C8", "label": "setStyle()", "type": "expression", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.2735, 0.0085, 2, 0.35, 0.2069, 691, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyle", "arg_names": [], "import_names": [], "rhs_call_name": "setStyle", "annotation": ""}, "snippet": " brush.setStyle(QtCore.Qt.SolidPattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L33_C8", "label": "setBrush()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.2821, 0.0085, 2, 0.35, 0.2184, 254, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setBrush", "arg_names": [], "import_names": [], "rhs_call_name": "setBrush", "annotation": ""}, "snippet": " palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L34_C8", "label": "brush = QBrush()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.2906, 0.0085, 2, 0.35, 0.2299, 357, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "brush", "arg_names": [], "import_names": [], "rhs_call_name": "QBrush", "annotation": ""}, "snippet": " brush = QtGui.QBrush(QtGui.QColor(197, 197, 197))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L35_C8", "label": "setStyle()", "type": "expression", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.2991, 0.0085, 2, 0.35, 0.2414, 691, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyle", "arg_names": [], "import_names": [], "rhs_call_name": "setStyle", "annotation": ""}, "snippet": " brush.setStyle(QtCore.Qt.SolidPattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L36_C8", "label": "setBrush()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.3077, 0.0085, 2, 0.35, 0.2529, 254, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setBrush", "arg_names": [], "import_names": [], "rhs_call_name": "setBrush", "annotation": ""}, "snippet": " palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L37_C8", "label": "brush = QBrush()", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.3162, 0.0085, 2, 0.35, 0.2644, 357, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "brush", "arg_names": [], "import_names": [], "rhs_call_name": "QBrush", "annotation": ""}, "snippet": " brush = QtGui.QBrush(QtGui.QColor(163, 163, 163))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L38_C8", "label": "setStyle()", "type": "expression", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.3248, 0.0085, 2, 0.35, 0.2759, 691, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyle", "arg_names": [], "import_names": [], "rhs_call_name": "setStyle", "annotation": ""}, "snippet": " brush.setStyle(QtCore.Qt.SolidPattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L39_C8", "label": "setBrush()", "type": "expression", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.3333, 0.0085, 2, 0.35, 0.2874, 254, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setBrush", "arg_names": [], "import_names": [], "rhs_call_name": "setBrush", "annotation": ""}, "snippet": " palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L40_C8", "label": "brush = QBrush()", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.3419, 0.0085, 2, 0.35, 0.2989, 357, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "brush", "arg_names": [], "import_names": [], "rhs_call_name": "QBrush", "annotation": ""}, "snippet": " brush = QtGui.QBrush(QtGui.QColor(255, 57, 252))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L41_C8", "label": "setStyle()", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.3504, 0.0085, 2, 0.35, 0.3103, 691, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyle", "arg_names": [], "import_names": [], "rhs_call_name": "setStyle", "annotation": ""}, "snippet": " brush.setStyle(QtCore.Qt.SolidPattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L42_C8", "label": "setBrush()", "type": "expression", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.359, 0.0085, 2, 0.35, 0.3218, 254, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setBrush", "arg_names": [], "import_names": [], "rhs_call_name": "setBrush", "annotation": ""}, "snippet": " palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Highlight, brush)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L43_C8", "label": "brush = QBrush()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.3675, 0.0085, 2, 0.35, 0.3333, 357, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "brush", "arg_names": [], "import_names": [], "rhs_call_name": "QBrush", "annotation": ""}, "snippet": " brush = QtGui.QBrush(QtGui.QColor(18, 33, 126))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L44_C8", "label": "setStyle()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.3761, 0.0085, 2, 0.35, 0.3448, 691, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyle", "arg_names": [], "import_names": [], "rhs_call_name": "setStyle", "annotation": ""}, "snippet": " brush.setStyle(QtCore.Qt.SolidPattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L45_C8", "label": "setBrush()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.3846, 0.0085, 2, 0.35, 0.3563, 254, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setBrush", "arg_names": [], "import_names": [], "rhs_call_name": "setBrush", "annotation": ""}, "snippet": " palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L46_C8", "label": "brush = QBrush()", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.3932, 0.0085, 2, 0.35, 0.3678, 357, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "brush", "arg_names": [], "import_names": [], "rhs_call_name": "QBrush", "annotation": ""}, "snippet": " brush = QtGui.QBrush(QtGui.QColor(193, 193, 193))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L47_C8", "label": "setStyle()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.4017, 0.0085, 2, 0.35, 0.3793, 691, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyle", "arg_names": [], "import_names": [], "rhs_call_name": "setStyle", "annotation": ""}, "snippet": " brush.setStyle(QtCore.Qt.SolidPattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L48_C8", "label": "setBrush()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.4103, 0.0085, 2, 0.35, 0.3908, 254, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setBrush", "arg_names": [], "import_names": [], "rhs_call_name": "setBrush", "annotation": ""}, "snippet": " palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L49_C8", "label": "brush = QBrush()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.4188, 0.0085, 2, 0.35, 0.4023, 357, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "brush", "arg_names": [], "import_names": [], "rhs_call_name": "QBrush", "annotation": ""}, "snippet": " brush = QtGui.QBrush(QtGui.QColor(18, 33, 126))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L50_C8", "label": "setStyle()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.4274, 0.0085, 2, 0.35, 0.4138, 691, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyle", "arg_names": [], "import_names": [], "rhs_call_name": "setStyle", "annotation": ""}, "snippet": " brush.setStyle(QtCore.Qt.SolidPattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L51_C8", "label": "setBrush()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.4359, 0.0085, 2, 0.35, 0.4253, 254, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setBrush", "arg_names": [], "import_names": [], "rhs_call_name": "setBrush", "annotation": ""}, "snippet": " palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L52_C8", "label": "brush = QBrush()", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.4444, 0.0085, 2, 0.35, 0.4368, 357, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "brush", "arg_names": [], "import_names": [], "rhs_call_name": "QBrush", "annotation": ""}, "snippet": " brush = QtGui.QBrush(QtGui.QColor(18, 33, 126))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L53_C8", "label": "setStyle()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.453, 0.0085, 2, 0.35, 0.4483, 691, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyle", "arg_names": [], "import_names": [], "rhs_call_name": "setStyle", "annotation": ""}, "snippet": " brush.setStyle(QtCore.Qt.SolidPattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L54_C8", "label": "setBrush()", "type": "expression", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.4615, 0.0085, 2, 0.35, 0.4598, 254, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setBrush", "arg_names": [], "import_names": [], "rhs_call_name": "setBrush", "annotation": ""}, "snippet": " palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L55_C8", "label": "brush = QBrush()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.4701, 0.0085, 2, 0.35, 0.4713, 357, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "brush", "arg_names": [], "import_names": [], "rhs_call_name": "QBrush", "annotation": ""}, "snippet": " brush = QtGui.QBrush(QtGui.QColor(197, 197, 197))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L56_C8", "label": "setStyle()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.4786, 0.0085, 2, 0.35, 0.4828, 691, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyle", "arg_names": [], "import_names": [], "rhs_call_name": "setStyle", "annotation": ""}, "snippet": " brush.setStyle(QtCore.Qt.SolidPattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L57_C8", "label": "setBrush()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.4872, 0.0085, 2, 0.35, 0.4943, 254, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setBrush", "arg_names": [], "import_names": [], "rhs_call_name": "setBrush", "annotation": ""}, "snippet": " palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L58_C8", "label": "brush = QBrush()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.4957, 0.0085, 2, 0.35, 0.5057, 357, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "brush", "arg_names": [], "import_names": [], "rhs_call_name": "QBrush", "annotation": ""}, "snippet": " brush = QtGui.QBrush(QtGui.QColor(163, 163, 163))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L59_C8", "label": "setStyle()", "type": "expression", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.5043, 0.0085, 2, 0.35, 0.5172, 691, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyle", "arg_names": [], "import_names": [], "rhs_call_name": "setStyle", "annotation": ""}, "snippet": " brush.setStyle(QtCore.Qt.SolidPattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L60_C8", "label": "setBrush()", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.5128, 0.0085, 2, 0.35, 0.5287, 254, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setBrush", "arg_names": [], "import_names": [], "rhs_call_name": "setBrush", "annotation": ""}, "snippet": " palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L61_C8", "label": "brush = QBrush()", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.5214, 0.0085, 2, 0.35, 0.5402, 357, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "brush", "arg_names": [], "import_names": [], "rhs_call_name": "QBrush", "annotation": ""}, "snippet": " brush = QtGui.QBrush(QtGui.QColor(255, 57, 252))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L62_C8", "label": "setStyle()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.5299, 0.0085, 2, 0.35, 0.5517, 691, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyle", "arg_names": [], "import_names": [], "rhs_call_name": "setStyle", "annotation": ""}, "snippet": " brush.setStyle(QtCore.Qt.SolidPattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L63_C8", "label": "setBrush()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.5385, 0.0085, 2, 0.35, 0.5632, 254, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setBrush", "arg_names": [], "import_names": [], "rhs_call_name": "setBrush", "annotation": ""}, "snippet": " palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Highlight, brush)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L64_C8", "label": "brush = QBrush()", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.547, 0.0085, 2, 0.35, 0.5747, 357, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "brush", "arg_names": [], "import_names": [], "rhs_call_name": "QBrush", "annotation": ""}, "snippet": " brush = QtGui.QBrush(QtGui.QColor(18, 33, 126))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L65_C8", "label": "setStyle()", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.5556, 0.0085, 2, 0.35, 0.5862, 691, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyle", "arg_names": [], "import_names": [], "rhs_call_name": "setStyle", "annotation": ""}, "snippet": " brush.setStyle(QtCore.Qt.SolidPattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L66_C8", "label": "setBrush()", "type": "expression", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.5641, 0.0085, 2, 0.35, 0.5977, 254, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setBrush", "arg_names": [], "import_names": [], "rhs_call_name": "setBrush", "annotation": ""}, "snippet": " palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L67_C8", "label": "brush = QBrush()", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.5726, 0.0085, 2, 0.35, 0.6092, 357, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "brush", "arg_names": [], "import_names": [], "rhs_call_name": "QBrush", "annotation": ""}, "snippet": " brush = QtGui.QBrush(QtGui.QColor(193, 193, 193))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L68_C8", "label": "setStyle()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.5812, 0.0085, 2, 0.35, 0.6207, 691, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyle", "arg_names": [], "import_names": [], "rhs_call_name": "setStyle", "annotation": ""}, "snippet": " brush.setStyle(QtCore.Qt.SolidPattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L69_C8", "label": "setBrush()", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.5897, 0.0085, 2, 0.35, 0.6322, 254, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setBrush", "arg_names": [], "import_names": [], "rhs_call_name": "setBrush", "annotation": ""}, "snippet": " palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L70_C8", "label": "brush = QBrush()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.5983, 0.0085, 2, 0.35, 0.6437, 357, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "brush", "arg_names": [], "import_names": [], "rhs_call_name": "QBrush", "annotation": ""}, "snippet": " brush = QtGui.QBrush(QtGui.QColor(18, 33, 126))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L71_C8", "label": "setStyle()", "type": "expression", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.6068, 0.0085, 2, 0.35, 0.6552, 691, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyle", "arg_names": [], "import_names": [], "rhs_call_name": "setStyle", "annotation": ""}, "snippet": " brush.setStyle(QtCore.Qt.SolidPattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L72_C8", "label": "setBrush()", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.6154, 0.0085, 2, 0.35, 0.6667, 254, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setBrush", "arg_names": [], "import_names": [], "rhs_call_name": "setBrush", "annotation": ""}, "snippet": " palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L73_C8", "label": "brush = QBrush()", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.6239, 0.0085, 2, 0.35, 0.6782, 357, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "brush", "arg_names": [], "import_names": [], "rhs_call_name": "QBrush", "annotation": ""}, "snippet": " brush = QtGui.QBrush(QtGui.QColor(18, 33, 126))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L74_C8", "label": "setStyle()", "type": "expression", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.6325, 0.0085, 2, 0.35, 0.6897, 691, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyle", "arg_names": [], "import_names": [], "rhs_call_name": "setStyle", "annotation": ""}, "snippet": " brush.setStyle(QtCore.Qt.SolidPattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L75_C8", "label": "setBrush()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.641, 0.0085, 2, 0.35, 0.7011, 254, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setBrush", "arg_names": [], "import_names": [], "rhs_call_name": "setBrush", "annotation": ""}, "snippet": " palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L76_C8", "label": "brush = QBrush()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.6496, 0.0085, 2, 0.35, 0.7126, 357, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "brush", "arg_names": [], "import_names": [], "rhs_call_name": "QBrush", "annotation": ""}, "snippet": " brush = QtGui.QBrush(QtGui.QColor(163, 163, 163))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L77_C8", "label": "setStyle()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.6581, 0.0085, 2, 0.35, 0.7241, 691, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyle", "arg_names": [], "import_names": [], "rhs_call_name": "setStyle", "annotation": ""}, "snippet": " brush.setStyle(QtCore.Qt.SolidPattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L78_C8", "label": "setBrush()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.6667, 0.0085, 2, 0.35, 0.7356, 254, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setBrush", "arg_names": [], "import_names": [], "rhs_call_name": "setBrush", "annotation": ""}, "snippet": " palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L79_C8", "label": "brush = QBrush()", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.6752, 0.0085, 2, 0.35, 0.7471, 357, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "brush", "arg_names": [], "import_names": [], "rhs_call_name": "QBrush", "annotation": ""}, "snippet": " brush = QtGui.QBrush(QtGui.QColor(163, 163, 163))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L80_C8", "label": "setStyle()", "type": "expression", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.6838, 0.0085, 2, 0.35, 0.7586, 691, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyle", "arg_names": [], "import_names": [], "rhs_call_name": "setStyle", "annotation": ""}, "snippet": " brush.setStyle(QtCore.Qt.SolidPattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L81_C8", "label": "setBrush()", "type": "expression", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.6923, 0.0085, 2, 0.35, 0.7701, 254, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setBrush", "arg_names": [], "import_names": [], "rhs_call_name": "setBrush", "annotation": ""}, "snippet": " palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L82_C8", "label": "brush = QBrush()", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.7009, 0.0085, 2, 0.35, 0.7816, 357, 3, 1, 0, 0, 528, 10, 2], "semantic": {"name": "brush", "arg_names": [], "import_names": [], "rhs_call_name": "QBrush", "annotation": ""}, "snippet": " brush = QtGui.QBrush(QtGui.QColor(255, 57, 252))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L83_C8", "label": "setStyle()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.7094, 0.0085, 2, 0.35, 0.7931, 691, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyle", "arg_names": [], "import_names": [], "rhs_call_name": "setStyle", "annotation": ""}, "snippet": " brush.setStyle(QtCore.Qt.SolidPattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L84_C8", "label": "setBrush()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.7179, 0.0085, 2, 0.35, 0.8046, 254, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setBrush", "arg_names": [], "import_names": [], "rhs_call_name": "setBrush", "annotation": ""}, "snippet": " palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Highlight, brush)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L85_C8", "label": "setPalette()", "type": "expression", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.7265, 0.0085, 2, 0.35, 0.8161, 212, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setPalette", "arg_names": [], "import_names": [], "rhs_call_name": "setPalette", "annotation": ""}, "snippet": " self.stop_moving.setPalette(palette)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L86_C8", "label": "setStyleSheet()", "type": "expression", "loc": [86, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.7479, 0.0342, 2, 0.35, 0.8276, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.stop_moving.setStyleSheet(\"font: 75 18pt \\\"AlArabiya\\\";\\n\"\n\"selection-background-color: rgb(255, 57, 252);\\n\"\n\"background-color: rgb(255, 0, 0);\\n\"\n\"color: rgb(18, 33, 126);\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L90_C8", "label": "setObjectName()", "type": "expression", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.7692, 0.0085, 2, 0.35, 0.8391, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.stop_moving.setObjectName(\"stop_moving\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L91_C8", "label": "self.find_ar_tag = QPushButton()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.7778, 0.0085, 2, 0.35, 0.8506, 972, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.find_ar_tag", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.find_ar_tag = QtGui.QPushButton(Frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L92_C8", "label": "setGeometry()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.7863, 0.0085, 2, 0.35, 0.8621, 648, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setGeometry", "arg_names": [], "import_names": [], "rhs_call_name": "setGeometry", "annotation": ""}, "snippet": " self.find_ar_tag.setGeometry(QtCore.QRect(190, 20, 181, 61))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L93_C8", "label": "setStyleSheet()", "type": "expression", "loc": [93, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.7991, 0.0171, 2, 0.35, 0.8736, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.find_ar_tag.setStyleSheet(\"font: 75 18pt \\\"AlArabiya\\\";\\n\"\n\"background-color: rgb(55, 168, 255);\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L95_C8", "label": "setObjectName()", "type": "expression", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.812, 0.0085, 2, 0.35, 0.8851, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.find_ar_tag.setObjectName(\"find_ar_tag\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L96_C8", "label": "self.begin_servoing = QPushButton()", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.8205, 0.0085, 2, 0.35, 0.8966, 864, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.begin_servoing", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.begin_servoing = QtGui.QPushButton(Frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L97_C8", "label": "setGeometry()", "type": "expression", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.8291, 0.0085, 2, 0.35, 0.908, 648, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setGeometry", "arg_names": [], "import_names": [], "rhs_call_name": "setGeometry", "annotation": ""}, "snippet": " self.begin_servoing.setGeometry(QtCore.QRect(190, 90, 181, 61))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L98_C8", "label": "setStyleSheet()", "type": "expression", "loc": [98, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.8419, 0.0171, 2, 0.35, 0.9195, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.begin_servoing.setStyleSheet(\"font: 75 18pt \\\"AlArabiya\\\";\\n\"\n\"background-color: rgb(34, 255, 78);\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L100_C8", "label": "setObjectName()", "type": "expression", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.8547, 0.0085, 2, 0.35, 0.931, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.begin_servoing.setObjectName(\"begin_servoing\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L101_C8", "label": "self.state_information = QLabel()", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [14, 2, 0.8632, 0.0085, 2, 0.35, 0.9425, 961, 3, 1, 0, 0, 495, 10, 1], "semantic": {"name": "self.state_information", "arg_names": [], "import_names": [], "rhs_call_name": "QLabel", "annotation": ""}, "snippet": " self.state_information = QtGui.QLabel(Frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L102_C8", "label": "setGeometry()", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.8718, 0.0085, 2, 0.35, 0.954, 648, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setGeometry", "arg_names": [], "import_names": [], "rhs_call_name": "setGeometry", "annotation": ""}, "snippet": " self.state_information.setGeometry(QtCore.QRect(30, 160, 341, 91))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L103_C8", "label": "setStyleSheet()", "type": "expression", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.8803, 0.0085, 2, 0.35, 0.9655, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.state_information.setStyleSheet(\"font: 16pt \\\"AlArabiya\\\";\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L104_C8", "label": "setObjectName()", "type": "expression", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.8889, 0.0085, 2, 0.35, 0.977, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.state_information.setObjectName(\"state_information\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L106_C8", "label": "retranslateUi()", "type": "expression", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.906, 0.0085, 2, 0.35, 0.9885, 520, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "retranslateUi", "arg_names": [], "import_names": [], "rhs_call_name": "retranslateUi", "annotation": ""}, "snippet": " self.retranslateUi(Frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L107_C8", "label": "connectSlotsByName()", "type": "expression", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "vector": [8, 2, 0.9145, 0.0085, 2, 0.35, 1.0, 419, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "connectSlotsByName", "arg_names": [], "import_names": [], "rhs_call_name": "connectSlotsByName", "annotation": ""}, "snippet": " QtCore.QMetaObject.connectSlotsByName(Frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L109_C4", "label": "retranslateUi", "type": "function", "loc": [109, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:ClassDef_L12_C0", "vector": [2, 1, 0.9615, 0.0684, 1, 0.51, 1.0, 520, 0, 2, 0, 0, 0, 0, 10], "semantic": {"name": "retranslateUi", "arg_names": ["self", "Frame"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def retranslateUi(self, Frame):\n Frame.setWindowTitle(QtGui.QApplication.translate(\"Frame\", \"Frame\", None, QtGui.QApplication.UnicodeUTF8))\n self.stop_moving.setText(QtGui.QApplication.translate(\"Frame\", \"Stop\\n\"\n\"Moving\", None, QtGui.QApplication.UnicodeUTF8))\n self.find_ar_tag.setText(QtGui.QApplication.translate(\"Frame\", \"Find AR Tag\", None, QtGui.QApplication.UnicodeUTF8))\n self.begin_servoing.setText(QtGui.QApplication.translate(\"Frame\", \"Begin Servoing\", None, QtGui.QApplication.UnicodeUTF8))\n self.state_information.setText(QtGui.QApplication.translate(\"Frame\", \"State Information\\n\"\n\"\", None, QtGui.QApplication.UnicodeUTF8))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L110_C8", "label": "setWindowTitle()", "type": "expression", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L109_C4", "vector": [8, 2, 0.9402, 0.0085, 2, 0.53, 0.0, 38, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setWindowTitle", "arg_names": [], "import_names": [], "rhs_call_name": "setWindowTitle", "annotation": ""}, "snippet": " Frame.setWindowTitle(QtGui.QApplication.translate(\"Frame\", \"Frame\", None, QtGui.QApplication.UnicodeUTF8))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L111_C8", "label": "setText()", "type": "expression", "loc": [111, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L109_C4", "vector": [8, 2, 0.953, 0.0171, 2, 0.53, 0.25, 40, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.stop_moving.setText(QtGui.QApplication.translate(\"Frame\", \"Stop\\n\"\n\"Moving\", None, QtGui.QApplication.UnicodeUTF8))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L113_C8", "label": "setText()", "type": "expression", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L109_C4", "vector": [8, 2, 0.9658, 0.0085, 2, 0.53, 0.5, 40, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.find_ar_tag.setText(QtGui.QApplication.translate(\"Frame\", \"Find AR Tag\", None, QtGui.QApplication.UnicodeUTF8))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L114_C8", "label": "setText()", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L109_C4", "vector": [8, 2, 0.9744, 0.0085, 2, 0.53, 0.75, 40, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.begin_servoing.setText(QtGui.QApplication.translate(\"Frame\", \"Begin Servoing\", None, QtGui.QApplication.UnicodeUTF8))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L115_C8", "label": "setText()", "type": "expression", "loc": [115, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L109_C4", "vector": [8, 2, 0.9872, 0.0171, 2, 0.53, 1.0, 40, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.state_information.setText(QtGui.QApplication.translate(\"Frame\", \"State Information\\n\"\n\"\", None, QtGui.QApplication.UnicodeUTF8))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99291:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99291:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99291:Expr_L115_C8"}]
#! /usr/bin/python import sys import numpy as np import roslib roslib.load_manifest("hrl_pr2_arms") roslib.load_manifest("kelsey_sandbox") import rospy from visualization_msgs.msg import Marker from geometry_msgs.msg import Point, Quaternion, Vector3 from std_msgs.msg import ColorRGBA from sensor_msgs.msg import JointState import urdf_interface as urdf import kdl_parser as kdlp from hrl_pr2_arms.kdl_arm_kinematics import KDLArmKinematics JOINT_STATE_INDS_R = [17, 18, 16, 20, 19, 21, 22] JOINT_STATE_INDS_L = [29, 30, 28, 32, 31, 33, 34] class JointForceViz: def __init__(self, arm): self.arm = arm self.vis_pub = rospy.Publisher("force_torque_markers", Marker) if arm == 'r': self.arm_inds = JOINT_STATE_INDS_R else: self.arm_inds = JOINT_STATE_INDS_L model = urdf.create_model_from_file("/etc/ros/diamondback/urdf/robot.xml") tree = kdlp.tree_from_urdf_model(model) chain = tree.getChain("torso_lift_link", "r_gripper_tool_frame") link_dict = {0:0, 1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:11} self.kinematics = KDLArmKinematics(chain=chain, link_dict=link_dict) self.colors = [ColorRGBA(1., 0., 0., 1.), ColorRGBA(0., 1., 0., 1.)] rospy.Subscriber("joint_states", JointState, self.joint_states_cb) self.last_CI = np.zeros((6, 6)) self.last_q_pos = np.zeros((7, 1)) def joint_states_cb(self, msg): q_pos = np.mat([msg.position[i] for i in self.arm_inds]).T #q_vel = np.mat([msg.velocity[i] for i in self.arm_inds]).T q_vel = (q_pos - self.last_q_pos) / 0.01 q_effort = np.mat([msg.effort[i] for i in self.arm_inds]).T fk_pos, fk_rot = self.kinematics.FK(q_pos) J = self.kinematics.jacobian(q_pos) F, res, rank, sing = np.linalg.lstsq(J.T, q_effort) #print "Force:", F[0:3] #print "Torque:", F[3:6] self.publish_vector(fk_pos, 0.01 * F[0:3], 0) self.publish_vector(fk_pos, 0.04 * F[3:6], 1) H = self.kinematics.inertia(q_pos) CI = self.kinematics.cart_inertia(q_pos) #print q_vel #print np.round(np.log10(np.fabs(CI))) #print np.linalg.norm(H, 2), np.linalg.norm(CI, 2), np.linalg.cond(J * np.linalg.inv(H) * J.T), np.linalg.cond(H) x_vel = J * q_vel #print np.linalg.norm(x_vel[:3],2) #print np.linalg.norm(x_vel, 2) #print np.linalg.norm((CI - self.last_CI) / 0.01 * x_vel, 2) print np.linalg.norm((CI * x_vel)[:3], 2) #print np.around(CI * x_vel, 3) self.last_CI = CI self.last_q_pos = q_pos def publish_vector(self, loc, v, m_id): m = Marker() m.header.frame_id = "torso_lift_link" m.header.stamp = rospy.Time() m.ns = "force_torque" m.id = m_id m.type = Marker.ARROW m.action = Marker.ADD m.points.append(Point(*loc)) m.points.append(Point(*(loc + v))) m.scale = Vector3(0.01, 0.02, 0.01) m.color = self.colors[m_id] self.vis_pub.publish(m) def main(): assert sys.argv[1] in ['r', 'l'] rospy.init_node("test_markers") jfv = JointForceViz(sys.argv[1]) rospy.spin() return if __name__ == "__main__": main()
ajibawa-2023/Python-Code-Large/train/row_99292
66
92
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0326, 0.0109, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Import_L4_C0", "label": "numpy import np", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0435, 0.0109, 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_99292:Import_L6_C0", "label": "roslib import roslib", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0652, 0.0109, 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"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0761, 0.0109, 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": "roslib.load_manifest(\"hrl_pr2_arms\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.087, 0.0109, 0, 0.66, 0.2353, 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(\"kelsey_sandbox\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Import_L9_C0", "label": "rospy import rospy", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0978, 0.0109, 0, 0.66, 0.2941, 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_99292:ImportFrom_L10_C0", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1087, 0.0109, 0, 0.66, 0.3529, 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_99292:ImportFrom_L11_C0", "label": "from geometry_msgs.msg import Point, Quaternion, Vector3", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1196, 0.0109, 0, 0.66, 0.4118, 951, 0, 3, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Point", "Quaternion", "Vector3"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Point, Quaternion, Vector3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:ImportFrom_L12_C0", "label": "from std_msgs.msg import ColorRGBA", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1304, 0.0109, 0, 0.66, 0.4706, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["ColorRGBA"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import ColorRGBA"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:ImportFrom_L13_C0", "label": "from sensor_msgs.msg import JointState", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.1413, 0.0109, 0, 0.66, 0.5294, 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_99292:Import_L15_C0", "label": "urdf_interface import urdf", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.163, 0.0109, 0, 0.66, 0.5882, 414, 0, 1, 0, 0, 414, 0, 0], "semantic": {"name": "urdf_interface", "arg_names": [], "import_names": ["urdf"], "rhs_call_name": "", "annotation": ""}, "snippet": "import urdf_interface as urdf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Import_L16_C0", "label": "kdl_parser import kdlp", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1739, 0.0109, 0, 0.66, 0.6471, 470, 0, 1, 0, 0, 470, 0, 0], "semantic": {"name": "kdl_parser", "arg_names": [], "import_names": ["kdlp"], "rhs_call_name": "", "annotation": ""}, "snippet": "import kdl_parser as kdlp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:ImportFrom_L17_C0", "label": "from hrl_pr2_arms.kdl_arm_kinematics import KDLArmKinematics", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.1848, 0.0109, 0, 0.66, 0.7059, 277, 0, 1, 0, 0, 277, 0, 0], "semantic": {"name": "hrl_pr2_arms.kdl_arm_kinematics", "arg_names": [], "import_names": ["KDLArmKinematics"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_pr2_arms.kdl_arm_kinematics import KDLArmKinematics"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L19_C0", "label": "JOINT_STATE_INDS_R =", "type": "assigned_variable", "loc": [19, 19], "level": 0, "parent": null, "vector": [14, 0, 0.2065, 0.0109, 0, 0.66, 0.7647, 720, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "JOINT_STATE_INDS_R", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "JOINT_STATE_INDS_R = [17, 18, 16, 20, 19, 21, 22]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L20_C0", "label": "JOINT_STATE_INDS_L =", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.2174, 0.0109, 0, 0.66, 0.8235, 742, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "JOINT_STATE_INDS_L", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "JOINT_STATE_INDS_L = [29, 30, 28, 32, 31, 33, 34]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:ClassDef_L22_C0", "label": "JointForceViz", "type": "class", "loc": [22, 80], "level": 0, "parent": null, "vector": [3, 0, 0.5543, 0.6413, 0, 0.66, 0.8824, 125, 0, 3, 0, 0, 0, 0, 29], "semantic": {"name": "JointForceViz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class JointForceViz:\n def __init__(self, arm):\n self.arm = arm\n self.vis_pub = rospy.Publisher(\"force_torque_markers\", Marker)\n if arm == 'r':\n self.arm_inds = JOINT_STATE_INDS_R\n else:\n self.arm_inds = JOINT_STATE_INDS_L"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "label": "__init__", "type": "function", "loc": [23, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:ClassDef_L22_C0", "vector": [2, 1, 0.337, 0.1848, 1, 0.45, 0.0, 555, 0, 2, 0, 0, 0, 0, 10], "semantic": {"name": "__init__", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arm):\n self.arm = arm\n self.vis_pub = rospy.Publisher(\"force_torque_markers\", Marker)\n if arm == 'r':\n self.arm_inds = JOINT_STATE_INDS_R\n else:\n self.arm_inds = JOINT_STATE_INDS_L\n model = urdf.create_model_from_file(\"/etc/ros/diamondback/urdf/robot.xml\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L24_C8", "label": "self.arm =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "vector": [14, 2, 0.2609, 0.0109, 2, 0.84, 0.0, 720, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm = arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L25_C8", "label": "self.vis_pub = Publisher()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "vector": [14, 2, 0.2717, 0.0109, 2, 0.84, 0.0909, 911, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.vis_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.vis_pub = rospy.Publisher(\"force_torque_markers\", Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:If_L26_C8", "label": "if", "type": "if", "loc": [26, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "vector": [4, 2, 0.2989, 0.0435, 2, 0.84, 0.1818, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'r':\n self.arm_inds = JOINT_STATE_INDS_R\n else:\n self.arm_inds = JOINT_STATE_INDS_L"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L27_C12", "label": "self.arm_inds =", "type": "assigned_variable", "loc": [27, 27], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:If_L26_C8", "vector": [14, 3, 0.2935, 0.0109, 3, 0.45, 0.0, 523, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arm_inds", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_inds = JOINT_STATE_INDS_R"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L29_C12", "label": "self.arm_inds =", "type": "assigned_variable", "loc": [29, 29], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:If_L26_C8", "vector": [14, 3, 0.3152, 0.0109, 3, 0.45, 1.0, 523, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arm_inds", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_inds = JOINT_STATE_INDS_L"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L30_C8", "label": "model = create_model_from_file()", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "vector": [14, 2, 0.3261, 0.0109, 2, 0.84, 0.2727, 722, 3, 1, 0, 0, 489, 10, 1], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "create_model_from_file", "annotation": ""}, "snippet": " model = urdf.create_model_from_file(\"/etc/ros/diamondback/urdf/robot.xml\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L31_C8", "label": "tree = tree_from_urdf_model()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "vector": [14, 2, 0.337, 0.0109, 2, 0.84, 0.3636, 613, 3, 1, 0, 0, 336, 10, 1], "semantic": {"name": "tree", "arg_names": [], "import_names": [], "rhs_call_name": "tree_from_urdf_model", "annotation": ""}, "snippet": " tree = kdlp.tree_from_urdf_model(model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L32_C8", "label": "chain = getChain()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "vector": [14, 2, 0.3478, 0.0109, 2, 0.84, 0.4545, 271, 3, 2, 0, 0, 420, 10, 1], "semantic": {"name": "chain", "arg_names": [], "import_names": [], "rhs_call_name": "getChain", "annotation": ""}, "snippet": " chain = tree.getChain(\"torso_lift_link\", \"r_gripper_tool_frame\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L33_C8", "label": "link_dict =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "vector": [14, 2, 0.3587, 0.0109, 2, 0.84, 0.5455, 602, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "link_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " link_dict = {0:0, 1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:11}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L34_C8", "label": "self.kinematics = KDLArmKinematics()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "vector": [14, 2, 0.3696, 0.0109, 2, 0.84, 0.6364, 239, 3, 2, 0, 0, 594, 10, 1], "semantic": {"name": "self.kinematics", "arg_names": [], "import_names": [], "rhs_call_name": "KDLArmKinematics", "annotation": ""}, "snippet": " self.kinematics = KDLArmKinematics(chain=chain, link_dict=link_dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L35_C8", "label": "self.colors =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "vector": [14, 2, 0.3804, 0.0109, 2, 0.84, 0.7273, 375, 0, 0, 0, 0, 0, 5, 2], "semantic": {"name": "self.colors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.colors = [ColorRGBA(1., 0., 0., 1.), ColorRGBA(0., 1., 0., 1.)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Expr_L36_C8", "label": "Subscriber()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "vector": [8, 2, 0.3913, 0.0109, 2, 0.84, 0.8182, 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_99292:Assign_L38_C8", "label": "self.last_CI = zeros()", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "vector": [14, 2, 0.413, 0.0109, 2, 0.84, 0.9091, 381, 3, 1, 0, 0, 213, 10, 1], "semantic": {"name": "self.last_CI", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " self.last_CI = np.zeros((6, 6))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L39_C8", "label": "self.last_q_pos = zeros()", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "vector": [14, 2, 0.4239, 0.0109, 2, 0.84, 1.0, 930, 3, 1, 0, 0, 213, 10, 1], "semantic": {"name": "self.last_q_pos", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " self.last_q_pos = np.zeros((7, 1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "label": "joint_states_cb", "type": "function", "loc": [41, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:ClassDef_L22_C0", "vector": [2, 1, 0.5761, 0.2717, 1, 0.45, 0.5, 800, 0, 2, 0, 0, 0, 0, 11], "semantic": {"name": "joint_states_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def joint_states_cb(self, msg):\n q_pos = np.mat([msg.position[i] for i in self.arm_inds]).T\n#q_vel = np.mat([msg.velocity[i] for i in self.arm_inds]).T\n q_vel = (q_pos - self.last_q_pos) / 0.01\n q_effort = np.mat([msg.effort[i] for i in self.arm_inds]).T\n fk_pos, fk_rot = self.kinematics.FK(q_pos)\n J = self.kinematics.jacobian(q_pos)\n F, res, rank, sing = np.linalg.lstsq(J.T, q_effort)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L42_C8", "label": "q_pos =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "vector": [14, 2, 0.4565, 0.0109, 2, 0.7, 0.0, 803, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "q_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pos = np.mat([msg.position[i] for i in self.arm_inds]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L44_C8", "label": "q_vel =", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "vector": [14, 2, 0.4783, 0.0109, 2, 0.7, 0.0769, 212, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q_vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_vel = (q_pos - self.last_q_pos) / 0.01"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L45_C8", "label": "q_effort =", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "vector": [14, 2, 0.4891, 0.0109, 2, 0.7, 0.1538, 594, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "q_effort", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_effort = np.mat([msg.effort[i] for i in self.arm_inds]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L46_C8", "label": "fk_pos, fk_rot = FK()", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "vector": [14, 2, 0.5, 0.0109, 2, 0.7, 0.2308, 28, 3, 1, 0, 0, 252, 10, 1], "semantic": {"name": "fk_pos, fk_rot", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " fk_pos, fk_rot = self.kinematics.FK(q_pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L47_C8", "label": "J = jacobian()", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "vector": [14, 2, 0.5109, 0.0109, 2, 0.7, 0.3077, 946, 3, 1, 0, 0, 8, 10, 1], "semantic": {"name": "J", "arg_names": [], "import_names": [], "rhs_call_name": "jacobian", "annotation": ""}, "snippet": " J = self.kinematics.jacobian(q_pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L48_C8", "label": "F, res, rank, sing = lstsq()", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "vector": [14, 2, 0.5217, 0.0109, 2, 0.7, 0.3846, 911, 3, 2, 0, 0, 318, 10, 1], "semantic": {"name": "F, res, rank, sing", "arg_names": [], "import_names": [], "rhs_call_name": "lstsq", "annotation": ""}, "snippet": " F, res, rank, sing = np.linalg.lstsq(J.T, q_effort)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Expr_L51_C8", "label": "publish_vector()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "vector": [8, 2, 0.5543, 0.0109, 2, 0.7, 0.4615, 415, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "publish_vector", "arg_names": [], "import_names": [], "rhs_call_name": "publish_vector", "annotation": ""}, "snippet": " self.publish_vector(fk_pos, 0.01 * F[0:3], 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Expr_L52_C8", "label": "publish_vector()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "vector": [8, 2, 0.5652, 0.0109, 2, 0.7, 0.5385, 415, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "publish_vector", "arg_names": [], "import_names": [], "rhs_call_name": "publish_vector", "annotation": ""}, "snippet": " self.publish_vector(fk_pos, 0.04 * F[3:6], 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L53_C8", "label": "H = inertia()", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "vector": [14, 2, 0.5761, 0.0109, 2, 0.7, 0.6154, 890, 3, 1, 0, 0, 298, 10, 1], "semantic": {"name": "H", "arg_names": [], "import_names": [], "rhs_call_name": "inertia", "annotation": ""}, "snippet": " H = self.kinematics.inertia(q_pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L54_C8", "label": "CI = cart_inertia()", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "vector": [14, 2, 0.587, 0.0109, 2, 0.7, 0.6923, 541, 3, 1, 0, 0, 11, 10, 1], "semantic": {"name": "CI", "arg_names": [], "import_names": [], "rhs_call_name": "cart_inertia", "annotation": ""}, "snippet": " CI = self.kinematics.cart_inertia(q_pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L58_C8", "label": "x_vel =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "vector": [14, 2, 0.6304, 0.0109, 2, 0.7, 0.7692, 154, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_vel = J * q_vel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Expr_L62_C8", "label": "print()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "vector": [8, 2, 0.6739, 0.0109, 2, 0.7, 0.8462, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(np.linalg.norm((CI * x_vel)[:3], 2))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L64_C8", "label": "self.last_CI =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "vector": [14, 2, 0.6957, 0.0109, 2, 0.7, 0.9231, 381, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.last_CI", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.last_CI = CI"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L65_C8", "label": "self.last_q_pos =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "vector": [14, 2, 0.7065, 0.0109, 2, 0.7, 1.0, 930, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.last_q_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.last_q_pos = q_pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "label": "publish_vector", "type": "function", "loc": [68, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:ClassDef_L22_C0", "vector": [2, 1, 0.8043, 0.1413, 1, 0.45, 1.0, 415, 0, 4, 0, 0, 0, 0, 8], "semantic": {"name": "publish_vector", "arg_names": ["self", "loc", "v", "m_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def publish_vector(self, loc, v, m_id):\n m = Marker()\n m.header.frame_id = \"torso_lift_link\"\n m.header.stamp = rospy.Time()\n m.ns = \"force_torque\"\n m.id = m_id\n m.type = Marker.ARROW\n m.action = Marker.ADD"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L69_C8", "label": "m = Marker()", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "vector": [14, 2, 0.75, 0.0109, 2, 0.68, 0.0, 711, 3, 0, 0, 0, 923, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "Marker", "annotation": ""}, "snippet": " m = Marker()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L70_C8", "label": "m.header.frame_id =", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "vector": [14, 2, 0.7609, 0.0109, 2, 0.68, 0.0909, 636, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "m.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.header.frame_id = \"torso_lift_link\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L71_C8", "label": "m.header.stamp = Time()", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "vector": [14, 2, 0.7717, 0.0109, 2, 0.68, 0.1818, 726, 3, 0, 0, 0, 451, 10, 1], "semantic": {"name": "m.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " m.header.stamp = rospy.Time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L72_C8", "label": "m.ns =", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "vector": [14, 2, 0.7826, 0.0109, 2, 0.68, 0.2727, 889, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "m.ns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.ns = \"force_torque\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L73_C8", "label": "m.id =", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "vector": [14, 2, 0.7935, 0.0109, 2, 0.68, 0.3636, 46, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.id = m_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L74_C8", "label": "m.type =", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "vector": [14, 2, 0.8043, 0.0109, 2, 0.68, 0.4545, 148, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.type = Marker.ARROW"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L75_C8", "label": "m.action =", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "vector": [14, 2, 0.8152, 0.0109, 2, 0.68, 0.5455, 654, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.action = Marker.ADD"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Expr_L76_C8", "label": "append()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "vector": [8, 2, 0.8261, 0.0109, 2, 0.68, 0.6364, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " m.points.append(Point(*loc))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Expr_L77_C8", "label": "append()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "vector": [8, 2, 0.837, 0.0109, 2, 0.68, 0.7273, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " m.points.append(Point(*(loc + v)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L78_C8", "label": "m.scale = Vector3()", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "vector": [14, 2, 0.8478, 0.0109, 2, 0.68, 0.8182, 508, 3, 3, 0, 0, 759, 10, 1], "semantic": {"name": "m.scale", "arg_names": [], "import_names": [], "rhs_call_name": "Vector3", "annotation": ""}, "snippet": " m.scale = Vector3(0.01, 0.02, 0.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L79_C8", "label": "m.color =", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "vector": [14, 2, 0.8587, 0.0109, 2, 0.68, 0.9091, 882, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.color", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.color = self.colors[m_id]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Expr_L80_C8", "label": "publish()", "type": "expression", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "vector": [8, 2, 0.8696, 0.0109, 2, 0.68, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.vis_pub.publish(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L83_C0", "label": "main", "type": "function", "loc": [83, 89], "level": 0, "parent": null, "vector": [2, 0, 0.9348, 0.0761, 0, 0.66, 0.9412, 624, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n assert sys.argv[1] in ['r', 'l']\n rospy.init_node(\"test_markers\")\n\n jfv = JointForceViz(sys.argv[1])\n rospy.spin()\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Expr_L85_C4", "label": "init_node()", "type": "expression", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L83_C0", "vector": [8, 1, 0.9239, 0.0109, 1, 0.61, 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(\"test_markers\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L87_C4", "label": "jfv = JointForceViz()", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L83_C0", "vector": [14, 1, 0.9457, 0.0109, 1, 0.61, 0.3333, 177, 3, 1, 0, 0, 125, 10, 1], "semantic": {"name": "jfv", "arg_names": [], "import_names": [], "rhs_call_name": "JointForceViz", "annotation": ""}, "snippet": " jfv = JointForceViz(sys.argv[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Expr_L88_C4", "label": "spin()", "type": "expression", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L83_C0", "vector": [8, 1, 0.9565, 0.0109, 1, 0.61, 0.6667, 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_99292:Return_L89_C4", "label": "return", "type": "return", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L83_C0", "vector": [13, 1, 0.9674, 0.0109, 1, 0.61, 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_99292:If_L91_C0", "label": "if", "type": "if", "loc": [91, 92], "level": 0, "parent": null, "vector": [4, 0, 0.9946, 0.0217, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99292:Expr_L92_C4", "label": "main()", "type": "expression", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99292:If_L91_C0", "vector": [8, 1, 1.0, 0.0109, 1, 0.3, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99292:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:If_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:If_L26_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L27_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:If_L26_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L29_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Expr_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Expr_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Expr_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:FunctionDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Return_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99292:If_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99292:Expr_L92_C4"}]
#! /usr/bin/python import sys import numpy as np import roslib roslib.load_manifest("hrl_pr2_arms") roslib.load_manifest("kelsey_sandbox") import rospy from visualization_msgs.msg import Marker from geometry_msgs.msg import Point, Quaternion, Vector3 from std_msgs.msg import ColorRGBA from sensor_msgs.msg import JointState import urdf_interface as urdf import kdl_parser as kdlp from hrl_pr2_arms.kdl_arm_kinematics import KDLArmKinematics JOINT_STATE_INDS_R = [17, 18, 16, 20, 19, 21, 22] JOINT_STATE_INDS_L = [29, 30, 28, 32, 31, 33, 34] class JointForceViz: def __init__(self, arm): self.arm = arm self.vis_pub = rospy.Publisher("force_torque_markers", Marker) if arm == 'r': self.arm_inds = JOINT_STATE_INDS_R else: self.arm_inds = JOINT_STATE_INDS_L model = urdf.create_model_from_file("/etc/ros/diamondback/urdf/robot.xml") tree = kdlp.tree_from_urdf_model(model) chain = tree.getChain("torso_lift_link", "r_gripper_tool_frame") link_dict = {0:0, 1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:11} self.kinematics = KDLArmKinematics(chain=chain, link_dict=link_dict) self.colors = [ColorRGBA(1., 0., 0., 1.), ColorRGBA(0., 1., 0., 1.)] rospy.Subscriber("joint_states", JointState, self.joint_states_cb) def joint_states_cb(self, msg): q_pos = np.mat([msg.position[i] for i in self.arm_inds]).T q_vel = np.mat([msg.velocity[i] for i in self.arm_inds]).T q_effort = np.mat([msg.effort[i] for i in self.arm_inds]).T fk_pos, fk_rot = self.kinematics.FK(q_pos) J = self.kinematics.jacobian(q_pos) F, res, rank, sing = np.linalg.lstsq(J.T, q_effort) #print "Force:", F[0:3] #print "Torque:", F[3:6] self.publish_vector(fk_pos, 0.01 * F[0:3], 0) self.publish_vector(fk_pos, 0.04 * F[3:6], 1) def publish_vector(self, loc, v, m_id): m = Marker() m.header.frame_id = "torso_lift_link" m.header.stamp = rospy.Time() m.ns = "force_torque" m.id = m_id m.type = Marker.ARROW m.action = Marker.ADD m.points.append(Point(*loc)) m.points.append(Point(*(loc + v))) m.scale = Vector3(0.01, 0.02, 0.01) m.color = self.colors[m_id] self.vis_pub.publish(m) def main(): assert sys.argv[1] in ['r', 'l'] rospy.init_node("test_markers") jfv = JointForceViz(sys.argv[1]) rospy.spin() return if __name__ == "__main__": main()
ajibawa-2023/Python-Code-Large/train/row_99293
58
74
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0405, 0.0135, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Import_L4_C0", "label": "numpy import np", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0541, 0.0135, 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_99293:Import_L6_C0", "label": "roslib import roslib", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0811, 0.0135, 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"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0946, 0.0135, 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": "roslib.load_manifest(\"hrl_pr2_arms\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.1081, 0.0135, 0, 0.66, 0.2353, 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(\"kelsey_sandbox\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Import_L9_C0", "label": "rospy import rospy", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1216, 0.0135, 0, 0.66, 0.2941, 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_99293:ImportFrom_L10_C0", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1351, 0.0135, 0, 0.66, 0.3529, 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_99293:ImportFrom_L11_C0", "label": "from geometry_msgs.msg import Point, Quaternion, Vector3", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1486, 0.0135, 0, 0.66, 0.4118, 951, 0, 3, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Point", "Quaternion", "Vector3"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Point, Quaternion, Vector3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:ImportFrom_L12_C0", "label": "from std_msgs.msg import ColorRGBA", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1622, 0.0135, 0, 0.66, 0.4706, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["ColorRGBA"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import ColorRGBA"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:ImportFrom_L13_C0", "label": "from sensor_msgs.msg import JointState", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.1757, 0.0135, 0, 0.66, 0.5294, 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_99293:Import_L15_C0", "label": "urdf_interface import urdf", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.2027, 0.0135, 0, 0.66, 0.5882, 414, 0, 1, 0, 0, 414, 0, 0], "semantic": {"name": "urdf_interface", "arg_names": [], "import_names": ["urdf"], "rhs_call_name": "", "annotation": ""}, "snippet": "import urdf_interface as urdf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Import_L16_C0", "label": "kdl_parser import kdlp", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.2162, 0.0135, 0, 0.66, 0.6471, 470, 0, 1, 0, 0, 470, 0, 0], "semantic": {"name": "kdl_parser", "arg_names": [], "import_names": ["kdlp"], "rhs_call_name": "", "annotation": ""}, "snippet": "import kdl_parser as kdlp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:ImportFrom_L17_C0", "label": "from hrl_pr2_arms.kdl_arm_kinematics import KDLArmKinematics", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.2297, 0.0135, 0, 0.66, 0.7059, 277, 0, 1, 0, 0, 277, 0, 0], "semantic": {"name": "hrl_pr2_arms.kdl_arm_kinematics", "arg_names": [], "import_names": ["KDLArmKinematics"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_pr2_arms.kdl_arm_kinematics import KDLArmKinematics"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L19_C0", "label": "JOINT_STATE_INDS_R =", "type": "assigned_variable", "loc": [19, 19], "level": 0, "parent": null, "vector": [14, 0, 0.2568, 0.0135, 0, 0.66, 0.7647, 720, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "JOINT_STATE_INDS_R", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "JOINT_STATE_INDS_R = [17, 18, 16, 20, 19, 21, 22]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L20_C0", "label": "JOINT_STATE_INDS_L =", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.2703, 0.0135, 0, 0.66, 0.8235, 742, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "JOINT_STATE_INDS_L", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "JOINT_STATE_INDS_L = [29, 30, 28, 32, 31, 33, 34]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:ClassDef_L22_C0", "label": "JointForceViz", "type": "class", "loc": [22, 62], "level": 0, "parent": null, "vector": [3, 0, 0.5676, 0.5541, 0, 0.66, 0.8824, 125, 0, 3, 0, 0, 0, 0, 24], "semantic": {"name": "JointForceViz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class JointForceViz:\n def __init__(self, arm):\n self.arm = arm\n self.vis_pub = rospy.Publisher(\"force_torque_markers\", Marker)\n if arm == 'r':\n self.arm_inds = JOINT_STATE_INDS_R\n else:\n self.arm_inds = JOINT_STATE_INDS_L"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L23_C4", "label": "__init__", "type": "function", "loc": [23, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:ClassDef_L22_C0", "vector": [2, 1, 0.3986, 0.1892, 1, 0.19, 0.0, 555, 0, 2, 0, 0, 0, 0, 8], "semantic": {"name": "__init__", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arm):\n self.arm = arm\n self.vis_pub = rospy.Publisher(\"force_torque_markers\", Marker)\n if arm == 'r':\n self.arm_inds = JOINT_STATE_INDS_R\n else:\n self.arm_inds = JOINT_STATE_INDS_L\n model = urdf.create_model_from_file(\"/etc/ros/diamondback/urdf/robot.xml\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L24_C8", "label": "self.arm =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L23_C4", "vector": [14, 2, 0.3243, 0.0135, 2, 0.74, 0.0, 720, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm = arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L25_C8", "label": "self.vis_pub = Publisher()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L23_C4", "vector": [14, 2, 0.3378, 0.0135, 2, 0.74, 0.1111, 911, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.vis_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.vis_pub = rospy.Publisher(\"force_torque_markers\", Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:If_L26_C8", "label": "if", "type": "if", "loc": [26, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L23_C4", "vector": [4, 2, 0.3716, 0.0541, 2, 0.74, 0.2222, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'r':\n self.arm_inds = JOINT_STATE_INDS_R\n else:\n self.arm_inds = JOINT_STATE_INDS_L"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L27_C12", "label": "self.arm_inds =", "type": "assigned_variable", "loc": [27, 27], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:If_L26_C8", "vector": [14, 3, 0.3649, 0.0135, 3, 0.23, 0.0, 523, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arm_inds", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_inds = JOINT_STATE_INDS_R"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L29_C12", "label": "self.arm_inds =", "type": "assigned_variable", "loc": [29, 29], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:If_L26_C8", "vector": [14, 3, 0.3919, 0.0135, 3, 0.23, 1.0, 523, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arm_inds", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_inds = JOINT_STATE_INDS_L"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L30_C8", "label": "model = create_model_from_file()", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L23_C4", "vector": [14, 2, 0.4054, 0.0135, 2, 0.74, 0.3333, 722, 3, 1, 0, 0, 489, 10, 1], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "create_model_from_file", "annotation": ""}, "snippet": " model = urdf.create_model_from_file(\"/etc/ros/diamondback/urdf/robot.xml\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L31_C8", "label": "tree = tree_from_urdf_model()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L23_C4", "vector": [14, 2, 0.4189, 0.0135, 2, 0.74, 0.4444, 613, 3, 1, 0, 0, 336, 10, 1], "semantic": {"name": "tree", "arg_names": [], "import_names": [], "rhs_call_name": "tree_from_urdf_model", "annotation": ""}, "snippet": " tree = kdlp.tree_from_urdf_model(model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L32_C8", "label": "chain = getChain()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L23_C4", "vector": [14, 2, 0.4324, 0.0135, 2, 0.74, 0.5556, 271, 3, 2, 0, 0, 420, 10, 1], "semantic": {"name": "chain", "arg_names": [], "import_names": [], "rhs_call_name": "getChain", "annotation": ""}, "snippet": " chain = tree.getChain(\"torso_lift_link\", \"r_gripper_tool_frame\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L33_C8", "label": "link_dict =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L23_C4", "vector": [14, 2, 0.4459, 0.0135, 2, 0.74, 0.6667, 602, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "link_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " link_dict = {0:0, 1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:11}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L34_C8", "label": "self.kinematics = KDLArmKinematics()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L23_C4", "vector": [14, 2, 0.4595, 0.0135, 2, 0.74, 0.7778, 239, 3, 2, 0, 0, 594, 10, 1], "semantic": {"name": "self.kinematics", "arg_names": [], "import_names": [], "rhs_call_name": "KDLArmKinematics", "annotation": ""}, "snippet": " self.kinematics = KDLArmKinematics(chain=chain, link_dict=link_dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L35_C8", "label": "self.colors =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L23_C4", "vector": [14, 2, 0.473, 0.0135, 2, 0.74, 0.8889, 375, 0, 0, 0, 0, 0, 5, 2], "semantic": {"name": "self.colors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.colors = [ColorRGBA(1., 0., 0., 1.), ColorRGBA(0., 1., 0., 1.)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Expr_L36_C8", "label": "Subscriber()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L23_C4", "vector": [8, 2, 0.4865, 0.0135, 2, 0.74, 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(\"joint_states\", JointState, self.joint_states_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L38_C4", "label": "joint_states_cb", "type": "function", "loc": [38, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:ClassDef_L22_C0", "vector": [2, 1, 0.5811, 0.1486, 1, 0.19, 0.5, 800, 0, 2, 0, 0, 0, 0, 8], "semantic": {"name": "joint_states_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def joint_states_cb(self, msg):\n q_pos = np.mat([msg.position[i] for i in self.arm_inds]).T\n q_vel = np.mat([msg.velocity[i] for i in self.arm_inds]).T\n q_effort = np.mat([msg.effort[i] for i in self.arm_inds]).T\n fk_pos, fk_rot = self.kinematics.FK(q_pos)\n J = self.kinematics.jacobian(q_pos)\n F, res, rank, sing = np.linalg.lstsq(J.T, q_effort)\n #print \"Force:\", F[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L39_C8", "label": "q_pos =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L38_C4", "vector": [14, 2, 0.527, 0.0135, 2, 0.75, 0.0, 803, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "q_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pos = np.mat([msg.position[i] for i in self.arm_inds]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L40_C8", "label": "q_vel =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L38_C4", "vector": [14, 2, 0.5405, 0.0135, 2, 0.75, 0.1429, 212, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "q_vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_vel = np.mat([msg.velocity[i] for i in self.arm_inds]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L41_C8", "label": "q_effort =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L38_C4", "vector": [14, 2, 0.5541, 0.0135, 2, 0.75, 0.2857, 594, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "q_effort", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_effort = np.mat([msg.effort[i] for i in self.arm_inds]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L42_C8", "label": "fk_pos, fk_rot = FK()", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L38_C4", "vector": [14, 2, 0.5676, 0.0135, 2, 0.75, 0.4286, 28, 3, 1, 0, 0, 252, 10, 1], "semantic": {"name": "fk_pos, fk_rot", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " fk_pos, fk_rot = self.kinematics.FK(q_pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L43_C8", "label": "J = jacobian()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L38_C4", "vector": [14, 2, 0.5811, 0.0135, 2, 0.75, 0.5714, 946, 3, 1, 0, 0, 8, 10, 1], "semantic": {"name": "J", "arg_names": [], "import_names": [], "rhs_call_name": "jacobian", "annotation": ""}, "snippet": " J = self.kinematics.jacobian(q_pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L44_C8", "label": "F, res, rank, sing = lstsq()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L38_C4", "vector": [14, 2, 0.5946, 0.0135, 2, 0.75, 0.7143, 911, 3, 2, 0, 0, 318, 10, 1], "semantic": {"name": "F, res, rank, sing", "arg_names": [], "import_names": [], "rhs_call_name": "lstsq", "annotation": ""}, "snippet": " F, res, rank, sing = np.linalg.lstsq(J.T, q_effort)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Expr_L47_C8", "label": "publish_vector()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L38_C4", "vector": [8, 2, 0.6351, 0.0135, 2, 0.75, 0.8571, 415, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "publish_vector", "arg_names": [], "import_names": [], "rhs_call_name": "publish_vector", "annotation": ""}, "snippet": " self.publish_vector(fk_pos, 0.01 * F[0:3], 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Expr_L48_C8", "label": "publish_vector()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L38_C4", "vector": [8, 2, 0.6486, 0.0135, 2, 0.75, 1.0, 415, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "publish_vector", "arg_names": [], "import_names": [], "rhs_call_name": "publish_vector", "annotation": ""}, "snippet": " self.publish_vector(fk_pos, 0.04 * F[3:6], 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "label": "publish_vector", "type": "function", "loc": [50, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:ClassDef_L22_C0", "vector": [2, 1, 0.7568, 0.1757, 1, 0.19, 1.0, 415, 0, 4, 0, 0, 0, 0, 8], "semantic": {"name": "publish_vector", "arg_names": ["self", "loc", "v", "m_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def publish_vector(self, loc, v, m_id):\n m = Marker()\n m.header.frame_id = \"torso_lift_link\"\n m.header.stamp = rospy.Time()\n m.ns = \"force_torque\"\n m.id = m_id\n m.type = Marker.ARROW\n m.action = Marker.ADD"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L51_C8", "label": "m = Marker()", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "vector": [14, 2, 0.6892, 0.0135, 2, 0.62, 0.0, 711, 3, 0, 0, 0, 923, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "Marker", "annotation": ""}, "snippet": " m = Marker()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L52_C8", "label": "m.header.frame_id =", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "vector": [14, 2, 0.7027, 0.0135, 2, 0.62, 0.0909, 636, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "m.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.header.frame_id = \"torso_lift_link\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L53_C8", "label": "m.header.stamp = Time()", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "vector": [14, 2, 0.7162, 0.0135, 2, 0.62, 0.1818, 726, 3, 0, 0, 0, 451, 10, 1], "semantic": {"name": "m.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " m.header.stamp = rospy.Time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L54_C8", "label": "m.ns =", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "vector": [14, 2, 0.7297, 0.0135, 2, 0.62, 0.2727, 889, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "m.ns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.ns = \"force_torque\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L55_C8", "label": "m.id =", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "vector": [14, 2, 0.7432, 0.0135, 2, 0.62, 0.3636, 46, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.id = m_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L56_C8", "label": "m.type =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "vector": [14, 2, 0.7568, 0.0135, 2, 0.62, 0.4545, 148, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.type = Marker.ARROW"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L57_C8", "label": "m.action =", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "vector": [14, 2, 0.7703, 0.0135, 2, 0.62, 0.5455, 654, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.action = Marker.ADD"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Expr_L58_C8", "label": "append()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "vector": [8, 2, 0.7838, 0.0135, 2, 0.62, 0.6364, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " m.points.append(Point(*loc))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Expr_L59_C8", "label": "append()", "type": "expression", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "vector": [8, 2, 0.7973, 0.0135, 2, 0.62, 0.7273, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " m.points.append(Point(*(loc + v)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L60_C8", "label": "m.scale = Vector3()", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "vector": [14, 2, 0.8108, 0.0135, 2, 0.62, 0.8182, 508, 3, 3, 0, 0, 759, 10, 1], "semantic": {"name": "m.scale", "arg_names": [], "import_names": [], "rhs_call_name": "Vector3", "annotation": ""}, "snippet": " m.scale = Vector3(0.01, 0.02, 0.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L61_C8", "label": "m.color =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "vector": [14, 2, 0.8243, 0.0135, 2, 0.62, 0.9091, 882, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.color", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.color = self.colors[m_id]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Expr_L62_C8", "label": "publish()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "vector": [8, 2, 0.8378, 0.0135, 2, 0.62, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.vis_pub.publish(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L65_C0", "label": "main", "type": "function", "loc": [65, 71], "level": 0, "parent": null, "vector": [2, 0, 0.9189, 0.0946, 0, 0.66, 0.9412, 624, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n assert sys.argv[1] in ['r', 'l']\n rospy.init_node(\"test_markers\")\n\n jfv = JointForceViz(sys.argv[1])\n rospy.spin()\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Expr_L67_C4", "label": "init_node()", "type": "expression", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L65_C0", "vector": [8, 1, 0.9054, 0.0135, 1, 0.57, 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(\"test_markers\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L69_C4", "label": "jfv = JointForceViz()", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L65_C0", "vector": [14, 1, 0.9324, 0.0135, 1, 0.57, 0.3333, 177, 3, 1, 0, 0, 125, 10, 1], "semantic": {"name": "jfv", "arg_names": [], "import_names": [], "rhs_call_name": "JointForceViz", "annotation": ""}, "snippet": " jfv = JointForceViz(sys.argv[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Expr_L70_C4", "label": "spin()", "type": "expression", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L65_C0", "vector": [8, 1, 0.9459, 0.0135, 1, 0.57, 0.6667, 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_99293:Return_L71_C4", "label": "return", "type": "return", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L65_C0", "vector": [13, 1, 0.9595, 0.0135, 1, 0.57, 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_99293:If_L73_C0", "label": "if", "type": "if", "loc": [73, 74], "level": 0, "parent": null, "vector": [4, 0, 0.9932, 0.027, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99293:Expr_L74_C4", "label": "main()", "type": "expression", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99293:If_L73_C0", "vector": [8, 1, 1.0, 0.0135, 1, 0.34, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99293:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:If_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:If_L26_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L27_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:If_L26_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L29_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Expr_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Expr_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Expr_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Return_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99293:If_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99293:Expr_L74_C4"}]
#! /usr/bin/python import numpy as np, math import sys import os from threading import RLock import threading import roslib; roslib.load_manifest('hrl_pr2_lib') import rospy import actionlib from std_msgs.msg import String from geometry_msgs.msg import Point, Pose, Quaternion, PoseStamped, PointStamped import random import hrl_lib.util from hrl_lib.rutils import GenericListener import hrl_lib.viz as viz from hrl_lib import tf_utils from hrl_lib.keyboard_input import KeyboardInput from hrl_lib.transforms import rotX, rotY, rotZ from hrl_lib.data_process import signal_list_variance from tf.transformations import * from hrl_pr2_lib.pr2_arms import PR2Arms from hrl_pr2_lib.perception_monitor import ArmPerceptionMonitor, generate_mean_grasp from visualization_msgs.msg import MarkerArray, Marker import dynamic_reconfigure.client import tf # from pr2_gripper_reactive_approach.controller_manager import ControllerManager from hrl_pr2_lib.hrl_controller_manager import HRLControllerManager as ControllerManager from pr2_controllers_msgs.msg import JointTrajectoryGoal, PointHeadAction, PointHeadGoal import object_manipulator.convert_functions as cf from object_manipulator.cluster_bounding_box_finder import ClusterBoundingBoxFinder from tabletop_object_detector.srv import TabletopDetection from tabletop_object_detector.msg import TabletopDetectionResult from laser_interface.pkg import CURSOR_TOPIC, MOUSE_DOUBLE_CLICK_TOPIC #SETUP_POS = (0.62, 0.0, 0.035) #SETUP_POS_ANGS = [-0.6260155429349421, -0.53466276262236689, -1.9803303473514324, -1.1593322538276705, -0.89803655400181404, -1.4467120153069799, -2.728422563953746] #MAX_JERK = 0.2 NUM_X = 7#3#9#7 #4#7 NUM_Y = 11#3#15#9 #4#20 NUM_N = 3 #4 NUM_ROT = 6 # near to far, left to right RECT = ((0.45, 0.25), (0.70, -0.25))#((0.4, 0.35), (0.8, -0.35))#((0.45, 0.10), (0.65, -0.10))#((0.4, 0.20), (0.7, -0.20))#((0.4, 0.35), (0.8, -0.35)) #((0.55, 0.10), (0.7, -0.10)) #((0.4, -0.77), (0.75, 0.23)) ARM = 0 # right arm if ARM == 0: armc = 'r' else: armc = 'l' HOVER_Z = -0.10 GRASP_DIST = 0.30 GRASP_VELOCITY = 0.28 # 0.15 GRIPPER_POINT = np.array([0.23, 0.0, 0.0]) JOINTS_BIAS = [0., -.25, -1., 0., 0., 0.5, 0.] BIAS_RADIUS = 0.012 GRASP_TIME = 2.0 SETUP_VELOCITY = 0.4 # 0.15 STD_DEV = 2.3 #3.5 #1.9 NOISE_DEV = 0.0 DETECT_ERROR = -0.02 STD_DEV_DICT = { "accelerometer" : np.array([2.4, 2.9, 2.9]), "joint_angles" : np.array([2.8, 2.8, 3.8, 2.8, 400.0, 1.25, 400.0]), "joint_efforts" : np.array([30.0, 15.0, 11.0, 16.0, 12.0, 3.0, 125.0]), "joint_velocities" : np.array([3.4, 6.4, 18.4, 3.4, 3.4, 3.4, 3.4]), "r_finger_periph_pressure" : np.array([60.0]*6), "r_finger_pad_pressure" : np.array([60.0]*15), "l_finger_periph_pressure" : np.array([60.0]*6), "l_finger_pad_pressure" : np.array([60.0]*15) } TOL_THRESH_DICT = { "accelerometer" : np.array([0.3, 0.3, 0.3]), "joint_velocities" : np.array([0.45]*7), "joint_angles" : np.array([0.05, 0.05, 0.05, 0.05, 0.05, 0.04, 0.05]), "joint_efforts" : np.array([3.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]), "r_finger_periph_pressure" : np.array([10.0]*6), "r_finger_pad_pressure" : np.array([10.0]*15), "l_finger_periph_pressure" : np.array([10.0]*6), "l_finger_pad_pressure" : np.array([10.0]*15) } PERCEPT_MON_LIST = None #["accelerometer"] PERCEPT_GRASP_LIST = None PRESSURE_LIST =["r_finger_periph_pressure", "r_finger_pad_pressure", "l_finger_periph_pressure", "l_finger_pad_pressure"] # "joint_efforts" ] #["joint_angles"]#["joint_velocities"] #["r_finger_periph_pressure"] #["joint_efforts"] #["joint_angles"] ##STD_DEV_DICT = None MONITOR_WINDOW = 50 PICKLES_LOC = "//src//hrl_pr2_lib//pickles//" GRASP_CONFIGS_FILE = "grasp_configs.pickle" GRASP_DATA_FILE = "grasp_data.pickle" GRASP_MODELS_FILE = "grasp_models.pickle" GRASP_MODELS_TRIMMED_FILE = "grasp_models_trimmed.pickle" ZEROS_FILE = "current_zeros.pickle" SQR_DIFF_MAP = "sqr_diff_map.pickle" GRASP_IND_PREFIX = "model_indexed//grasp_model" GRASP_INDEX_FILE = "model_indexed//grasp_model_index.pickle" GRASP_DATA_INDEX_FILE = "data_indexed//grasp_data_index.pickle" GRASP_DATA_PREFIX = "data_indexed//grasp_data" TEST_DATA_FILE = "test_data.pickle" node_name = "simple_grasp_learner" def log(str): rospy.loginfo(node_name + ": " + str) def load_pickle(fn): global PACKAGE_LOC return hrl_lib.util.load_pickle(PACKAGE_LOC + PICKLES_LOC + fn) def save_pickle(p, fn): global PACKAGE_LOC hrl_lib.util.save_pickle(p, PACKAGE_LOC + PICKLES_LOC + fn) def file_exists(fn): global PACKAGE_LOC return os.path.exists(PACKAGE_LOC + PICKLES_LOC + fn) def setup_package_loc(): global PACKAGE_LOC import os grep = os.popen("rospack find hrl_pr2_lib|grep hrl_pr2_lib") PACKAGE_LOC = grep.readlines()[0].rstrip() def save_parameters(param_filename): params = { "ARM" : ARM, "NUM_X" : NUM_X, "NUM_Y" : NUM_Y, "NUM_N" : NUM_N, "NUM_ROT" : NUM_ROT, "RECT" : RECT, "HOVER_Z" : HOVER_Z, "GRASP_DIST" : GRASP_DIST, "GRASP_TIME" : GRASP_TIME, "GRASP_VELOCITY" : GRASP_VELOCITY, "SETUP_VELOCITY" : SETUP_VELOCITY, "STD_DEV" : STD_DEV, "NOISE_DEV" : NOISE_DEV, "GRIPPER_POINT" : GRIPPER_POINT, "JOINTS_BIAS" : JOINTS_BIAS, "BIAS_RADIUS" : BIAS_RADIUS, "DETECT_ERROR" : DETECT_ERROR, "STD_DEV_DICT" : STD_DEV_DICT, "PICKLES_LOC" : PICKLES_LOC, "GRASP_CONFIGS_FILE" : GRASP_CONFIGS_FILE, "GRASP_DATA_FILE" : GRASP_DATA_FILE, "GRASP_MODELS_FILE" : GRASP_MODELS_FILE, "ZEROS_FILE" : ZEROS_FILE, "SQR_DIFF_MAP" : SQR_DIFF_MAP, "GRASP_IND_PREFIX" : GRASP_IND_PREFIX, "GRASP_INDEX_FILE" : GRASP_INDEX_FILE, "TEST_DATA_FILE" : TEST_DATA_FILE, "MONITOR_WINDOW" : MONITOR_WINDOW, "PERCEPT_MON_LIST" : PERCEPT_MON_LIST } save_pickle(params, param_filename) def load_parameters(): params = load_pickle(param_filename) for k in params: globals()[k] = params[k] ## # Transforms the given position by the offset position in the given quaternion # rotation frame # # @param pos the current positions # @param quat quaternion representing the rotation of the frame # @param off_point offset to move the position inside the quat's frame # @return the new position as a matrix column def transform_in_frame(pos, quat, off_point): invquatmat = np.mat(quaternion_matrix(quat)) invquatmat[0:3,3] = np.mat(pos).T trans = np.matrix([off_point[0],off_point[1],off_point[2],1.]).T transpos = invquatmat * trans return transpos.T.A[0,0:3] # def get_setup_pos_angs(): # arms = PR2Arms() # arms.move_arm(ARM, SETUP_POS, rotY(np.pi / 2.), 4.) # arms.wait_for_arm_completion(ARM) # print arms.get_joint_angles(ARM) def get_xyr_list(): grasp_xyr_list = [] for x in np.linspace(RECT[0][0], RECT[1][0], NUM_X): for y in np.linspace(RECT[0][1], RECT[1][1], NUM_Y): for r in np.linspace(0., np.pi, NUM_ROT+1)[0:-1]: grasp_xyr_list += [(x,y,r)] return grasp_xyr_list def create_gripper_pose(x, y, z, quat): point = [x, y, z] point = transform_in_frame(point, np.array(quat), -GRIPPER_POINT).tolist() pose = point + quat goal_pose = cf.create_pose_stamped(pose, "torso_lift_link") goal_pose.header.stamp = rospy.Time.now() return goal_pose def get_gripper_pose(gripper_rot): gripper_rot = normalize_rot(gripper_rot) quat1 = quaternion_about_axis(np.pi/2., (0, 1, 0)) quat2 = quaternion_about_axis(gripper_rot, (0, 0, 1)) quat = quaternion_multiply(quat2, quat1) return quat def create_goal_pose(x, y, z, gripper_pose): point = [x, y, z] point = transform_in_frame(point, gripper_pose, -GRIPPER_POINT).tolist() pose = point + gripper_pose.tolist() goal_pose = cf.create_pose_stamped(pose, "torso_lift_link") goal_pose.header.stamp = rospy.Time.now() return goal_pose def move_to_grasp_pos(cm, grasp_pose, block=True): grasp_pose.header.stamp = rospy.Time.now() cm.move_cartesian_ik(grasp_pose, collision_aware = False, blocking = block, step_size = .005, pos_thres = .02, rot_thres = .1, settling_time = rospy.Duration(1.0), vel = SETUP_VELOCITY) def upward_lift(cm, grasp_pose, block=True): grasp_pose.header.stamp = rospy.Time.now() cm.move_cartesian_ik(grasp_pose, collision_aware = False, blocking = block, step_size = .005, pos_thres = .02, rot_thres = .1, settling_time = rospy.Duration(1.0), vel = GRASP_VELOCITY, joints_bias = -np.array(JOINTS_BIAS), bias_radius = BIAS_RADIUS) def downward_grasp(cm, goal_pose, block=True): goal_pose.header.stamp = rospy.Time.now() return cm.move_cartesian_ik(goal_pose, collision_aware = False, blocking = block, step_size = .005, pos_thres = .02, rot_thres = .1, settling_time = rospy.Duration(GRASP_TIME), joints_bias = JOINTS_BIAS, bias_radius = BIAS_RADIUS, vel = GRASP_VELOCITY) def save_grasp_configurations(): arms = PR2Arms() grasp_xyr_list = get_xy_list() grasp_configs = [] setup = False for xy in grasp_xyr_list: # if not setup: # # Move to setup position in the middle of the grasp space # print "Setting up" # arms.set_joint_angles(ARM, SETUP_POS_ANGS, 3.) # arms.wait_for_arm_completion(ARM) # rospy.sleep(0.5) # setup = True if arms.can_move_arm(ARM, [xy[0], xy[1], HOVER_Z], rotY(np.pi / 2.)): print "Moving to pos (%1.2f, %1.2f)" % xy arms.grasp_biased_move_arm(ARM, [xy[0], xy[1], HOVER_Z], rotY(np.pi / 2.), 3.) arms.wait_for_arm_completion(ARM) rospy.sleep(0.5) angs = arms.get_joint_angles(ARM) grasp_configs += [(xy, angs)] setup = False else: print "Can't move to to pos (%1.2f, %1.2f)" % xy # grasp_configs += [(xy, None)] save_pickle(grasp_configs, GRASP_CONFIGS_FILE) print "Configurations:" print_configs(grasp_configs) def print_configs(grasp_configs): for config in grasp_configs: if config[1] is not None: print "(%1.2f, %1.2f):" % config[0], ", ".join(["%1.2f" % x for x in config[1]]) else: print "(%1.2f, %1.2f):" % config[0], "No config" def trim_bad_grasps(filename): grasp_configs = load_pickle(filename) print_configs(grasp_configs) new_configs = [] for config in grasp_configs: if config[1] is not None: new_configs += [config] print_configs(new_configs) save_pickle(new_configs, filename) def pauser(ki): if ki.kbhit(): ch = ki.getch() if ch == 'p': print "PAUSED" while not rospy.is_shutdown() and ch != 'c': ch = ki.getch() rospy.sleep(0.1) print "CONTINUING" def write_index_file(prefix = GRASP_DATA_PREFIX, index = GRASP_DATA_INDEX_FILE): grasp_xyr_list = get_xyr_list() grasps = [] for xyr in grasp_xyr_list: filename = prefix + "%04d-%04d-%04d.pickle" % (int(xyr[0]*100),int(xyr[1]*100),int(xyr[2]*100)) if file_exists(filename): grasps.append([xyr, filename]) save_pickle(grasps, index) def collect_grasp_data(ki, generate_models=False, skip_grasp=False): cm = ControllerManager(armc) apm = ArmPerceptionMonitor(ARM, tf_listener=cm.tf_listener, percept_mon_list=None) # if restart: # grasp_data = load_pickle(GRASP_DATA) # grasp_xyr_list = zip(*grasp_data)[0] # else: # grasp_xyr_list = get_xy_list() # grasp_data = [] grasp_xyr_list = get_xyr_list() grasp_data = [] grasp_index = [] print "Opening gripper" cm.command_gripper(0.08, -1.0, False) cm.gripper_action_client.wait_for_result(rospy.Duration(4.0)) for c, xyr in enumerate(grasp_xyr_list): # if c < 257: # continue if rospy.is_shutdown(): return print "---------------------------------------------------" print "%1.2f completion" % (float(c) / len(grasp_xyr_list)) zeros = None # Do grasping num_n times for i in range(NUM_N): pauser(ki) # Move to grasp position print "Moving to grasp position (%1.2f, %1.2f, %1.2f)" % xyr grasp_pose = create_goal_pose(xyr[0], xyr[1], HOVER_Z, get_gripper_pose(xyr[2])) setup_result = cm.move_arm_pose_biased(grasp_pose, JOINTS_BIAS, SETUP_VELOCITY, blocking = True) rospy.sleep(0.5) if skip_grasp: break if setup_result is not None: if zeros is None: # wait for a bit to get the zeros here rospy.sleep(0.5) zeros = apm.get_zeros(0.6) goal_pose = create_goal_pose(xyr[0], xyr[1], HOVER_Z - GRASP_DIST, get_gripper_pose(xyr[2])) # start gathering data apm.start_training() # move arm down print "Moving arm down" sttime = rospy.Time.now().to_sec() result = downward_grasp(cm, goal_pose, block=True) endtime = rospy.Time.now().to_sec() print "dur:", endtime - sttime print result print "Finished moving arm" length = apm.stop_training() print "length:", length print "len/dur", length / (endtime - sttime) rospy.sleep(0.5) else: break # can't move to initial position if setup_result is None or skip_grasp: continue fn = None if result != "no solution" and generate_models: models = apm.generate_models() else: models = None if result != "no solution": # grasp_data += [(xyr, None, apm.datasets, models, zeros)] fn = save_grasp([xyr, None, apm.datasets, models, zeros], GRASP_DATA_PREFIX) else: print "Grasp Failed, not adding data" grasp_index.append([xyr, fn]) apm.clear_vars() print "Saving Data" #save_pickle(grasp_data, GRASP_DATA_FILE) save_pickle(grasp_index, GRASP_DATA_INDEX_FILE) print "Data save complete" return None #grasp_data def load_data_and_generate(grasp_data): ret = [] n = 0 for grasp in grasp_data: apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_MON_LIST) apm.datasets = grasp[2] apm.generate_models() ret += [(grasp[0], grasp[1], grasp[2], apm.models, grasp[4])] n += 1 print "Generated %d models" % (n) # save_pickle(ret, GRASP_MODELS_FILE) return ret def generate_space_models(): mean_grasps = [] grasps = [] grasp_xyr_list = get_xyr_list() for grasp in grasp_data: mean_grasps.append([grasp[0], generate_mean_grasp(grasp[2])]) def dist1(o): return np.fabs(o[0][0] - x) + np.fabs(o[0][1] - y) xs = (RECT[1][0] - RECT[0][0]) / (NUM_X - 1) ys = (RECT[0][1] - RECT[1][1]) / (NUM_Y - 1) rs = np.pi / NUM_R st = [RECT[0][0] + xs/2., RECT[1][1] + ys/2., rs] num_gen = 0 for i in range(NUM_X - 1): for j in range(NUM_Y - 1): for k in range(NUM_R): print "Number of models generated:", num_gen num_gen += 1 pauser() close_models = [] def dist1(o): return np.fabs(o[0][0] - st[0]) + np.fabs(o[0][1] - st[1]) def rotdist(o): if np.allclose(o[0][2], 0.0): # for loop around return min(np.fabs(np.pi - st[2]), np.fabs(0. - st[2])) else: return np.fabs(o[0][2] - st[2]) for i, dist in enumerate(map(dist1, mean_grasps)): if np.allclose(dist, (xs/2. + ys/2.), 0.0001) and np.allclose(rotdist(xyr_index[i]), rs/2., 0.0001): close_models += [mean_grasps[i]] if len(close_models) < 5: print "Rejecting %1.2f, %1.2f, %1.2f with number close models = %d", ( st[0], st[1], st[2], len(close_models)) continue # find the average case over the several runs models = {} for p in close_models: lens = [len(m) for m in close_models[p]] max_len = np.max(lens) signals = zip(*close_models[p]) ammodels, vmodels = [], [] for signal in signals: avg_means_model = np.array([0.] * max_len) sqr_means_model = np.array([0.] * max_len) for i in range(max_len): n = 0 for j in range(len(signal)): if i < len(signal[j]): avg_means_model[i] += close_models[j][i] sqr_means_model[i] += close_models[j][i] ** 2 n += 1 avg_means_model[i] /= n sqr_means_model[i] /= n vars_model = signal_smooth(sqr_means_model, 30) - avg_means_model ammodels.append(avg_means_model) vmodels.append(vars_model) models[p] = {} models[p]["mean"] = zip(*ammodels) models[p]["variance"] = zip(*vmodels) grasp = [st, None, None, models, None] save_grasp(grasp, GRASP_IND_PREFIX) st[2] += rs st[1] += ys st[0] += xs # def test_monitor(grasp_data): # apm = ArmPerceptionMonitor(ARM) # j = 0 # while grasp_data[j][1] is None: # j += 1 # apm.models = grasp_data[j][3] # def print_warn(): # print "Warning! Outside model" # apm.begin_monitoring(contingency=print_warn) # raw_input() # apm.end_monitoring() def save_current_zeros(filename=ZEROS_FILE): apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_MON_LIST) zeros = apm.get_zeros() print "Zeros:", zeros save_pickle(zeros, filename) def load_current_zeros(filename=ZEROS_FILE): return load_pickle(filename) def is_obj_in_gripper(cm=None): if cm is None: cm = ControllerManager(armc) return cm.get_current_gripper_opening() > 0.01 def open_gripper(cm=None, blocking = False): if cm is None: cm = ControllerManager(armc) cm.command_gripper(0.08, -1.0, False) if blocking: cm.gripper_action_client.wait_for_result(rospy.Duration(4.0)) def perform_grasp(x, y, z=None, gripper_rot = np.pi / 2., grasp=None, is_place=False, is_grasp=True, collide = True, return_pose=True, zeros = None, grasp_data=None, cm=None, apm=None): print "Performing grasp (%1.2f, %1.2f), rotation: %1.2f" % (x, y, gripper_rot) gripper_rot = normalize_rot(gripper_rot) if cm is None: cm = ControllerManager(armc) if apm is None: apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_GRASP_LIST) if grasp is None: grasp = get_grasp_model(x, y, gripper_rot, grasp_data = grasp_data) #apm.datasets = grasp[2] #apm.models = grasp[3] #apm.model_zeros = grasp[4] #print "Model zeros:", grasp[4] print "Beginning grasp" result = "no solution" iters = 0 while True: # Move to grasp position print "Moving to initial grasp position" # cm.command_joint_trajectory([grasp[1]], SETUP_VELOCITY, blocking = True) # print "Moving to final grasp position" grasp_pose = create_goal_pose(x, y, HOVER_Z, get_gripper_pose(gripper_rot)) cm.move_arm_pose_biased(grasp_pose, JOINTS_BIAS, SETUP_VELOCITY, blocking = False) if not is_place and is_grasp: # open gripper print "Opening gripper" cm.command_gripper(0.08, -1.0, False) cm.gripper_action_client.wait_for_result(rospy.Duration(2.0)) cm.wait_joint_trajectory_done() rospy.sleep(0.5) #if zeros is None: # zeros = apm.get_zeros(0.6) # print "Current zeros:", zeros goal_pose = create_goal_pose(x, y, HOVER_Z - GRASP_DIST, get_gripper_pose(gripper_rot)) class Collision(): def __init__(self): self.collided = False # start gathering data def on_collision(self): print "Collision!" self.collided = True while not cm.check_joint_trajectory_done(): cm.joint_action_client.cancel_all_goals() rospy.sleep(0.01) if rospy.is_shutdown(): return None col = Collision() def rotate_acceleration(data): return data data -= zeros["accelerometer"] a = gripper_rot data[1] = np.cos(a) * data[1] - np.sin(a) * data[2] data[2] = np.sin(a) * data[1] + np.cos(a) * data[2] data += zeros["accelerometer"] return data transforms = { "accelerometer" : rotate_acceleration } while not rospy.is_shutdown() and len(grasp) < 5: rospy.sleep(0.1) apm.begin_monitoring(grasp[3], model_zeros = grasp[4], contingency=col.on_collision, window_size=MONITOR_WINDOW, current_zeros=zeros, std_dev_default=STD_DEV, std_dev_dict = STD_DEV_DICT, tol_thresh_dict = TOL_THRESH_DICT, noise_dev_default=NOISE_DEV, collide=collide, transform_dict = transforms) # move arm down print "Moving arm down" startt = rospy.Time.now().to_sec() result = downward_grasp(cm, goal_pose, block = False) print "Grasp result:", result if result == "no solution": # Jiggle it to see if it works apm.end_monitoring() dx = random.uniform(-0.015, 0.015) dy = random.uniform(-0.015, 0.015) x += dx y += dy iters += 1 # Tried too many times if iters == 4: print "Cannot find IK solution!!!" * 8 return else: continue else: break if z is None: while not cm.check_joint_trajectory_done(): if col.collided: cm.joint_action_client.cancel_all_goals() rospy.sleep(0.01) if rospy.is_shutdown(): return None else: while not cm.check_joint_trajectory_done(): if col.collided: cm.joint_action_client.cancel_all_goals() wrist_pose = cm.get_current_wrist_pose_stamped("torso_lift_link") p = wrist_pose.pose.position o = wrist_pose.pose.orientation affector_pos = transform_in_frame([p.x, p.y, p.z], [o.x, o.y, o.z, o.w], GRIPPER_POINT) if affector_pos[2] <= z: print "Reached z position" print "Affector position:", affector_pos while not cm.check_joint_trajectory_done(): cm.joint_action_client.cancel_all_goals() rospy.sleep(0.01) break rospy.sleep(0.01) if rospy.is_shutdown(): return None endt = rospy.Time.now().to_sec() print "Grasp duration:", startt - endt print "Finished moving arm" avg_list = apm.end_monitoring() rospy.sleep(0.1) global z_sum for k in apm.z_avg: if not k in z_sum: z_sum[k] = np.copy(apm.z_avg[k]) else: z_sum[k] += apm.z_avg[k] if not is_place and is_grasp: print "Closing gripper" cm.command_gripper(0.0, 30.0, True) print "Gripper closed" elif is_place: print "Opening gripper" cm.command_gripper(0.08, -1.0, True) print "Gripper opened" if return_pose and is_grasp: print "Moving back to grasp position" cm.move_arm_pose_biased(grasp_pose, JOINTS_BIAS, SETUP_VELOCITY, blocking = True) #upward_lift(cm, grasp_pose, block=True) print "Grasp complete!" return grasp, avg_list, col.collided, zeros # def perform_template_grasp(grasp): # cm = ControllerManager(armc) # apm = ArmPerceptionMonitor(ARM, percept_mon_list=["accelerometer"]) # # apm.datasets = grasp[2] # apm.models = grasp[3] # # # Move to grasp position # print "Moving to grasp position" # cm.command_joint(grasp[1]) # cm.wait_joint_trajectory_done() # rospy.sleep(0.5) # # goal_pose = create_goal_pose(grasp[0][0], grasp[0][1], HOVER_Z - GRASP_DIST) # # # start gathering data # def print_collision(): # print "Collision!" # cm.freeze_arm() # apm.begin_monitoring(contingency=print_collision, window_size=MONITOR_WINDOW) # # # move arm down # print "Moving arm down" # downward_grasp(cm, goal_pose, block = False) # cm.wait_joint_trajectory_done() # print "Finished moving arm" # # avg_list = apm.end_monitoring() # rospy.sleep(0.5) # # return avg_list def display_grasp_data(grasps, percept="accelerometer", indicies=range(3), std_dev=STD_DEV, noise_dev_add=NOISE_DEV, monitor_data=[], std_dev_dict=STD_DEV_DICT, tol_thresh_dict=TOL_THRESH_DICT, model_zeros=None, monitor_zeros=None, plot_data=False, colors=None): import matplotlib.pyplot as plt if colors is None: colors = ['r', 'b', 'g', 'c'] j = 0 rows = len(grasps) cols = len(indicies) for i, grasp in enumerate(grasps): models = grasp[3] means = models[percept]["mean"] vars = models[percept]["variance"] maxs = models[percept]["max"] mins = models[percept]["min"] if "smoothed_signals" in models[percept]: signals = models[percept]["smoothed_signals"] zip_signals = [ zip(*sig) for sig in signals ] else: signals = None zip_signals = [] if "noise_variance" in models[percept]: noise_var = models[percept]["noise_variance"] noise_dev = np.sqrt(noise_var) else: noise_var = None noise_dev = None print "noise variance", noise_var zip_means = np.array(zip(*means)) zip_vars = np.array(zip(*vars)) zip_maxs = np.array(zip(*maxs)) zip_mins = np.array(zip(*mins)) # print "monitor_data", monitor_data zip_monitors = [] for d in monitor_data: zip_monitors += [zip(*d[percept])] graph_means, graph_devs, mmax, mmin = [], [], [], [] for w in indicies: graph_means += [zip_means[w]] graph_devs += [np.sqrt(zip_vars[w])] if std_dev_dict is not None and percept in std_dev_dict: std_dev = std_dev_dict[percept][w] if tol_thresh_dict is not None and percept in tol_thresh_dict: tol_thresh = tol_thresh_dict[percept][w] else: tol_thresh = 0. if noise_dev is not None: noise_dev_term = noise_dev[w] * noise_dev_add else: noise_dev_term = 0. # mmax += graph_means[w] + graph_devs[w] * std_dev + noise_dev_term # + tol_thresh] # mmin += [graph_means[w] - graph_devs[w] * std_dev - noise_dev_term # - tol_thresh] for k in range(len(indicies)): plt.subplot(rows, cols, i*cols + 1 + k) cnum = 0 if plot_data: for stream in grasp[2][percept]: # s_mag = [np.sqrt(x[1][0]**2 + x[1][1]**2 + x[1][2]**2) for x in stream] # plt.plot(s_mag,colors[cnum]) plt.plot([x[1][k] for x in stream],colors[cnum]) cnum += 1 cnum %= len(colors) for sig in zip_signals: if indicies[k] < len(sig): plt.plot(sig[indicies[k]], colors[2]) if i < len(zip_monitors): zip_monitor = zip_monitors[i] len_diff = len(graph_means[k]) - len(zip_monitor[indicies[k]]) add_vals = [zip_monitor[indicies[k]][0]] * MONITOR_WINDOW # add_vals = [zip_monitor[indicies[k]][0]] * len_diff print len_diff g = np.array(add_vals + list(zip_monitor[indicies[k]])) # g += grasp[4][percept][indicies[k]] - monitor_zeros[i][percept][indicies[k]] plt.plot(g.tolist(),colors[3]) plt.plot(graph_means[k], colors[0]) plt.plot(zip_maxs[indicies[k]], colors[1]) plt.plot(zip_mins[indicies[k]], colors[1]) # plt.plot(mmax[k], colors[1]) # plt.plot(mmin[k], colors[1]) plt.title("%1.2f, %1.2f: coord %d" % (grasp[0][0], grasp[0][1], k)) j += 1 plt.show() def die(): sys.exit() def test_num_samples(percept="accelerometer"): # This function proves that adding more than 3-4 grasps per location is unnecessary # Grasping trajectories are very repeatable given a specific grasping location. # The issue comes from more from shifting of the actual trajectory from expected # given a grasping location just a few cm off. The models can handle the trajectory # so long as it is not much more than 5cm away from the training model. grasp_data = load_pickle(GRASP_DATA_FILE)[0:1] data_list = grasp_data[0][2][percept] for i in [3, 6, 9]: apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_MON_LIST) grasp_data[0][2][percept] = data_list[0:i+1] apm.datasets = grasp_data[0][2] apm.generate_models() grasp_data[0][3][percept] = apm.models[percept] if i != 3: colors = ['m', 'y', 'k', 'r'] else: colors = None display_grasp_data(grasp_data, percept, rows=1) def detect_tabletop_objects(): cbbf = ClusterBoundingBoxFinder() object_detector = rospy.ServiceProxy("/object_detection", TabletopDetection) detects = object_detector(True, False).detection object_detector.close() if detects.result != 4: print "Detection failed (err %d)" % (detects.result) return [] table_z = detects.table.pose.pose.position.z objects = [] for cluster in detects.clusters: (object_points, object_bounding_box_dims, object_bounding_box, object_to_base_link_frame, object_to_cluster_frame) = cbbf.find_object_frame_and_bounding_box(cluster) # print "bounding box:", object_bounding_box (object_pos, object_quat) = cf.mat_to_pos_and_quat(object_to_cluster_frame) angs = euler_from_quaternion(object_quat) print "angs:", angs # position is half of height object_pos[2] = table_z + object_bounding_box[1][2] / 2. + DETECT_ERROR print "pos:", object_pos print "table_z:", table_z objects += [[object_pos, angs[2]]] return objects def grasp_object(obj, grasp=None, collide=True, is_place=False, zeros=None, cm=None, apm=None): if collide: return perform_grasp(obj[0][0], obj[0][1], is_place=is_place, gripper_rot=obj[1], grasp=grasp, zeros=zeros, cm=cm, apm=apm) else: return perform_grasp(obj[0][0], obj[0][1], z=obj[0][2], is_place=is_place, gripper_rot=obj[1], grasp=grasp, zeros=zeros, cm=cm, apm=apm) def grasp_closest_object(x, y, grasp=None, collide=True, repeat=True, zeros=None, cm=None, apm=None): def dist(o): return (o[0][0] - x) ** 2 + (o[0][1] - y) ** 2 grasped = False num_tries = 0 point_head([x,y,-0.2]) while not grasped and num_tries < 4: print "Detect in" change_projector_mode(True) rospy.sleep(0.6) detect_tries = 0 objects = None while (objects is None or len(objects) == 0): objects = detect_tabletop_objects() rospy.sleep(0.6) detect_tries += 1 if detect_tries == 3 and (objects is None or len(objects) == 0): print "Cannot detect any objects" return None, None, None, None, None print "Detect out" if len(objects) > 0: obj = min(objects, key=dist) # Get better look if True: point_head(obj[0]) rospy.sleep(0.2) print "Detect2 in" objects = detect_tabletop_objects() print "Detect2 out" obj = min(objects, key=dist) change_projector_mode(False) (grasp, avg_list, collided, zeros) = grasp_object(obj, grasp=grasp, collide=collide, zeros=zeros, cm=cm, apm=apm) rospy.sleep(0.2) grasped = is_obj_in_gripper(cm) if repeat and not grasped: num_tries += 1 continue if grasped: print "Grasp success!" return obj, grasp, avg_list, collided, zeros else: print "Grasp failure" return obj, grasp, avg_list, collided, zeros else: print "No objects near point" return None, None, None, None, None def grasp_demo(): cm = ControllerManager(armc) apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_MON_LIST) grasps, avg_lists = [], [] (obj1, grasp, avg_list, collided, zeros) = grasp_closest_object(0.45, 0.1, cm=cm, apm=apm) grasps += [grasp] avg_lists += [avg_list] obj1pl = [[obj1[0][0], obj1[0][1] - 0.18], obj1[1]] (grasp, avg_list, collided, zeros) = grasp_object(obj1pl, is_place=True, zeros=zeros, cm=cm, apm=apm) grasps += [grasp] avg_lists += [avg_list] (obj2, grasp, avg_list, collided, zeros) = grasp_closest_object(0.7, 0.1, zeros=zeros, cm=cm, apm=apm) grasps += [grasp] avg_lists += [avg_list] (grasp, avg_list, collided, zeros) = grasp_object(obj1, is_place=True, zeros=zeros, cm=cm, apm=apm) grasps += [grasp] avg_lists += [avg_list] (obj3, grasp, avg_list, collided, zeros) = grasp_closest_object(obj1pl[0][0], obj1pl[0][1], zeros=zeros, cm=cm, apm=apm) grasps += [grasp] avg_lists += [avg_list] (grasp, avg_list, collided, zeros) = grasp_object(obj2, is_place=True, zeros=zeros, cm=cm, apm=apm) grasps += [grasp] avg_lists += [avg_list] display_grasp_data(grasps[0:3], "accelerometer", monitor_data=avg_lists[0:3]) display_grasp_data(grasps[3:-1], "accelerometer", monitor_data=avg_lists[3:-1]) def trim_test_data(grasp_data=None): if grasp_data is None: grasp_data = load_pickle(GRASP_DATA_FILE) new_data = [] for grasp in grasp_data: new_data += [(grasp[0], grasp[1], None, grasp[3], grasp[4])] save_pickle(new_data, GRASP_MODELS_FILE) return new_data def save_grasp(grasp, prefix): filename = prefix + "%04d-%04d-%04d.pickle" % (int(grasp[0][0]*100),int(grasp[0][1]*100),int(grasp[0][2]*100)) save_pickle(grasp, filename) return filename def split_model_data(data=None): if data is None: data = load_pickle(GRASP_MODELS_FILE) xyr_index = [] n = 1 for grasp in data: filename = GRASP_IND_PREFIX + "%03d-%03d-%03d.pickle" % (int(grasp[0][0]*100),int(grasp[0][1]*100),int(grasp[0][2]*100)) xyr_index += [[grasp[0], filename]] save_pickle(grasp, filename) n += 1 save_pickle(xyr_index, GRASP_INDEX_FILE) def resample_split_model_data(apm, models=None, sampling_rate=4): if models is None: models = load_pickle(GRASP_MODELS_FILE) new_models = [] for model in models: new_model = apm.resample_and_thin_data(model[3], sampling_rate) new_models.append([model[0], None, None, new_model, model[4]]) split_model_data(new_models) def normalize_rot(gripper_rot): while gripper_rot >= np.pi: gripper_rot -= np.pi while gripper_rot < 0.: gripper_rot += np.pi return gripper_rot def grasp_loader(filename): class GLoader(threading.Thread): def __init__(self): threading.Thread.__init__(self) self.grasp = [] def run(self): tg = load_pickle(filename) for v in tg: self.grasp.append(v) gl = GLoader() gl.start() return gl.grasp def load_grasp(xyr, xyr_index = GRASP_DATA_INDEX_FILE): return get_grasp_model(xyr[0], xyr[1], xyr[2], xyr_index = xyr_index, no_wait=False) def get_grasp_model(x, y, r, xyr_index = None, grasp_data = None, no_wait = True): r = normalize_rot(r) if grasp_data is None: if xyr_index is None: xyr_index = load_pickle(GRASP_INDEX_FILE) else: xyr_index = grasp_data if len(xyr_index) > 0: def dist(o): if np.allclose(o[0][2], 0.0): # for loop around rot_dist = min((np.pi - r) ** 2, (0. - r) ** 2) else: rot_dist = (o[0][2] - r) ** 2 return (o[0][0] - x) ** 2 + (o[0][1] - y) ** 2 + rot_dist xyr = min(xyr_index, key=dist) print "Distance to grasp model:", dist(xyr), "rotation diff:", xyr[0][2] - r if grasp_data is None: if not no_wait: return load_pickle(xyr[1]) return grasp_loader(xyr[1]) else: return xyr else: print "Bad index file" return None def load_grasp(x, y, r, xyr_index = None): if xyr_index is None: xyr_index = load_pickle(GRASP_INDEX_FILE) for xyr in xyr_index: if np.allclose([x, y, r], xyr[0]): return load_pickle(xyr[1]) return None def compute_sqr_diff_map(percept="accelerometer"): xys = get_xy_list() def get_xy(i, j): return xys[i * NUM_Y + j] def model_sqr_err(m1, xy, i, j): n = 0 sum = 0. cxy = get_xy(i, j) g2 = get_grasp_model(cxy[0], cxy[1]) if np.allclose(g2[0], xy): return [-1.] m2 = g2[3][percept]["mean"] for i in range(min(len(m1),len(m2))): sum += (m1[i] - m2[i]) ** 2 n += 1 return sum / n xy_index = load_pickle(GRASP_INDEX_FILE) if len(xys) > 0: map = [] for i in range(NUM_X): map += [[]] for j in range(NUM_Y): cen_xy = get_xy(i, j) cen_grasp = get_grasp_model(cen_xy[0], cen_xy[1]) cen_grasp_model = cen_grasp[3][percept]["mean"] if not np.allclose(cen_xy, cen_grasp[0]): map[-1] += [0.] continue else: err = 0. n = 0 new_err = model_sqr_err(cen_grasp_model, cen_xy, i+1, j) if new_err[0] != -1.: err += new_err n += 1 new_err = model_sqr_err(cen_grasp_model, cen_xy, i-1, j) if new_err[0] != -1.: err += new_err n += 1 new_err = model_sqr_err(cen_grasp_model, cen_xy, i, j+1) if new_err[0] != -1.: err += new_err n += 1 new_err = model_sqr_err(cen_grasp_model, cen_xy, i, j-1) if new_err[0] != -1.: err += new_err n += 1 err = np.linalg.norm(err) ** 2 / len(err) if n > 0: map[-1] += [err / n] else: map[-1] += [0.] return map else: print "Bad index file" return None def sqr_diff_viz(): # save_pickle(compute_sqr_diff_map(), SQR_DIFF_MAP) map = load_pickle(SQR_DIFF_MAP) map.reverse() maxarg = max([max(row) for row in map]) print np.mat(map) for i in range(len(map)): for j in range(len(map[i])): if map[i][j] == -1.: map[i][j] = maxarg*1.5 import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) ax.matshow(map) plt.show() def process_data(grasp_data=None): print "Loading data" if grasp_data is None: grasp_data = load_pickle(GRASP_DATA_FILE) print "Data loaded, generating models" grasp_data = load_data_and_generate(grasp_data) print "Saving models" print "Trimming test data" model_data = trim_test_data(grasp_data) print "Splitting models" split_model_data(model_data) print "Done processing data" def calc_model(x, y, r, window_len= 200, samples=50, xyr_index = None, resample = 10): if xyr_index is None: xyr_index = load_pickle(GRASP_INDEX_FILE) xs = (RECT[1][0] - RECT[0][0]) / (NUM_X - 1) ys = (RECT[0][1] - RECT[1][1]) / (NUM_Y - 1) rs = np.pi / NUM_ROT def dist1(o): return np.fabs(o[0][0] - x) + np.fabs(o[0][1] - y) def dist2(o): return (o[0][0] - x) ** 2 + (o[0][1] - y) ** 2 def rotdist(o): if np.allclose(o[0][2], 0.0): # for loop around return min(np.fabs(np.pi - r), np.fabs(0. - r)) else: return np.fabs(o[0][2] - r) n = 1 close_models = [] for i, dist in enumerate(map(dist1, xyr_index)): if np.allclose([x, y, r], xyr_index[i][0]): close_models = [[xyr_index[i][0], load_pickle(xyr_index[i][1])]] break if dist < xs + ys and rotdist(xyr_index[i]) < rs: close_models += [[xyr_index[i][0], load_pickle(xyr_index[i][1])]] ret_models = {} for k in close_models[0][1][3]: close_stream_means = [] minlen = min([len(cm[1][3][k]["mean"]) for cm in close_models]) for close_model in close_models: mean = close_model[1][3][k]["mean"][0:minlen] stream_means = zip(*mean) close_stream_means += [[close_model[0], np.array(stream_means)]] expected_means, expected_vars = [], [] for i in range(len(close_stream_means[0][1])): close_signals = [] sum = np.array([0.]*len(close_stream_means[0][1][0])) distsum = 0. for close_stream in close_stream_means: close_signals += [close_stream[1][i]] dist = dist2(close_stream) sum += close_stream[1][i] / dist distsum += 1. / dist expected_mean = sum / distsum expected_var = signal_list_variance(close_signals, expected_mean, window_len, samples, resample) expected_means += [expected_mean[::resample]] expected_vars += [expected_var] ret_model = { "mean" : zip(*expected_means), "variance" : zip(*expected_vars) } ret_models[k] = ret_model return [[x, y, r], None, None, ret_models, None] def random_grasp(): xs = (RECT[1][0] - RECT[0][0]) / (NUM_X - 1) ys = (RECT[0][1] - RECT[1][1]) / (NUM_Y - 1) x = random.uniform(RECT[0][0]-xs/2., RECT[1][0]+xs/2.) y = random.uniform(RECT[1][1]-ys/2., RECT[0][1]+ys/2.) r = random.uniform(0., np.pi) return x, y, r def random_known_grasp(): xyr_index = load_pickle(GRASP_INDEX_FILE) ind = random.randint(0,len(xyr_index)-1) return xyr_index[ind][0] def test_random_grasps(num_grasps=100): cm = ControllerManager(armc) apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_GRASP_LIST) monitor_data = [] grasps = [] collided_list = [] num_collided = 0 test_data = [] zeros = None open_gripper(cm=cm) for i in range(num_grasps): if rospy.is_shutdown(): break x, y, rot = random_grasp() (grasp, monitor, collided, zeros) = perform_grasp(x, y, gripper_rot = rot, collide=False, is_grasp = False, zeros=zeros, cm=cm, apm=apm) test_data += [{"loc" : (x, y, rot), #"model" : grasp, "monitor" : monitor, "collided" : collided, "zeros" : zeros}] if collided: print "COLLIDED\n"*10 num_collided += 1 print "Accuracy: %d collisions out of %d grasps (%1.2f)" % (num_collided, num_grasps, 1. - float(num_collided) / num_grasps) save_pickle(test_data, TEST_DATA_FILE) def calc_false_pos(test_data=None, xyr_index=None, apm=None): if test_data is None: test_data = load_pickle(TEST_DATA_FILE) if apm is None: apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_GRASP_LIST) num_collisions = 0 indicies = {} for test in test_data: model = get_grasp_model(test["loc"][0], test["loc"][1], test["loc"][2], xyr_index=xyr_index) collision = apm.simulate_monitoring(test["monitor"], models=model[3], model_zeros = test["zeros"], window_size=MONITOR_WINDOW, std_dev_default=STD_DEV, std_dev_dict = STD_DEV_DICT, tol_thresh_dict = TOL_THRESH_DICT, noise_dev_default=NOISE_DEV) if collision is not None: num_collisions += 1 k, index, diff = collision if not k in indicies: indicies[k] = [0]*len(model[3][k]["mean"][0]) indicies[k][index] += 1 print "Accuracy: %d collisions out of %d grasps (%1.2f)" % (num_collisions, len(test_data), 1. - float(num_collisions) / len(test_data)) print indicies return float(num_collisions) / len(test_data) # def dynamic_parameter_tune(alpha = 0.1, dev_seed = 1.2, seed_dict=None): # global STD_DEV_DICT # x_old = { "accelerometer" : [dev_seed]*3, # "joint_angles" : [dev_seed]*7, # "joint_velocities" : [dev_seed]*7, # "joint_efforts" : [dev_seed]*7, # "r_finger_periph_pressure" : [dev_seed]*6, # "r_finger_pad_pressure" : [dev_seed]*15, # "l_finger_periph_pressure" : [dev_seed]*6, # "l_finger_pad_pressure" : [dev_seed]*15, ] # for k in STD_DEV_DICT: # STD_DEV_DICT[k] = np.array(STD_DEV_DICT[k]) # test_data = load_pickle(TEST_DATA_FILE) # apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_GRASP_LIST) # def F(x): # sum = 0. # for k in x: # sum += np.sum(x[k]) # global STD_DEV_DICT # STD_DEV_DICT = x # print "Evaluating:", x # fp = calc_false_pos(test_data=test_data) # print "False positive rate:", fp # return fp + alpha * sum # def add_x(x, delta, step): # # def get_grad(x_old, F_old, x_new, F_new): # grad = {} # for k in old: # grad[k] = (F_new - F_old) / (new[k] - old[k]) # # step = 0.2 # F_old = F(x_old) # x_new = copy.deepcopy(x_old) # for k in x_new: # x_new[k] += step # F_new = F(x_new) # # # for k in # # # for dev in devs: # fp = calc_false_pos(test_data=test_data) # print "std dev:", dev # fp_rate += [fp] def visualize_objs(): objs = detect_tabletop_objects() pubm = rospy.Publisher('grasp_obj_positions', Marker) pubma = rospy.Publisher('grasp_obj_positions_array', MarkerArray) markers = [] for obj in objs: pos, angle = np.mat(obj[0]).T, obj[1] marker = viz.single_marker(pos, np.mat(quaternion_about_axis(angle, (0, 0, 1))).T, "arrow", "torso_lift_link") marker.header.stamp = rospy.Time.now() markers.append(marker) pubm.publish(marker) ma = MarkerArray(markers) i = 0 while not rospy.is_shutdown(): pubm.publish(markers[i]) rospy.sleep(2.1) i = (i + 1) % len(markers) print objs rospy.spin() def get_laser_dclick(tf_listener, frame = "/torso_lift_link", delay_time = 3.0): c3d_lis = GenericListener("c3dlisnode", PointStamped, CURSOR_TOPIC, 10.0) dc_lis = GenericListener("dclisnode", String, MOUSE_DOUBLE_CLICK_TOPIC, 10.0) print "Waiting for laser click..." while not rospy.is_shutdown(): if dc_lis.read(allow_duplication = False, willing_to_wait = False) is not None: print "DC" msg = c3d_lis.read(allow_duplication = True, willing_to_wait = False) print msg if msg is not None: if rospy.Time.now().to_sec() - msg.header.stamp.to_sec() <= delay_time: now = rospy.Time.now() tf_listener.waitForTransform(msg.header.frame_id, frame, now, rospy.Duration(4.0)) tfmat = tf_utils.transform(frame, msg.header.frame_id, tf_listener) tfmat *= np.mat([[msg.point.x], [msg.point.y], [msg.point.z], [1.0]]) pt = tfmat[0:3,3] #(trans, rot) = tf_listener.lookupTransform(msg.header.frame_id, frame, now) #pt = [msg.point.x - trans[0], msg.point.y - trans[1], msg.point.z - trans[2]] print "pt", pt return pt[0,0], pt[1,0], pt[2,0] rospy.sleep(0.01) return None def point_head(point, velocity = 0.6, frame="/torso_lift_link", block = True): head_action_client = actionlib.SimpleActionClient("/head_traj_controller/point_head_action", PointHeadAction) head_action_client.wait_for_server() goal = PointHeadGoal() goal.target = cf.create_point_stamped(point, frame) goal.pointing_frame = "/narrow_stereo_optical_frame" goal.max_velocity = velocity head_action_client.send_goal(goal) if not block: return 0 finished_within_time = head_action_client.wait_for_result(rospy.Duration(20)) if not finished_within_time: head_action_client.cancel_goal() rospy.logerr("timed out when asking the head to point to a new goal") return 0 return 1 def hand_over_object(x, y, z, cm, apm, offset = 0.2, blocking = True): pt = np.array([x,y,z]) quat = quaternion_about_axis(0.9, (0, 0, 1)) dist = np.linalg.norm(pt) start_angles = cm.get_current_arm_angles() print start_angles ptnorm = pt / dist dist -= offset joints = None while not rospy.is_shutdown() and pt[0] > 0.2: pt = dist * ptnorm print "dist", dist pose = create_gripper_pose(pt[0], pt[1], pt[2], quat.tolist()) print pose HANDOFF_BIAS = [0., -.25, -100., 200., 0.0, 200.0, 0.] joints = cm.ik_utilities.run_biased_ik(pose, HANDOFF_BIAS, num_iters=30) if joints is not None: break dist -= 0.1 # joints = [-0.1, -0.15, -1.2, -0.7, 0., -0.2, 0.] cm.command_joint_trajectory([joints], 0.27, blocking = blocking) def change_projector_mode(on): client = dynamic_reconfigure.client.Client("camera_synchronizer_node") node_config = client.get_configuration() node_config["projector_mode"] = 2 if on: node_config["narrow_stereo_trig_mode"] = 3 else: node_config["narrow_stereo_trig_mode"] = 4 client.update_configuration(node_config) def move_to_setup(cm, blocking = True): joints = [-0.62734204881265387, -0.34601608409943324, -1.4620635485239604, -1.2729772622637399, -7.5123303230158518, -1.5570651396529178, -5.5929916630672727] cm.command_joint_trajectory([joints], 0.62, blocking = blocking) def laser_interface_demo(): cm = ControllerManager(armc) apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_GRASP_LIST) move_to_setup(cm) x, y, z = get_laser_dclick(cm.tf_listener) # x, y, z = 0.7, 0.0, -0.3 point_head([x,y,z], block = True) grasp_closest_object(x, y, cm=cm, apm=apm) change_projector_mode(on=False) x, y, z = get_laser_dclick(cm.tf_listener) # x, y, z = 1.2, 0.0, 0.3 point_head([x,y,z+0.2], block = True) # hand_over_object(x, y, z, cm, apm) def monitor_pressure(): apm = ArmPerceptionMonitor(ARM, percept_mon_list=PRESSURE_LIST) rospy.sleep(1.0) models = {} for k in PRESSURE_LIST: if "periph" in k: models[k] = {} models[k]["mean"] = np.array([np.array([0.]*6)]) models[k]["variance"] = np.array([np.array([40.]*6)]) if "pad" in k: models[k] = {} models[k]["mean"] = np.array([np.array([0.]*15)]) models[k]["variance"] = np.array([np.array([40.]*15)]) apm.begin_monitoring(models, only_pressure=True) print "Monitoring pressure..." while not rospy.is_shutdown() and not apm.failure: rospy.sleep(0.01) print "Pressure triggered" # # def double_click_listener(self, msg): # """ # Waits until a double click message is sent, then executes appropriate pick # or place operation. Uses latest cursor3d message. # # @param msg: Latest cursor3d message # @type msg: PointStamped # """ # pt = self.latest_cursor # if pt == None: # return # dclick_delay = rospy.Time.now().to_sec() - self.latest_cursor.header.stamp.to_sec() # if dclick_delay < MAX_DELAY: # rospy.loginfo("cursor3d target acquired.") # self.papm.tf_listener.waitForTransform(self.latest_cursor.header.frame_id, "base_footprint", rospy.Time.now(), rospy.Duration(4.0)) # pt_loc = self.papm.tf_listener.transformPoint('base_footprint', pt) # # if not self.hasobject: # success = lp.pick_up_object_near_point(pt_loc) # if success: # rospy.loginfo("Success with pickup! Waiting for target placement...") # self.hasobject = True # else: # rospy.loginfo("Failure. Exiting...") # rospy.signal_shutdown("SS") # else: # target_pose = create_pose_stamped([pt_loc.point.x, pt_loc.point.y, pt_loc.point.z, 0.0, 0.0, 0.0, 1.0], # 'base_link') # success = lp.place_object((RECT_DIM_X, RECT_DIM_Y), target_pose) # if success: # rospy.loginfo("Success with placement! Exiting...") # else: # rospy.loginfo("Failure placing. Exiting...") # rospy.signal_shutdown("SS") def main(): rospy.init_node(node_name) # rospy.on_shutdown(die) setup_package_loc() ki = KeyboardInput() #x, y, z = get_laser_dclick() #laser_interface_demo() #return 0 generate_space_models() return 0 # grasp_data = load_pickle(GRASP_DATA_FILE) # for grasp in grasp_data: # for k in grasp[2]: # print len(grasp[2][k][0]) # return # write_index_file() # return 0 #visualize_objs() #return 0 # grasp_data = collect_grasp_data(ki, generate_models=False, skip_grasp=False) # return 0 # process_data() #load_pickle(GRASP_DATA_FILE)) #load_pickle(GRASP_DATA_FILE)) # return 0 #trim_test_data() # return 0 # apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_GRASP_LIST) # resample_split_model_data(apm) # return 0 #split_model_data() #return 0 # print get_grasp_model(0., 0.) # return 0 #grasp_demo() #return 0 #test_random_grasps(250) #return 0 # grasp = calc_model(0.6, 0.0, 0.08) # display_grasp_data([grasp], "accelerometer") # return 0 #global STD_DEV_DICT #xdev = 2.5 #devs = np.linspace(1.5, 4., 18) #fp_rate = [] #test_data = load_pickle(TEST_DATA_FILE) #for dev in devs: # STD_DEV_DICT = {"accelerometer" : [xdev, dev, dev] } # fp = calc_false_pos(test_data=test_data) # print "std dev:", dev # fp_rate += [fp] #print devs #print fp_rate #return 0 #monitor_data = [] #grasp_data = load_data_and_generate(load_pickle(GRASP_DATA_FILE)) #save_pickle(grasp_data, GRASP_DATA_FILE) #grasp_data = load_pickle(GRASP_DATA_FILE) #display_grasp_data(grasp_data[0], "accelerometer", monitor_data=monitor_data, rows=1) #return 0 # print detect_tabletop_objects() # return 0 # sqr_diff_viz() # return 0 # get_setup_pos_angs() # print_configs(load_pickle(GRASP_CONFIGS_FILE)) # save_grasp_configurations() # return 0 # import random # data = load_pickle(GRASP_CONFIGS_FILE) # random.shuffle(data) cm = ControllerManager(armc) apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_GRASP_LIST) #monitor_pressure() #return 0 # while not rospy.is_shutdown(): # x, y, z = get_laser_dclick(cm.tf_listener) # if x > 0.92 and z > 0.04: # point_head([x, y, z], block = False) # hand_over_object(x, y, z + 0.1, cm, apm) # monitor_pressure() # open_gripper(cm=cm) # return 0 # data = load_pickle(GRASP_CONFIGS_FILE) # new_data = [] # xys = get_xy_list() # for grasp in data: # for xy in xys: # if np.allclose(xy, grasp[0]): # new_data += [grasp] # print "length:", len(new_data) # collect_grasp_data(new_data) # collect_grasp_data(load_pickle(GRASP_CONFIGS_FILE)) # return 0 # trim_bad_grasps("gcb2.pickle") # return 0 # save_current_zeros() # return 0 # test_num_samples() # return 0 # print "Generating data" # grasp_data = load_data_and_generate(load_pickle(GRASP_DATA_FILE)) # save_pickle(grasp_data, GRASP_DATA_FILE) # print "Done generating data" # return 0 # grasp_data = load_pickle(GRASP_MODELS_FILE) #grasp = get_grasp_model(0., 0.) # monitor_data += [grasp_closest_object(0.48, 0.07, cm=cm, apm=apm)] # monitor_data += [grasp_closest_object(grasp_data, 0.48, 0.07, cm=cm, apm=apm)] # grasp_data = load_pickle(GRASP_DATA_FILE) # print grasp_data[0][0] # monitor_data = perform_template_grasp(grasp_data[0]) # display_grasp_data(grasp_data, "accelerometer", monitor_data=monitor_data, rows=1) # display_grasp_data(grasp_data, "r_finger_periph_pressure", rows=1) # monitor_data = perform_grasp(grasp_data, .58, .14, gripper_rot = 0.) open_gripper(cm = cm) monitor_data = [] monitor_zeros = [] grasps = [] collided_list = [] num_grasps = 100 num_collided = 0 zeros = None global z_sum z_sum = {} for i in range(num_grasps): point_head([0.5, 0.0, -0.2], block=False) #move_to_setup(cm) if rospy.is_shutdown(): break #x, y, rot = random.uniform(.45, .65), random.uniform(-.2, .2), random.uniform(0., 3.14) if False: #rot = 0. #global STD_DEV_DICT #STD_DEV_DICT = None if False: x, y, rot = random_grasp() else: x, y, rot = random_known_grasp() (grasp, monitor, collided, zeros) = perform_grasp(x, y, gripper_rot = rot, collide=True, is_grasp = False, #grasp_data = grasp_data, zeros=zeros, cm=cm, apm=apm) elif False: x, y = 0.5, 0.0 (obj, grasp, monitor, collided, zeros) = grasp_closest_object(x, y, collide=True, zeros=zeros, cm=cm, apm=apm) rospy.sleep(0.3) if is_obj_in_gripper(cm): x, y, rot = random_grasp() perform_grasp(x, y, gripper_rot=rot, zeros = zeros, collide=True, is_place=True, cm=cm, apm=apm) else: obj = None while obj is None: x, y, z = get_laser_dclick(cm.tf_listener) (obj, grasp, monitor, collided, zeros) = grasp_closest_object(x, y, collide=True, zeros=zeros, cm=cm, apm=apm) x, y, z = get_laser_dclick(cm.tf_listener) print " X Y Z" print x, y, z if x > 0.92 and z > 0.04: point_head([x, y, z], block = False) hand_over_object(x, y, z + 0.1, cm, apm) monitor_pressure() open_gripper(cm=cm) else: perform_grasp(x, y, gripper_rot=obj[1], zeros = zeros, collide=True, is_place=True, cm=cm, apm=apm) move_to_setup(cm, blocking = False) grasps += [grasp] monitor_data += [monitor] collided_list += [collided] monitor_zeros += [zeros] if collided: print "COLLIDED" print "COLLIDED" print "COLLIDED" num_collided += 1 rospy.sleep(2.0) if ki.kbhit(): if PERCEPT_GRASP_LIST is None: percept = "joint_efforts" else: percept = PERCEPT_GRASP_LIST[0] display_grasp_data(grasps[-3:], percept, monitor_data=monitor_data[-3:], monitor_zeros=monitor_zeros[-3:]) # print monitor_data[-3:] break print "Accuracy: %d collisions out of %d grasps (%1.2f)" % (num_collided, num_grasps, 1. - float(num_collided) / num_grasps) test_data = [grasps, monitor_data, collided_list] for k in z_sum: print z_sum[k] / num_grasps return 0 save_pickle(test_data, "test_runs.pickle") # if False: # new_grasp = get_grasp_model(x+.05, y) # if new_grasp is not None: # grasps += [new_grasp] # new_grasp = get_grasp_model(x-.05, y) # if new_grasp is not None: # grasps += [new_grasp] # new_grasp = get_grasp_model(x, y+.05) # if new_grasp is not None: # grasps += [new_grasp] # new_grasp = get_grasp_model(x, y-.05) # if new_grasp is not None: # grasps += [new_grasp] # new_monitor_data = [] # for j in range(len(monitor_data)): # ret_mon = [] # for i in range(len(monitor_data[j]["accelerometer"])): # ret_mon += [np.sqrt(monitor_data[j]["accelerometer"][i][1] ** 2 + monitor_data[j]["accelerometer"][i][2] ** 2)] # new_monitor_data += [np.array(ret_mon)] # for i in range(3000): # monitor_data[0]["accelerometer"][i][1] = new_monitor_data[0][i] - new_monitor_data[1][i] # monitor_data[1]["accelerometer"][i][1] = 0. # monitor_data[2]["accelerometer"][i][1] = 0. # monitor_data += [perform_grasp(grasp_data, .55, .15, gripper_rot = 0., is_place=True)] # monitor_data += [perform_grasp(grasp_data, .56, .10, gripper_rot = 0.)] # monitor_data += [perform_grasp(grasp_data, .57, .10, gripper_rot = 0.)] # monitor_data += [perform_grasp(grasp_data, .58, .10, gripper_rot = 0.)] # for i in range(2): # monitor_data += [perform_grasp(grasp_data, .55, .10, gripper_rot = 0., cm=cm, apm=apm)] # monitor_data += [perform_grasp(grasp_data, .55, .15, gripper_rot = 0., is_place=True, cm=cm, apm=apm)] # monitor_data += [perform_grasp(grasp_data, .55, .15, gripper_rot = 0., cm=cm, apm=apm)] # monitor_data += [perform_grasp(grasp_data, .55, .10, gripper_rot = 0., is_place=True, cm=cm, apm=apm)] # monitor_data += [perform_grasp(grasp_data, .55, .10, z=HOVER_Z-0.14, gripper_rot = 0., is_place=False, cm=cm, apm=apm)] display_grasp_data(grasps, "accelerometer", monitor_data=monitor_data) raw_input() open_gripper(cm=cm) # test_monitor(load_pickle(GRASP_DATA_FILE)) return 0 if __name__ == "__main__": sys.exit(main())
ajibawa-2023/Python-Code-Large/train/row_99294
959
1,752
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Import_L2_C0", "label": "numpy import np, math", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0011, 0.0006, 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_99294:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0017, 0.0006, 0, 0.66, 0.0077, 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_99294:Import_L4_C0", "label": "os import os", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0023, 0.0006, 0, 0.66, 0.0154, 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_99294:ImportFrom_L5_C0", "label": "from threading import RLock", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0029, 0.0006, 0, 0.66, 0.0231, 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_99294:Import_L6_C0", "label": "threading import threading", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0034, 0.0006, 0, 0.66, 0.0308, 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_99294:Import_L8_C0", "label": "roslib import roslib", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0046, 0.0006, 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('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L8_C15", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0046, 0.0006, 0, 0.66, 0.0462, 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_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Import_L9_C0", "label": "rospy import rospy", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0051, 0.0006, 0, 0.66, 0.0538, 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_99294:Import_L11_C0", "label": "actionlib import actionlib", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0063, 0.0006, 0, 0.66, 0.0615, 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_99294:ImportFrom_L13_C0", "label": "from std_msgs.msg import String", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0074, 0.0006, 0, 0.66, 0.0692, 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_99294:ImportFrom_L14_C0", "label": "from geometry_msgs.msg import Point, Pose, Quaternion\u2026", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.008, 0.0006, 0, 0.66, 0.0769, 951, 0, 5, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Point", "Pose", "Quaternion", "PoseStamped", "PointStamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Point, Pose, Quaternion, PoseStamped, PointStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Import_L16_C0", "label": "random import random", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0091, 0.0006, 0, 0.66, 0.0846, 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_99294:Import_L17_C0", "label": "hrl_lib.util import hrl_lib.util", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0097, 0.0006, 0, 0.66, 0.0923, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["hrl_lib.util"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:ImportFrom_L18_C0", "label": "from hrl_lib.rutils import GenericListener", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0103, 0.0006, 0, 0.66, 0.1, 847, 0, 1, 0, 0, 847, 0, 0], "semantic": {"name": "hrl_lib.rutils", "arg_names": [], "import_names": ["GenericListener"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_lib.rutils import GenericListener"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Import_L19_C0", "label": "hrl_lib.viz import viz", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0108, 0.0006, 0, 0.66, 0.1077, 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_99294:ImportFrom_L20_C0", "label": "from hrl_lib import tf_utils", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0114, 0.0006, 0, 0.66, 0.1154, 649, 0, 1, 0, 0, 649, 0, 0], "semantic": {"name": "hrl_lib", "arg_names": [], "import_names": ["tf_utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_lib import tf_utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:ImportFrom_L21_C0", "label": "from hrl_lib.keyboard_input import KeyboardInput", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.012, 0.0006, 0, 0.66, 0.1231, 339, 0, 1, 0, 0, 339, 0, 0], "semantic": {"name": "hrl_lib.keyboard_input", "arg_names": [], "import_names": ["KeyboardInput"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_lib.keyboard_input import KeyboardInput"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:ImportFrom_L22_C0", "label": "from hrl_lib.transforms import rotX, rotY, rotZ", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0126, 0.0006, 0, 0.66, 0.1308, 82, 0, 3, 0, 0, 82, 0, 0], "semantic": {"name": "hrl_lib.transforms", "arg_names": [], "import_names": ["rotX", "rotY", "rotZ"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_lib.transforms import rotX, rotY, rotZ"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:ImportFrom_L23_C0", "label": "from hrl_lib.data_process import signal_list_variance", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.0131, 0.0006, 0, 0.66, 0.1385, 424, 0, 1, 0, 0, 424, 0, 0], "semantic": {"name": "hrl_lib.data_process", "arg_names": [], "import_names": ["signal_list_variance"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_lib.data_process import signal_list_variance"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:ImportFrom_L24_C0", "label": "from tf.transformations import *", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0137, 0.0006, 0, 0.66, 0.1462, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from tf.transformations import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:ImportFrom_L25_C0", "label": "from hrl_pr2_lib.pr2_arms import PR2Arms", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.0143, 0.0006, 0, 0.66, 0.1538, 359, 0, 1, 0, 0, 359, 0, 0], "semantic": {"name": "hrl_pr2_lib.pr2_arms", "arg_names": [], "import_names": ["PR2Arms"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_pr2_lib.pr2_arms import PR2Arms"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:ImportFrom_L26_C0", "label": "from hrl_pr2_lib.perception_monitor import ArmPerceptionMonitor, generate_mean_grasp", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.0148, 0.0006, 0, 0.66, 0.1615, 727, 0, 2, 0, 0, 727, 0, 0], "semantic": {"name": "hrl_pr2_lib.perception_monitor", "arg_names": [], "import_names": ["ArmPerceptionMonitor", "generate_mean_grasp"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_pr2_lib.perception_monitor import ArmPerceptionMonitor, generate_mean_grasp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:ImportFrom_L27_C0", "label": "from visualization_msgs.msg import MarkerArray, Marker", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.0154, 0.0006, 0, 0.66, 0.1692, 124, 0, 2, 0, 0, 124, 0, 0], "semantic": {"name": "visualization_msgs.msg", "arg_names": [], "import_names": ["MarkerArray", "Marker"], "rhs_call_name": "", "annotation": ""}, "snippet": "from visualization_msgs.msg import MarkerArray, Marker"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Import_L28_C0", "label": "dynamic_reconfigure.client import dynamic_reconfigure.client", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.016, 0.0006, 0, 0.66, 0.1769, 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_99294:Import_L29_C0", "label": "tf import tf", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.0166, 0.0006, 0, 0.66, 0.1846, 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_99294:ImportFrom_L32_C0", "label": "from hrl_pr2_lib.hrl_controller_manager import ControllerManager", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.0183, 0.0006, 0, 0.66, 0.1923, 22, 0, 1, 0, 0, 22, 0, 0], "semantic": {"name": "hrl_pr2_lib.hrl_controller_manager", "arg_names": [], "import_names": ["ControllerManager"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_pr2_lib.hrl_controller_manager import HRLControllerManager as ControllerManager"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:ImportFrom_L33_C0", "label": "from pr2_controllers_msgs.msg import JointTrajectoryGoal, PointHeadAction, PointHeadGoal", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.0188, 0.0006, 0, 0.66, 0.2, 457, 0, 3, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["JointTrajectoryGoal", "PointHeadAction", "PointHeadGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import JointTrajectoryGoal, PointHeadAction, PointHeadGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Import_L34_C0", "label": "object_manipulator.convert_functions import cf", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0194, 0.0006, 0, 0.66, 0.2077, 7, 0, 1, 0, 0, 7, 0, 0], "semantic": {"name": "object_manipulator.convert_functions", "arg_names": [], "import_names": ["cf"], "rhs_call_name": "", "annotation": ""}, "snippet": "import object_manipulator.convert_functions as cf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:ImportFrom_L35_C0", "label": "from object_manipulator.cluster_bounding_box_finder import ClusterBoundingBoxFinder", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.02, 0.0006, 0, 0.66, 0.2154, 173, 0, 1, 0, 0, 173, 0, 0], "semantic": {"name": "object_manipulator.cluster_bounding_box_finder", "arg_names": [], "import_names": ["ClusterBoundingBoxFinder"], "rhs_call_name": "", "annotation": ""}, "snippet": "from object_manipulator.cluster_bounding_box_finder import ClusterBoundingBoxFinder"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:ImportFrom_L36_C0", "label": "from tabletop_object_detector.srv import TabletopDetection", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.0205, 0.0006, 0, 0.66, 0.2231, 763, 0, 1, 0, 0, 763, 0, 0], "semantic": {"name": "tabletop_object_detector.srv", "arg_names": [], "import_names": ["TabletopDetection"], "rhs_call_name": "", "annotation": ""}, "snippet": "from tabletop_object_detector.srv import TabletopDetection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:ImportFrom_L37_C0", "label": "from tabletop_object_detector.msg import TabletopDetectionResult", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.0211, 0.0006, 0, 0.66, 0.2308, 29, 0, 1, 0, 0, 29, 0, 0], "semantic": {"name": "tabletop_object_detector.msg", "arg_names": [], "import_names": ["TabletopDetectionResult"], "rhs_call_name": "", "annotation": ""}, "snippet": "from tabletop_object_detector.msg import TabletopDetectionResult"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:ImportFrom_L39_C0", "label": "from laser_interface.pkg import CURSOR_TOPIC, MOUSE_DOUBLE_CLICK_TOPIC", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.0223, 0.0006, 0, 0.66, 0.2385, 582, 0, 2, 0, 0, 582, 0, 0], "semantic": {"name": "laser_interface.pkg", "arg_names": [], "import_names": ["CURSOR_TOPIC", "MOUSE_DOUBLE_CLICK_TOPIC"], "rhs_call_name": "", "annotation": ""}, "snippet": "from laser_interface.pkg import CURSOR_TOPIC, MOUSE_DOUBLE_CLICK_TOPIC"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L44_C0", "label": "NUM_X =", "type": "assigned_variable", "loc": [44, 44], "level": 0, "parent": null, "vector": [14, 0, 0.0251, 0.0006, 0, 0.66, 0.2462, 637, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUM_X", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUM_X = 7#3#9#7 #4#7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L45_C0", "label": "NUM_Y =", "type": "assigned_variable", "loc": [45, 45], "level": 0, "parent": null, "vector": [14, 0, 0.0257, 0.0006, 0, 0.66, 0.2538, 129, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUM_Y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUM_Y = 11#3#15#9 #4#20"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L46_C0", "label": "NUM_N =", "type": "assigned_variable", "loc": [46, 46], "level": 0, "parent": null, "vector": [14, 0, 0.0263, 0.0006, 0, 0.66, 0.2615, 417, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUM_N", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUM_N = 3 #4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L47_C0", "label": "NUM_ROT =", "type": "assigned_variable", "loc": [47, 47], "level": 0, "parent": null, "vector": [14, 0, 0.0268, 0.0006, 0, 0.66, 0.2692, 591, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUM_ROT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUM_ROT = 6"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L49_C0", "label": "RECT =", "type": "assigned_variable", "loc": [49, 49], "level": 0, "parent": null, "vector": [14, 0, 0.028, 0.0006, 0, 0.66, 0.2769, 714, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "RECT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "RECT = ((0.45, 0.25), (0.70, -0.25))#((0.4, 0.35), (0.8, -0.35))#((0.45, 0.10), (0.65, -0.10))#((0.4, 0.20), (0.7, -0.20))#((0.4, 0.35), (0.8, -0.35)) #((0.55, 0.10), (0.7, -0.10)) #((0.4, -0.77), (0.75, 0.23))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L51_C0", "label": "ARM =", "type": "assigned_variable", "loc": [51, 51], "level": 0, "parent": null, "vector": [14, 0, 0.0291, 0.0006, 0, 0.66, 0.2846, 674, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "ARM", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ARM = 0 # right arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L52_C0", "label": "if", "type": "if", "loc": [52, 55], "level": 0, "parent": null, "vector": [4, 0, 0.0305, 0.0023, 0, 0.66, 0.2923, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if ARM == 0:\n armc = 'r'\nelse:\n armc = 'l'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L53_C4", "label": "armc =", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L52_C0", "vector": [14, 1, 0.0303, 0.0006, 1, 0.52, 0.0, 243, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "armc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " armc = 'r'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L55_C4", "label": "armc =", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L52_C0", "vector": [14, 1, 0.0314, 0.0006, 1, 0.52, 1.0, 243, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "armc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " armc = 'l'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L56_C0", "label": "HOVER_Z =", "type": "assigned_variable", "loc": [56, 56], "level": 0, "parent": null, "vector": [14, 0, 0.032, 0.0006, 0, 0.66, 0.3, 181, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "HOVER_Z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "HOVER_Z = -0.10"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L57_C0", "label": "GRASP_DIST =", "type": "assigned_variable", "loc": [57, 57], "level": 0, "parent": null, "vector": [14, 0, 0.0325, 0.0006, 0, 0.66, 0.3077, 938, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "GRASP_DIST", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "GRASP_DIST = 0.30 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L58_C0", "label": "GRASP_VELOCITY =", "type": "assigned_variable", "loc": [58, 58], "level": 0, "parent": null, "vector": [14, 0, 0.0331, 0.0006, 0, 0.66, 0.3154, 234, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "GRASP_VELOCITY", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "GRASP_VELOCITY = 0.28 # 0.15"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L59_C0", "label": "GRIPPER_POINT = array()", "type": "assigned_variable", "loc": [59, 59], "level": 0, "parent": null, "vector": [14, 0, 0.0337, 0.0006, 0, 0.66, 0.3231, 573, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "GRIPPER_POINT", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": "GRIPPER_POINT = np.array([0.23, 0.0, 0.0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L60_C0", "label": "JOINTS_BIAS =", "type": "assigned_variable", "loc": [60, 60], "level": 0, "parent": null, "vector": [14, 0, 0.0342, 0.0006, 0, 0.66, 0.3308, 285, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "JOINTS_BIAS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "JOINTS_BIAS = [0., -.25, -1., 0., 0., 0.5, 0.]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L61_C0", "label": "BIAS_RADIUS =", "type": "assigned_variable", "loc": [61, 61], "level": 0, "parent": null, "vector": [14, 0, 0.0348, 0.0006, 0, 0.66, 0.3385, 569, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "BIAS_RADIUS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "BIAS_RADIUS = 0.012"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L63_C0", "label": "GRASP_TIME =", "type": "assigned_variable", "loc": [63, 63], "level": 0, "parent": null, "vector": [14, 0, 0.036, 0.0006, 0, 0.66, 0.3462, 950, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "GRASP_TIME", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "GRASP_TIME = 2.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L64_C0", "label": "SETUP_VELOCITY =", "type": "assigned_variable", "loc": [64, 64], "level": 0, "parent": null, "vector": [14, 0, 0.0365, 0.0006, 0, 0.66, 0.3538, 284, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "SETUP_VELOCITY", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SETUP_VELOCITY = 0.4 # 0.15"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L66_C0", "label": "STD_DEV =", "type": "assigned_variable", "loc": [66, 66], "level": 0, "parent": null, "vector": [14, 0, 0.0377, 0.0006, 0, 0.66, 0.3615, 74, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "STD_DEV", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "STD_DEV = 2.3 #3.5 #1.9"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L67_C0", "label": "NOISE_DEV =", "type": "assigned_variable", "loc": [67, 67], "level": 0, "parent": null, "vector": [14, 0, 0.0382, 0.0006, 0, 0.66, 0.3692, 188, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "NOISE_DEV", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NOISE_DEV = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L68_C0", "label": "DETECT_ERROR =", "type": "assigned_variable", "loc": [68, 68], "level": 0, "parent": null, "vector": [14, 0, 0.0388, 0.0006, 0, 0.66, 0.3769, 77, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "DETECT_ERROR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DETECT_ERROR = -0.02"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L69_C0", "label": "STD_DEV_DICT =", "type": "assigned_variable", "loc": [69, 76], "level": 0, "parent": null, "vector": [14, 0, 0.0414, 0.0046, 0, 0.66, 0.3846, 83, 0, 0, 0, 0, 0, 6, 8], "semantic": {"name": "STD_DEV_DICT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "STD_DEV_DICT = { \"accelerometer\" : np.array([2.4, 2.9, 2.9]),\n \"joint_angles\" : np.array([2.8, 2.8, 3.8, 2.8, 400.0, 1.25, 400.0]),\n \"joint_efforts\" : np.array([30.0, 15.0, 11.0, 16.0, 12.0, 3.0, 125.0]),\n \"joint_velocities\" : np.array([3.4, 6.4, 18.4, 3.4, 3.4, 3.4, 3.4]),\n \"r_finger_periph_pressure\" : np.array([60.0]*6), \n \"r_finger_pad_pressure\" : np.array([60.0]*15), \n \"l_finger_periph_pressure\" : np.array([60.0]*6), \n \"l_finger_pad_pressure\" : np.array([60.0]*15) }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L77_C0", "label": "TOL_THRESH_DICT =", "type": "assigned_variable", "loc": [77, 84], "level": 0, "parent": null, "vector": [14, 0, 0.0459, 0.0046, 0, 0.66, 0.3923, 937, 0, 0, 0, 0, 0, 6, 8], "semantic": {"name": "TOL_THRESH_DICT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TOL_THRESH_DICT = { \"accelerometer\" : np.array([0.3, 0.3, 0.3]),\n \"joint_velocities\" : np.array([0.45]*7),\n \"joint_angles\" : np.array([0.05, 0.05, 0.05, 0.05, 0.05, 0.04, 0.05]),\n \"joint_efforts\" : np.array([3.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]),\n \"r_finger_periph_pressure\" : np.array([10.0]*6), \n \"r_finger_pad_pressure\" : np.array([10.0]*15), \n \"l_finger_periph_pressure\" : np.array([10.0]*6), \n \"l_finger_pad_pressure\" : np.array([10.0]*15) }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L85_C0", "label": "PERCEPT_MON_LIST =", "type": "assigned_variable", "loc": [85, 85], "level": 0, "parent": null, "vector": [14, 0, 0.0485, 0.0006, 0, 0.66, 0.4, 181, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "PERCEPT_MON_LIST", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "PERCEPT_MON_LIST = None #[\"accelerometer\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L86_C0", "label": "PERCEPT_GRASP_LIST =", "type": "assigned_variable", "loc": [86, 86], "level": 0, "parent": null, "vector": [14, 0, 0.0491, 0.0006, 0, 0.66, 0.4077, 41, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "PERCEPT_GRASP_LIST", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "PERCEPT_GRASP_LIST = None "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L87_C0", "label": "PRESSURE_LIST =", "type": "assigned_variable", "loc": [87, 90], "level": 0, "parent": null, "vector": [14, 0, 0.0505, 0.0023, 0, 0.66, 0.4154, 225, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "PRESSURE_LIST", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "PRESSURE_LIST =[\"r_finger_periph_pressure\", \n \"r_finger_pad_pressure\", \n \"l_finger_periph_pressure\",\n \"l_finger_pad_pressure\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L93_C0", "label": "MONITOR_WINDOW =", "type": "assigned_variable", "loc": [93, 93], "level": 0, "parent": null, "vector": [14, 0, 0.0531, 0.0006, 0, 0.66, 0.4231, 87, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "MONITOR_WINDOW", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONITOR_WINDOW = 50"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L95_C0", "label": "PICKLES_LOC =", "type": "assigned_variable", "loc": [95, 95], "level": 0, "parent": null, "vector": [14, 0, 0.0542, 0.0006, 0, 0.66, 0.4308, 377, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "PICKLES_LOC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "PICKLES_LOC = \"//src//hrl_pr2_lib//pickles//\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L96_C0", "label": "GRASP_CONFIGS_FILE =", "type": "assigned_variable", "loc": [96, 96], "level": 0, "parent": null, "vector": [14, 0, 0.0548, 0.0006, 0, 0.66, 0.4385, 608, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "GRASP_CONFIGS_FILE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "GRASP_CONFIGS_FILE = \"grasp_configs.pickle\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L97_C0", "label": "GRASP_DATA_FILE =", "type": "assigned_variable", "loc": [97, 97], "level": 0, "parent": null, "vector": [14, 0, 0.0554, 0.0006, 0, 0.66, 0.4462, 891, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "GRASP_DATA_FILE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "GRASP_DATA_FILE = \"grasp_data.pickle\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L98_C0", "label": "GRASP_MODELS_FILE =", "type": "assigned_variable", "loc": [98, 98], "level": 0, "parent": null, "vector": [14, 0, 0.0559, 0.0006, 0, 0.66, 0.4538, 831, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "GRASP_MODELS_FILE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "GRASP_MODELS_FILE = \"grasp_models.pickle\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L99_C0", "label": "GRASP_MODELS_TRIMMED_FILE =", "type": "assigned_variable", "loc": [99, 99], "level": 0, "parent": null, "vector": [14, 0, 0.0565, 0.0006, 0, 0.66, 0.4615, 259, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "GRASP_MODELS_TRIMMED_FILE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "GRASP_MODELS_TRIMMED_FILE = \"grasp_models_trimmed.pickle\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L100_C0", "label": "ZEROS_FILE =", "type": "assigned_variable", "loc": [100, 100], "level": 0, "parent": null, "vector": [14, 0, 0.0571, 0.0006, 0, 0.66, 0.4692, 866, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ZEROS_FILE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ZEROS_FILE = \"current_zeros.pickle\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L101_C0", "label": "SQR_DIFF_MAP =", "type": "assigned_variable", "loc": [101, 101], "level": 0, "parent": null, "vector": [14, 0, 0.0576, 0.0006, 0, 0.66, 0.4769, 703, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SQR_DIFF_MAP", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SQR_DIFF_MAP = \"sqr_diff_map.pickle\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L102_C0", "label": "GRASP_IND_PREFIX =", "type": "assigned_variable", "loc": [102, 102], "level": 0, "parent": null, "vector": [14, 0, 0.0582, 0.0006, 0, 0.66, 0.4846, 186, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "GRASP_IND_PREFIX", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "GRASP_IND_PREFIX = \"model_indexed//grasp_model\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L103_C0", "label": "GRASP_INDEX_FILE =", "type": "assigned_variable", "loc": [103, 103], "level": 0, "parent": null, "vector": [14, 0, 0.0588, 0.0006, 0, 0.66, 0.4923, 587, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "GRASP_INDEX_FILE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "GRASP_INDEX_FILE = \"model_indexed//grasp_model_index.pickle\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L104_C0", "label": "GRASP_DATA_INDEX_FILE =", "type": "assigned_variable", "loc": [104, 104], "level": 0, "parent": null, "vector": [14, 0, 0.0594, 0.0006, 0, 0.66, 0.5, 808, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "GRASP_DATA_INDEX_FILE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "GRASP_DATA_INDEX_FILE = \"data_indexed//grasp_data_index.pickle\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L105_C0", "label": "GRASP_DATA_PREFIX =", "type": "assigned_variable", "loc": [105, 105], "level": 0, "parent": null, "vector": [14, 0, 0.0599, 0.0006, 0, 0.66, 0.5077, 790, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "GRASP_DATA_PREFIX", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "GRASP_DATA_PREFIX = \"data_indexed//grasp_data\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L106_C0", "label": "TEST_DATA_FILE =", "type": "assigned_variable", "loc": [106, 106], "level": 0, "parent": null, "vector": [14, 0, 0.0605, 0.0006, 0, 0.66, 0.5154, 560, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TEST_DATA_FILE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TEST_DATA_FILE = \"test_data.pickle\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L108_C0", "label": "node_name =", "type": "assigned_variable", "loc": [108, 108], "level": 0, "parent": null, "vector": [14, 0, 0.0616, 0.0006, 0, 0.66, 0.5231, 516, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "node_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "node_name = \"simple_grasp_learner\" "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L110_C0", "label": "log", "type": "function", "loc": [110, 111], "level": 0, "parent": null, "vector": [2, 0, 0.0631, 0.0011, 0, 0.66, 0.5308, 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_99294:Expr_L111_C4", "label": "loginfo()", "type": "expression", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L110_C0", "vector": [8, 1, 0.0634, 0.0006, 1, 0.52, 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_99294:FunctionDef_L113_C0", "label": "load_pickle", "type": "function", "loc": [113, 115], "level": 0, "parent": null, "vector": [2, 0, 0.0651, 0.0017, 0, 0.66, 0.5385, 65, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "load_pickle", "arg_names": ["fn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def load_pickle(fn):\n global PACKAGE_LOC\n return hrl_lib.util.load_pickle(PACKAGE_LOC + PICKLES_LOC + fn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L115_C4", "label": "return", "type": "return", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L113_C0", "vector": [13, 1, 0.0656, 0.0006, 1, 0.43, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return hrl_lib.util.load_pickle(PACKAGE_LOC + PICKLES_LOC + fn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L117_C0", "label": "save_pickle", "type": "function", "loc": [117, 119], "level": 0, "parent": null, "vector": [2, 0, 0.0674, 0.0017, 0, 0.66, 0.5462, 390, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": ["p", "fn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def save_pickle(p, fn):\n global PACKAGE_LOC\n hrl_lib.util.save_pickle(p, PACKAGE_LOC + PICKLES_LOC + fn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L119_C4", "label": "save_pickle()", "type": "expression", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L117_C0", "vector": [8, 1, 0.0679, 0.0006, 1, 0.83, 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": " hrl_lib.util.save_pickle(p, PACKAGE_LOC + PICKLES_LOC + fn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L121_C0", "label": "file_exists", "type": "function", "loc": [121, 123], "level": 0, "parent": null, "vector": [2, 0, 0.0696, 0.0017, 0, 0.66, 0.5538, 840, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "file_exists", "arg_names": ["fn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def file_exists(fn):\n global PACKAGE_LOC\n return os.path.exists(PACKAGE_LOC + PICKLES_LOC + fn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L123_C4", "label": "return", "type": "return", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L121_C0", "vector": [13, 1, 0.0702, 0.0006, 1, 0.07, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return os.path.exists(PACKAGE_LOC + PICKLES_LOC + fn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L125_C0", "label": "setup_package_loc", "type": "function", "loc": [125, 129], "level": 0, "parent": null, "vector": [2, 0, 0.0725, 0.0029, 0, 0.66, 0.5615, 396, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "setup_package_loc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def setup_package_loc():\n global PACKAGE_LOC\n import os\n grep = os.popen(\"rospack find hrl_pr2_lib|grep hrl_pr2_lib\")\n PACKAGE_LOC = grep.readlines()[0].rstrip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Import_L127_C4", "label": "os import os", "type": "import", "loc": [127, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L125_C0", "vector": [1, 1, 0.0725, 0.0006, 1, 0.28, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": " import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L128_C4", "label": "grep = popen()", "type": "assigned_variable", "loc": [128, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L125_C0", "vector": [14, 1, 0.0731, 0.0006, 1, 0.28, 0.5, 21, 3, 1, 0, 0, 221, 10, 1], "semantic": {"name": "grep", "arg_names": [], "import_names": [], "rhs_call_name": "popen", "annotation": ""}, "snippet": " grep = os.popen(\"rospack find hrl_pr2_lib|grep hrl_pr2_lib\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L129_C4", "label": "PACKAGE_LOC = rstrip()", "type": "assigned_variable", "loc": [129, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L125_C0", "vector": [14, 1, 0.0736, 0.0006, 1, 0.28, 1.0, 119, 3, 0, 0, 0, 807, 10, 2], "semantic": {"name": "PACKAGE_LOC", "arg_names": [], "import_names": [], "rhs_call_name": "rstrip", "annotation": ""}, "snippet": " PACKAGE_LOC = grep.readlines()[0].rstrip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L131_C0", "label": "save_parameters", "type": "function", "loc": [131, 161], "level": 0, "parent": null, "vector": [2, 0, 0.0833, 0.0177, 0, 0.66, 0.5692, 771, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "save_parameters", "arg_names": ["param_filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def save_parameters(param_filename):\n params = { \"ARM\" : ARM,\n \"NUM_X\" : NUM_X,\n \"NUM_Y\" : NUM_Y,\n \"NUM_N\" : NUM_N,\n \"NUM_ROT\" : NUM_ROT,\n \"RECT\" : RECT,\n \"HOVER_Z\" : HOVER_Z,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L132_C4", "label": "params =", "type": "assigned_variable", "loc": [132, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L131_C0", "vector": [14, 1, 0.0833, 0.0166, 1, 0.2, 0.0, 206, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params = { \"ARM\" : ARM,\n \"NUM_X\" : NUM_X,\n \"NUM_Y\" : NUM_Y,\n \"NUM_N\" : NUM_N,\n \"NUM_ROT\" : NUM_ROT,\n \"RECT\" : RECT,\n \"HOVER_Z\" : HOVER_Z,\n \"GRASP_DIST\" : GRASP_DIST,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L161_C4", "label": "save_pickle()", "type": "expression", "loc": [161, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L131_C0", "vector": [8, 1, 0.0919, 0.0006, 1, 0.2, 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": " save_pickle(params, param_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L163_C0", "label": "load_parameters", "type": "function", "loc": [163, 166], "level": 0, "parent": null, "vector": [2, 0, 0.0939, 0.0023, 0, 0.66, 0.5769, 389, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "load_parameters", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def load_parameters():\n params = load_pickle(param_filename)\n for k in params:\n globals()[k] = params[k]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L164_C4", "label": "params = load_pickle()", "type": "assigned_variable", "loc": [164, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L163_C0", "vector": [14, 1, 0.0936, 0.0006, 1, 0.54, 0.0, 206, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "params", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " params = load_pickle(param_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L165_C4", "label": "for k", "type": "for", "loc": [165, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L163_C0", "vector": [6, 1, 0.0945, 0.0011, 1, 0.54, 1.0, 954, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in params:\n globals()[k] = params[k]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L166_C8", "label": "assign", "type": "assigned_variable", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L165_C4", "vector": [14, 2, 0.0947, 0.0006, 2, 0.25, 0.0, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " globals()[k] = params[k]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L176_C0", "label": "transform_in_frame", "type": "function", "loc": [176, 181], "level": 0, "parent": null, "vector": [2, 0, 0.1019, 0.0034, 0, 0.66, 0.5846, 114, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "transform_in_frame", "arg_names": ["pos", "quat", "off_point"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def transform_in_frame(pos, quat, off_point):\n invquatmat = np.mat(quaternion_matrix(quat))\n invquatmat[0:3,3] = np.mat(pos).T\n trans = np.matrix([off_point[0],off_point[1],off_point[2],1.]).T\n transpos = invquatmat * trans\n return transpos.T.A[0,0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L177_C4", "label": "invquatmat = mat()", "type": "assigned_variable", "loc": [177, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L176_C0", "vector": [14, 1, 0.101, 0.0006, 1, 0.08, 0.0, 275, 3, 1, 0, 0, 882, 10, 2], "semantic": {"name": "invquatmat", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " invquatmat = np.mat(quaternion_matrix(quat))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L178_C4", "label": "assign", "type": "assigned_variable", "loc": [178, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L176_C0", "vector": [14, 1, 0.1016, 0.0006, 1, 0.08, 0.25, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " invquatmat[0:3,3] = np.mat(pos).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L179_C4", "label": "trans =", "type": "assigned_variable", "loc": [179, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L176_C0", "vector": [14, 1, 0.1022, 0.0006, 1, 0.08, 0.5, 786, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "trans", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trans = np.matrix([off_point[0],off_point[1],off_point[2],1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L180_C4", "label": "transpos =", "type": "assigned_variable", "loc": [180, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L176_C0", "vector": [14, 1, 0.1027, 0.0006, 1, 0.08, 0.75, 686, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "transpos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " transpos = invquatmat * trans"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L181_C4", "label": "return", "type": "return", "loc": [181, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L176_C0", "vector": [13, 1, 0.1033, 0.0006, 1, 0.08, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return transpos.T.A[0,0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L189_C0", "label": "get_xyr_list", "type": "function", "loc": [189, 195], "level": 0, "parent": null, "vector": [2, 0, 0.1096, 0.004, 0, 0.66, 0.5923, 986, 0, 0, 1, 0, 0, 0, 3], "semantic": {"name": "get_xyr_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_xyr_list():\n grasp_xyr_list = []\n for x in np.linspace(RECT[0][0], RECT[1][0], NUM_X):\n for y in np.linspace(RECT[0][1], RECT[1][1], NUM_Y):\n for r in np.linspace(0., np.pi, NUM_ROT+1)[0:-1]:\n grasp_xyr_list += [(x,y,r)]\n return grasp_xyr_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L190_C4", "label": "grasp_xyr_list =", "type": "assigned_variable", "loc": [190, 190], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L189_C0", "vector": [14, 1, 0.1084, 0.0006, 1, 0.64, 0.0, 976, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "grasp_xyr_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_xyr_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L191_C4", "label": "for x", "type": "for", "loc": [191, 194], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L189_C0", "vector": [6, 1, 0.1099, 0.0023, 1, 0.64, 0.5, 190, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x in np.linspace(RECT[0][0], RECT[1][0], NUM_X):\n for y in np.linspace(RECT[0][1], RECT[1][1], NUM_Y):\n for r in np.linspace(0., np.pi, NUM_ROT+1)[0:-1]:\n grasp_xyr_list += [(x,y,r)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L192_C8", "label": "for y", "type": "for", "loc": [192, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L191_C4", "vector": [6, 2, 0.1102, 0.0017, 2, 0.62, 0.0, 304, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for y in np.linspace(RECT[0][1], RECT[1][1], NUM_Y):\n for r in np.linspace(0., np.pi, NUM_ROT+1)[0:-1]:\n grasp_xyr_list += [(x,y,r)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L193_C12", "label": "for r", "type": "for", "loc": [193, 194], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L192_C8", "vector": [6, 3, 0.1104, 0.0011, 3, 0.03, 0.0, 436, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for r in np.linspace(0., np.pi, NUM_ROT+1)[0:-1]:\n grasp_xyr_list += [(x,y,r)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L195_C4", "label": "return", "type": "return", "loc": [195, 195], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L189_C0", "vector": [13, 1, 0.1113, 0.0006, 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 grasp_xyr_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L198_C0", "label": "create_gripper_pose", "type": "function", "loc": [198, 204], "level": 0, "parent": null, "vector": [2, 0, 0.1147, 0.004, 0, 0.66, 0.6, 516, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "create_gripper_pose", "arg_names": ["x", "y", "z", "quat"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_gripper_pose(x, y, z, quat):\n point = [x, y, z]\n point = transform_in_frame(point, np.array(quat), -GRIPPER_POINT).tolist()\n pose = point + quat\n goal_pose = cf.create_pose_stamped(pose, \"torso_lift_link\")\n goal_pose.header.stamp = rospy.Time.now()\n return goal_pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L199_C4", "label": "point =", "type": "assigned_variable", "loc": [199, 199], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L198_C0", "vector": [14, 1, 0.1136, 0.0006, 1, 0.75, 0.0, 16, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " point = [x, y, z]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L200_C4", "label": "point = tolist()", "type": "assigned_variable", "loc": [200, 200], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L198_C0", "vector": [14, 1, 0.1142, 0.0006, 1, 0.75, 0.2, 16, 3, 0, 0, 0, 185, 10, 3], "semantic": {"name": "point", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " point = transform_in_frame(point, np.array(quat), -GRIPPER_POINT).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L201_C4", "label": "pose =", "type": "assigned_variable", "loc": [201, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L198_C0", "vector": [14, 1, 0.1147, 0.0006, 1, 0.75, 0.4, 767, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose = point + quat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L202_C4", "label": "goal_pose = create_pose_stamped()", "type": "assigned_variable", "loc": [202, 202], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L198_C0", "vector": [14, 1, 0.1153, 0.0006, 1, 0.75, 0.6, 109, 3, 2, 0, 0, 262, 10, 1], "semantic": {"name": "goal_pose", "arg_names": [], "import_names": [], "rhs_call_name": "create_pose_stamped", "annotation": ""}, "snippet": " goal_pose = cf.create_pose_stamped(pose, \"torso_lift_link\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L203_C4", "label": "goal_pose.header.stamp = now()", "type": "assigned_variable", "loc": [203, 203], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L198_C0", "vector": [14, 1, 0.1159, 0.0006, 1, 0.75, 0.8, 393, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "goal_pose.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " goal_pose.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L204_C4", "label": "return", "type": "return", "loc": [204, 204], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L198_C0", "vector": [13, 1, 0.1164, 0.0006, 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 goal_pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L206_C0", "label": "get_gripper_pose", "type": "function", "loc": [206, 211], "level": 0, "parent": null, "vector": [2, 0, 0.119, 0.0034, 0, 0.66, 0.6077, 508, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "get_gripper_pose", "arg_names": ["gripper_rot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_gripper_pose(gripper_rot):\n gripper_rot = normalize_rot(gripper_rot)\n quat1 = quaternion_about_axis(np.pi/2., (0, 1, 0))\n quat2 = quaternion_about_axis(gripper_rot, (0, 0, 1))\n quat = quaternion_multiply(quat2, quat1)\n return quat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L207_C4", "label": "gripper_rot = normalize_rot()", "type": "assigned_variable", "loc": [207, 207], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L206_C0", "vector": [14, 1, 0.1182, 0.0006, 1, 0.39, 0.0, 541, 3, 1, 0, 0, 27, 10, 1], "semantic": {"name": "gripper_rot", "arg_names": [], "import_names": [], "rhs_call_name": "normalize_rot", "annotation": ""}, "snippet": " gripper_rot = normalize_rot(gripper_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L208_C4", "label": "quat1 = quaternion_about_axis()", "type": "assigned_variable", "loc": [208, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L206_C0", "vector": [14, 1, 0.1187, 0.0006, 1, 0.39, 0.25, 933, 3, 2, 0, 0, 932, 10, 1], "semantic": {"name": "quat1", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_about_axis", "annotation": ""}, "snippet": " quat1 = quaternion_about_axis(np.pi/2., (0, 1, 0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L209_C4", "label": "quat2 = quaternion_about_axis()", "type": "assigned_variable", "loc": [209, 209], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L206_C0", "vector": [14, 1, 0.1193, 0.0006, 1, 0.39, 0.5, 459, 3, 2, 0, 0, 932, 10, 1], "semantic": {"name": "quat2", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_about_axis", "annotation": ""}, "snippet": " quat2 = quaternion_about_axis(gripper_rot, (0, 0, 1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L210_C4", "label": "quat = quaternion_multiply()", "type": "assigned_variable", "loc": [210, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L206_C0", "vector": [14, 1, 0.1199, 0.0006, 1, 0.39, 0.75, 367, 3, 2, 0, 0, 339, 10, 1], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_multiply", "annotation": ""}, "snippet": " quat = quaternion_multiply(quat2, quat1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L211_C4", "label": "return", "type": "return", "loc": [211, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L206_C0", "vector": [13, 1, 0.1204, 0.0006, 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 quat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L213_C0", "label": "create_goal_pose", "type": "function", "loc": [213, 219], "level": 0, "parent": null, "vector": [2, 0, 0.1233, 0.004, 0, 0.66, 0.6154, 758, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "create_goal_pose", "arg_names": ["x", "y", "z", "gripper_pose"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_goal_pose(x, y, z, gripper_pose):\n point = [x, y, z]\n point = transform_in_frame(point, gripper_pose, -GRIPPER_POINT).tolist()\n pose = point + gripper_pose.tolist()\n goal_pose = cf.create_pose_stamped(pose, \"torso_lift_link\")\n goal_pose.header.stamp = rospy.Time.now()\n return goal_pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L214_C4", "label": "point =", "type": "assigned_variable", "loc": [214, 214], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L213_C0", "vector": [14, 1, 0.1221, 0.0006, 1, 0.24, 0.0, 16, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " point = [x, y, z]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L215_C4", "label": "point = tolist()", "type": "assigned_variable", "loc": [215, 215], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L213_C0", "vector": [14, 1, 0.1227, 0.0006, 1, 0.24, 0.2, 16, 3, 0, 0, 0, 185, 10, 2], "semantic": {"name": "point", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " point = transform_in_frame(point, gripper_pose, -GRIPPER_POINT).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L216_C4", "label": "pose =", "type": "assigned_variable", "loc": [216, 216], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L213_C0", "vector": [14, 1, 0.1233, 0.0006, 1, 0.24, 0.4, 767, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose = point + gripper_pose.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L217_C4", "label": "goal_pose = create_pose_stamped()", "type": "assigned_variable", "loc": [217, 217], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L213_C0", "vector": [14, 1, 0.1239, 0.0006, 1, 0.24, 0.6, 109, 3, 2, 0, 0, 262, 10, 1], "semantic": {"name": "goal_pose", "arg_names": [], "import_names": [], "rhs_call_name": "create_pose_stamped", "annotation": ""}, "snippet": " goal_pose = cf.create_pose_stamped(pose, \"torso_lift_link\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L218_C4", "label": "goal_pose.header.stamp = now()", "type": "assigned_variable", "loc": [218, 218], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L213_C0", "vector": [14, 1, 0.1244, 0.0006, 1, 0.24, 0.8, 393, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "goal_pose.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " goal_pose.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L219_C4", "label": "return", "type": "return", "loc": [219, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L213_C0", "vector": [13, 1, 0.125, 0.0006, 1, 0.24, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return goal_pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L221_C0", "label": "move_to_grasp_pos", "type": "function", "loc": [221, 226], "level": 0, "parent": null, "vector": [2, 0, 0.1276, 0.0034, 0, 0.66, 0.6231, 635, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "move_to_grasp_pos", "arg_names": ["cm", "grasp_pose", "block"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def move_to_grasp_pos(cm, grasp_pose, block=True):\n grasp_pose.header.stamp = rospy.Time.now()\n cm.move_cartesian_ik(grasp_pose, collision_aware = False, blocking = block,\n step_size = .005, pos_thres = .02, rot_thres = .1,\n settling_time = rospy.Duration(1.0),\n vel = SETUP_VELOCITY)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L222_C4", "label": "grasp_pose.header.stamp = now()", "type": "assigned_variable", "loc": [222, 222], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L221_C0", "vector": [14, 1, 0.1267, 0.0006, 1, 0.28, 0.0, 814, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "grasp_pose.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " grasp_pose.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L223_C4", "label": "move_cartesian_ik()", "type": "expression", "loc": [223, 226], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L221_C0", "vector": [8, 1, 0.1281, 0.0023, 1, 0.28, 1.0, 685, 3, 8, 0, 0, 0, 0, 2], "semantic": {"name": "move_cartesian_ik", "arg_names": [], "import_names": [], "rhs_call_name": "move_cartesian_ik", "annotation": ""}, "snippet": " cm.move_cartesian_ik(grasp_pose, collision_aware = False, blocking = block,\n step_size = .005, pos_thres = .02, rot_thres = .1,\n settling_time = rospy.Duration(1.0),\n vel = SETUP_VELOCITY)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L228_C0", "label": "upward_lift", "type": "function", "loc": [228, 234], "level": 0, "parent": null, "vector": [2, 0, 0.1318, 0.004, 0, 0.66, 0.6308, 194, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "upward_lift", "arg_names": ["cm", "grasp_pose", "block"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def upward_lift(cm, grasp_pose, block=True):\n grasp_pose.header.stamp = rospy.Time.now()\n cm.move_cartesian_ik(grasp_pose, collision_aware = False, blocking = block,\n step_size = .005, pos_thres = .02, rot_thres = .1,\n settling_time = rospy.Duration(1.0),\n vel = GRASP_VELOCITY,\n joints_bias = -np.array(JOINTS_BIAS), bias_radius = BIAS_RADIUS)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L229_C4", "label": "grasp_pose.header.stamp = now()", "type": "assigned_variable", "loc": [229, 229], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L228_C0", "vector": [14, 1, 0.1307, 0.0006, 1, 0.47, 0.0, 814, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "grasp_pose.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " grasp_pose.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L230_C4", "label": "move_cartesian_ik()", "type": "expression", "loc": [230, 234], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L228_C0", "vector": [8, 1, 0.1324, 0.0029, 1, 0.47, 1.0, 685, 3, 10, 0, 0, 0, 0, 3], "semantic": {"name": "move_cartesian_ik", "arg_names": [], "import_names": [], "rhs_call_name": "move_cartesian_ik", "annotation": ""}, "snippet": " cm.move_cartesian_ik(grasp_pose, collision_aware = False, blocking = block,\n step_size = .005, pos_thres = .02, rot_thres = .1,\n settling_time = rospy.Duration(1.0),\n vel = GRASP_VELOCITY,\n joints_bias = -np.array(JOINTS_BIAS), bias_radius = BIAS_RADIUS)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L236_C0", "label": "downward_grasp", "type": "function", "loc": [236, 242], "level": 0, "parent": null, "vector": [2, 0, 0.1364, 0.004, 0, 0.66, 0.6385, 695, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "downward_grasp", "arg_names": ["cm", "goal_pose", "block"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def downward_grasp(cm, goal_pose, block=True):\n goal_pose.header.stamp = rospy.Time.now()\n return cm.move_cartesian_ik(goal_pose, collision_aware = False, blocking = block,\n step_size = .005, pos_thres = .02, rot_thres = .1,\n settling_time = rospy.Duration(GRASP_TIME),\n joints_bias = JOINTS_BIAS, bias_radius = BIAS_RADIUS,\n vel = GRASP_VELOCITY)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L237_C4", "label": "goal_pose.header.stamp = now()", "type": "assigned_variable", "loc": [237, 237], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L236_C0", "vector": [14, 1, 0.1353, 0.0006, 1, 0.02, 0.0, 393, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "goal_pose.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " goal_pose.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L238_C4", "label": "return", "type": "return", "loc": [238, 242], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L236_C0", "vector": [13, 1, 0.137, 0.0029, 1, 0.02, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cm.move_cartesian_ik(goal_pose, collision_aware = False, blocking = block,\n step_size = .005, pos_thres = .02, rot_thres = .1,\n settling_time = rospy.Duration(GRASP_TIME),\n joints_bias = JOINTS_BIAS, bias_radius = BIAS_RADIUS,\n vel = GRASP_VELOCITY)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L245_C0", "label": "save_grasp_configurations", "type": "function", "loc": [245, 275], "level": 0, "parent": null, "vector": [2, 0, 0.1484, 0.0177, 0, 0.66, 0.6462, 816, 0, 0, 0, 0, 0, 0, 14], "semantic": {"name": "save_grasp_configurations", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def save_grasp_configurations():\n arms = PR2Arms()\n\n grasp_xyr_list = get_xy_list()\n grasp_configs = []\n setup = False\n\n for xy in grasp_xyr_list:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L246_C4", "label": "arms = PR2Arms()", "type": "assigned_variable", "loc": [246, 246], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L245_C0", "vector": [14, 1, 0.1404, 0.0006, 1, 0.58, 0.0, 375, 3, 0, 0, 0, 694, 10, 1], "semantic": {"name": "arms", "arg_names": [], "import_names": [], "rhs_call_name": "PR2Arms", "annotation": ""}, "snippet": " arms = PR2Arms()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L248_C4", "label": "grasp_xyr_list = get_xy_list()", "type": "assigned_variable", "loc": [248, 248], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L245_C0", "vector": [14, 1, 0.1416, 0.0006, 1, 0.58, 0.1429, 976, 3, 0, 0, 0, 247, 10, 1], "semantic": {"name": "grasp_xyr_list", "arg_names": [], "import_names": [], "rhs_call_name": "get_xy_list", "annotation": ""}, "snippet": " grasp_xyr_list = get_xy_list()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L249_C4", "label": "grasp_configs =", "type": "assigned_variable", "loc": [249, 249], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L245_C0", "vector": [14, 1, 0.1421, 0.0006, 1, 0.58, 0.2857, 608, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "grasp_configs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_configs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L250_C4", "label": "setup =", "type": "assigned_variable", "loc": [250, 250], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L245_C0", "vector": [14, 1, 0.1427, 0.0006, 1, 0.58, 0.4286, 234, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "setup", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " setup = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L252_C4", "label": "for xy", "type": "for", "loc": [252, 270], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L245_C0", "vector": [6, 1, 0.149, 0.0108, 1, 0.58, 0.5714, 358, 2, 0, 0, 0, 0, 0, 9], "semantic": {"name": "xy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for xy in grasp_xyr_list:\n# if not setup:\n# # Move to setup position in the middle of the grasp space\n# print \"Setting up\"\n# arms.set_joint_angles(ARM, SETUP_POS_ANGS, 3.)\n# arms.wait_for_arm_completion(ARM)\n# rospy.sleep(0.5)\n# setup = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L261_C8", "label": "if", "type": "if", "loc": [261, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L252_C4", "vector": [4, 2, 0.1515, 0.0057, 2, 0.5, 0.0, 0, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arms.can_move_arm(ARM, [xy[0], xy[1], HOVER_Z], rotY(np.pi / 2.)):\n print(\"Moving to pos (%1.2f, %1.2f)\" % xy)\n arms.grasp_biased_move_arm(ARM, [xy[0], xy[1], HOVER_Z], rotY(np.pi / 2.), 3.)\n arms.wait_for_arm_completion(ARM)\n rospy.sleep(0.5)\n angs = arms.get_joint_angles(ARM)\n grasp_configs += [(xy, angs)]\n setup = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L262_C12", "label": "print()", "type": "expression", "loc": [262, 262], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L261_C8", "vector": [8, 3, 0.1495, 0.0006, 3, 0.04, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Moving to pos (%1.2f, %1.2f)\" % xy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L263_C12", "label": "grasp_biased_move_arm()", "type": "expression", "loc": [263, 263], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L261_C8", "vector": [8, 3, 0.1501, 0.0006, 3, 0.04, 0.1667, 323, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "grasp_biased_move_arm", "arg_names": [], "import_names": [], "rhs_call_name": "grasp_biased_move_arm", "annotation": ""}, "snippet": " arms.grasp_biased_move_arm(ARM, [xy[0], xy[1], HOVER_Z], rotY(np.pi / 2.), 3.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L264_C12", "label": "wait_for_arm_completion()", "type": "expression", "loc": [264, 264], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L261_C8", "vector": [8, 3, 0.1507, 0.0006, 3, 0.04, 0.3333, 431, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_arm_completion", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_arm_completion", "annotation": ""}, "snippet": " arms.wait_for_arm_completion(ARM)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L265_C12", "label": "sleep()", "type": "expression", "loc": [265, 265], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L261_C8", "vector": [8, 3, 0.1513, 0.0006, 3, 0.04, 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_99294:Assign_L266_C12", "label": "angs = get_joint_angles()", "type": "assigned_variable", "loc": [266, 266], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L261_C8", "vector": [14, 3, 0.1518, 0.0006, 3, 0.04, 0.6667, 510, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "angs", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " angs = arms.get_joint_angles(ARM)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L268_C12", "label": "setup =", "type": "assigned_variable", "loc": [268, 268], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L261_C8", "vector": [14, 3, 0.153, 0.0006, 3, 0.04, 0.8333, 234, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "setup", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " setup = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L270_C12", "label": "print()", "type": "expression", "loc": [270, 270], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L261_C8", "vector": [8, 3, 0.1541, 0.0006, 3, 0.04, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Can't move to to pos (%1.2f, %1.2f)\" % xy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L273_C4", "label": "save_pickle()", "type": "expression", "loc": [273, 273], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L245_C0", "vector": [8, 1, 0.1558, 0.0006, 1, 0.58, 0.7143, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " save_pickle(grasp_configs, GRASP_CONFIGS_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L274_C4", "label": "print()", "type": "expression", "loc": [274, 274], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L245_C0", "vector": [8, 1, 0.1564, 0.0006, 1, 0.58, 0.8571, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Configurations:\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L275_C4", "label": "print_configs()", "type": "expression", "loc": [275, 275], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L245_C0", "vector": [8, 1, 0.157, 0.0006, 1, 0.58, 1.0, 576, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print_configs", "arg_names": [], "import_names": [], "rhs_call_name": "print_configs", "annotation": ""}, "snippet": " print_configs(grasp_configs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L277_C0", "label": "print_configs", "type": "function", "loc": [277, 282], "level": 0, "parent": null, "vector": [2, 0, 0.1595, 0.0034, 0, 0.66, 0.6538, 576, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "print_configs", "arg_names": ["grasp_configs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def print_configs(grasp_configs):\n for config in grasp_configs:\n if config[1] is not None:\n print(\"(%1.2f, %1.2f):\" % config[0], \", \".join([\"%1.2f\" % x for x in config[1]]))\n else:\n print(\"(%1.2f, %1.2f):\" % config[0], \"No config\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L278_C4", "label": "for config", "type": "for", "loc": [278, 282], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L277_C0", "vector": [6, 1, 0.1598, 0.0029, 1, 0.88, 0.0, 308, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "config", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for config in grasp_configs:\n if config[1] is not None:\n print(\"(%1.2f, %1.2f):\" % config[0], \", \".join([\"%1.2f\" % x for x in config[1]]))\n else:\n print(\"(%1.2f, %1.2f):\" % config[0], \"No config\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L279_C8", "label": "if", "type": "if", "loc": [279, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L278_C4", "vector": [4, 2, 0.1601, 0.0023, 2, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if config[1] is not None:\n print(\"(%1.2f, %1.2f):\" % config[0], \", \".join([\"%1.2f\" % x for x in config[1]]))\n else:\n print(\"(%1.2f, %1.2f):\" % config[0], \"No config\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L280_C12", "label": "print()", "type": "expression", "loc": [280, 280], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L279_C8", "vector": [8, 3, 0.1598, 0.0006, 3, 0.07, 0.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"(%1.2f, %1.2f):\" % config[0], \", \".join([\"%1.2f\" % x for x in config[1]]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L282_C12", "label": "print()", "type": "expression", "loc": [282, 282], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L279_C8", "vector": [8, 3, 0.161, 0.0006, 3, 0.07, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"(%1.2f, %1.2f):\" % config[0], \"No config\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L284_C0", "label": "trim_bad_grasps", "type": "function", "loc": [284, 292], "level": 0, "parent": null, "vector": [2, 0, 0.1644, 0.0051, 0, 0.66, 0.6615, 701, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "trim_bad_grasps", "arg_names": ["filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def trim_bad_grasps(filename):\n grasp_configs = load_pickle(filename)\n print_configs(grasp_configs)\n new_configs = []\n for config in grasp_configs:\n if config[1] is not None:\n new_configs += [config]\n print_configs(new_configs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L285_C4", "label": "grasp_configs = load_pickle()", "type": "assigned_variable", "loc": [285, 285], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L284_C0", "vector": [14, 1, 0.1627, 0.0006, 1, 0.94, 0.0, 608, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "grasp_configs", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " grasp_configs = load_pickle(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L286_C4", "label": "print_configs()", "type": "expression", "loc": [286, 286], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L284_C0", "vector": [8, 1, 0.1632, 0.0006, 1, 0.94, 0.2, 576, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print_configs", "arg_names": [], "import_names": [], "rhs_call_name": "print_configs", "annotation": ""}, "snippet": " print_configs(grasp_configs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L287_C4", "label": "new_configs =", "type": "assigned_variable", "loc": [287, 287], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L284_C0", "vector": [14, 1, 0.1638, 0.0006, 1, 0.94, 0.4, 727, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "new_configs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_configs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L288_C4", "label": "for config", "type": "for", "loc": [288, 290], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L284_C0", "vector": [6, 1, 0.165, 0.0017, 1, 0.94, 0.6, 308, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "config", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for config in grasp_configs:\n if config[1] is not None:\n new_configs += [config]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L289_C8", "label": "if", "type": "if", "loc": [289, 290], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L288_C4", "vector": [4, 2, 0.1652, 0.0011, 2, 0.89, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if config[1] is not None:\n new_configs += [config]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L291_C4", "label": "print_configs()", "type": "expression", "loc": [291, 291], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L284_C0", "vector": [8, 1, 0.1661, 0.0006, 1, 0.94, 0.8, 576, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print_configs", "arg_names": [], "import_names": [], "rhs_call_name": "print_configs", "annotation": ""}, "snippet": " print_configs(new_configs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L292_C4", "label": "save_pickle()", "type": "expression", "loc": [292, 292], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L284_C0", "vector": [8, 1, 0.1667, 0.0006, 1, 0.94, 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": " save_pickle(new_configs, filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L294_C0", "label": "pauser", "type": "function", "loc": [294, 302], "level": 0, "parent": null, "vector": [2, 0, 0.1701, 0.0051, 0, 0.66, 0.6692, 777, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "pauser", "arg_names": ["ki"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pauser(ki):\n if ki.kbhit():\n ch = ki.getch()\n if ch == 'p':\n print(\"PAUSED\")\n while not rospy.is_shutdown() and ch != 'c':\n ch = ki.getch()\n rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L295_C4", "label": "if", "type": "if", "loc": [295, 302], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L294_C0", "vector": [4, 1, 0.1704, 0.0046, 1, 0.37, 0.0, 0, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ki.kbhit():\n ch = ki.getch()\n if ch == 'p':\n print(\"PAUSED\")\n while not rospy.is_shutdown() and ch != 'c':\n ch = ki.getch()\n rospy.sleep(0.1)\n print(\"CONTINUING\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L296_C8", "label": "ch = getch()", "type": "assigned_variable", "loc": [296, 296], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L295_C4", "vector": [14, 2, 0.1689, 0.0006, 2, 0.49, 0.0, 263, 3, 0, 0, 0, 32, 10, 1], "semantic": {"name": "ch", "arg_names": [], "import_names": [], "rhs_call_name": "getch", "annotation": ""}, "snippet": " ch = ki.getch()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L297_C8", "label": "if", "type": "if", "loc": [297, 302], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L295_C4", "vector": [4, 2, 0.1709, 0.0034, 2, 0.49, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ch == 'p':\n print(\"PAUSED\")\n while not rospy.is_shutdown() and ch != 'c':\n ch = ki.getch()\n rospy.sleep(0.1)\n print(\"CONTINUING\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L298_C12", "label": "print()", "type": "expression", "loc": [298, 298], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L297_C8", "vector": [8, 3, 0.1701, 0.0006, 3, 0.2, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"PAUSED\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L299_C12", "label": "while", "type": "while", "loc": [299, 301], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L297_C8", "vector": [5, 3, 0.1712, 0.0017, 3, 0.2, 0.5, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown() and ch != 'c':\n ch = ki.getch()\n rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L300_C16", "label": "ch = getch()", "type": "assigned_variable", "loc": [300, 300], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L299_C12", "vector": [14, 4, 0.1712, 0.0006, 4, 0.8, 0.0, 263, 3, 0, 0, 0, 32, 10, 1], "semantic": {"name": "ch", "arg_names": [], "import_names": [], "rhs_call_name": "getch", "annotation": ""}, "snippet": " ch = ki.getch()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L301_C16", "label": "sleep()", "type": "expression", "loc": [301, 301], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L299_C12", "vector": [8, 4, 0.1718, 0.0006, 4, 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_99294:Expr_L302_C12", "label": "print()", "type": "expression", "loc": [302, 302], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L297_C8", "vector": [8, 3, 0.1724, 0.0006, 3, 0.2, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"CONTINUING\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L304_C0", "label": "write_index_file", "type": "function", "loc": [304, 311], "level": 0, "parent": null, "vector": [2, 0, 0.1755, 0.0046, 0, 0.66, 0.6769, 416, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "write_index_file", "arg_names": ["prefix", "index"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def write_index_file(prefix = GRASP_DATA_PREFIX, index = GRASP_DATA_INDEX_FILE):\n grasp_xyr_list = get_xyr_list()\n grasps = []\n for xyr in grasp_xyr_list:\n filename = prefix + \"%04d-%04d-%04d.pickle\" % (int(xyr[0]*100),int(xyr[1]*100),int(xyr[2]*100))\n if file_exists(filename):\n grasps.append([xyr, filename])\n save_pickle(grasps, index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L305_C4", "label": "grasp_xyr_list = get_xyr_list()", "type": "assigned_variable", "loc": [305, 305], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L304_C0", "vector": [14, 1, 0.1741, 0.0006, 1, 0.89, 0.0, 976, 3, 0, 0, 0, 986, 10, 1], "semantic": {"name": "grasp_xyr_list", "arg_names": [], "import_names": [], "rhs_call_name": "get_xyr_list", "annotation": ""}, "snippet": " grasp_xyr_list = get_xyr_list()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L306_C4", "label": "grasps =", "type": "assigned_variable", "loc": [306, 306], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L304_C0", "vector": [14, 1, 0.1747, 0.0006, 1, 0.89, 0.3333, 384, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "grasps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasps = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L307_C4", "label": "for xyr", "type": "for", "loc": [307, 310], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L304_C0", "vector": [6, 1, 0.1761, 0.0023, 1, 0.89, 0.6667, 90, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "xyr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for xyr in grasp_xyr_list:\n filename = prefix + \"%04d-%04d-%04d.pickle\" % (int(xyr[0]*100),int(xyr[1]*100),int(xyr[2]*100))\n if file_exists(filename):\n grasps.append([xyr, filename])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L308_C8", "label": "filename =", "type": "assigned_variable", "loc": [308, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L307_C4", "vector": [14, 2, 0.1758, 0.0006, 2, 0.86, 0.0, 275, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filename = prefix + \"%04d-%04d-%04d.pickle\" % (int(xyr[0]*100),int(xyr[1]*100),int(xyr[2]*100))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L309_C8", "label": "if", "type": "if", "loc": [309, 310], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L307_C4", "vector": [4, 2, 0.1767, 0.0011, 2, 0.86, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if file_exists(filename):\n grasps.append([xyr, filename])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L310_C12", "label": "append()", "type": "expression", "loc": [310, 310], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L309_C8", "vector": [8, 3, 0.1769, 0.0006, 3, 0.29, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " grasps.append([xyr, filename])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L311_C4", "label": "save_pickle()", "type": "expression", "loc": [311, 311], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L304_C0", "vector": [8, 1, 0.1775, 0.0006, 1, 0.89, 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": " save_pickle(grasps, index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "label": "collect_grasp_data", "type": "function", "loc": [313, 397], "level": 0, "parent": null, "vector": [2, 0, 0.2026, 0.0485, 0, 0.66, 0.6846, 957, 0, 3, 1, 0, 0, 0, 46], "semantic": {"name": "collect_grasp_data", "arg_names": ["ki", "generate_models", "skip_grasp"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def collect_grasp_data(ki, generate_models=False, skip_grasp=False):\n cm = ControllerManager(armc)\n apm = ArmPerceptionMonitor(ARM, tf_listener=cm.tf_listener, percept_mon_list=None)\n\n # if restart:\n # grasp_data = load_pickle(GRASP_DATA)\n # grasp_xyr_list = zip(*grasp_data)[0]\n # else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L314_C4", "label": "cm = ControllerManager()", "type": "assigned_variable", "loc": [314, 314], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "vector": [14, 1, 0.1792, 0.0006, 1, 0.79, 0.0, 675, 3, 1, 0, 0, 16, 10, 1], "semantic": {"name": "cm", "arg_names": [], "import_names": [], "rhs_call_name": "ControllerManager", "annotation": ""}, "snippet": " cm = ControllerManager(armc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L315_C4", "label": "apm = ArmPerceptionMonitor()", "type": "assigned_variable", "loc": [315, 315], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "vector": [14, 1, 0.1798, 0.0006, 1, 0.79, 0.0833, 21, 3, 3, 0, 0, 815, 10, 1], "semantic": {"name": "apm", "arg_names": [], "import_names": [], "rhs_call_name": "ArmPerceptionMonitor", "annotation": ""}, "snippet": " apm = ArmPerceptionMonitor(ARM, tf_listener=cm.tf_listener, percept_mon_list=None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L323_C4", "label": "grasp_xyr_list = get_xyr_list()", "type": "assigned_variable", "loc": [323, 323], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "vector": [14, 1, 0.1844, 0.0006, 1, 0.79, 0.1667, 976, 3, 0, 0, 0, 986, 10, 1], "semantic": {"name": "grasp_xyr_list", "arg_names": [], "import_names": [], "rhs_call_name": "get_xyr_list", "annotation": ""}, "snippet": " grasp_xyr_list = get_xyr_list()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L324_C4", "label": "grasp_data =", "type": "assigned_variable", "loc": [324, 324], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "vector": [14, 1, 0.1849, 0.0006, 1, 0.79, 0.25, 717, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "grasp_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_data = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L325_C4", "label": "grasp_index =", "type": "assigned_variable", "loc": [325, 325], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "vector": [14, 1, 0.1855, 0.0006, 1, 0.79, 0.3333, 291, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "grasp_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_index = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L327_C4", "label": "print()", "type": "expression", "loc": [327, 327], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "vector": [8, 1, 0.1866, 0.0006, 1, 0.79, 0.4167, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Opening gripper\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L328_C4", "label": "command_gripper()", "type": "expression", "loc": [328, 328], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "vector": [8, 1, 0.1872, 0.0006, 1, 0.79, 0.5, 250, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "command_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "command_gripper", "annotation": ""}, "snippet": " cm.command_gripper(0.08, -1.0, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L329_C4", "label": "wait_for_result()", "type": "expression", "loc": [329, 329], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "vector": [8, 1, 0.1878, 0.0006, 1, 0.79, 0.5833, 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": " cm.gripper_action_client.wait_for_result(rospy.Duration(4.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L331_C4", "label": "for c, xyr", "type": "for", "loc": [331, 391], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "vector": [6, 1, 0.2061, 0.0348, 1, 0.79, 0.6667, 510, 3, 0, 0, 0, 0, 0, 36], "semantic": {"name": "c, xyr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for c, xyr in enumerate(grasp_xyr_list):\n # if c < 257:\n # continue\n if rospy.is_shutdown():\n return\n print(\"---------------------------------------------------\")\n print(\"%1.2f completion\" % (float(c) / len(grasp_xyr_list)))\n zeros = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L334_C8", "label": "if", "type": "if", "loc": [334, 335], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L331_C4", "vector": [4, 2, 0.1909, 0.0011, 2, 0.78, 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 return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L335_C12", "label": "return", "type": "return", "loc": [335, 335], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L334_C8", "vector": [13, 3, 0.1912, 0.0006, 3, 0.62, 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_99294:Expr_L336_C8", "label": "print()", "type": "expression", "loc": [336, 336], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L331_C4", "vector": [8, 2, 0.1918, 0.0006, 2, 0.78, 0.1, 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_99294:Expr_L337_C8", "label": "print()", "type": "expression", "loc": [337, 337], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L331_C4", "vector": [8, 2, 0.1924, 0.0006, 2, 0.78, 0.2, 535, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"%1.2f completion\" % (float(c) / len(grasp_xyr_list)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L338_C8", "label": "zeros =", "type": "assigned_variable", "loc": [338, 338], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L331_C4", "vector": [14, 2, 0.1929, 0.0006, 2, 0.78, 0.3, 213, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "zeros", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " zeros = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L340_C8", "label": "for i", "type": "for", "loc": [340, 374], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L331_C4", "vector": [6, 2, 0.2038, 0.02, 2, 0.78, 0.4, 826, 3, 0, 0, 0, 0, 0, 25], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(NUM_N):\n pauser(ki)\n\n # Move to grasp position\n print(\"Moving to grasp position (%1.2f, %1.2f, %1.2f)\" % xyr)\n grasp_pose = create_goal_pose(xyr[0], xyr[1], HOVER_Z, get_gripper_pose(xyr[2]))\n setup_result = cm.move_arm_pose_biased(grasp_pose, JOINTS_BIAS, SETUP_VELOCITY, \n blocking = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L341_C12", "label": "pauser()", "type": "expression", "loc": [341, 341], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L340_C8", "vector": [8, 3, 0.1946, 0.0006, 3, 0.43, 0.0, 777, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "pauser", "arg_names": [], "import_names": [], "rhs_call_name": "pauser", "annotation": ""}, "snippet": " pauser(ki)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L344_C12", "label": "print()", "type": "expression", "loc": [344, 344], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L340_C8", "vector": [8, 3, 0.1963, 0.0006, 3, 0.43, 0.1667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Moving to grasp position (%1.2f, %1.2f, %1.2f)\" % xyr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L345_C12", "label": "grasp_pose = create_goal_pose()", "type": "assigned_variable", "loc": [345, 345], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L340_C8", "vector": [14, 3, 0.1969, 0.0006, 3, 0.43, 0.3333, 752, 3, 4, 0, 0, 758, 10, 2], "semantic": {"name": "grasp_pose", "arg_names": [], "import_names": [], "rhs_call_name": "create_goal_pose", "annotation": ""}, "snippet": " grasp_pose = create_goal_pose(xyr[0], xyr[1], HOVER_Z, get_gripper_pose(xyr[2]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L346_C12", "label": "setup_result = move_arm_pose_biased()", "type": "assigned_variable", "loc": [346, 347], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L340_C8", "vector": [14, 3, 0.1978, 0.0011, 3, 0.43, 0.5, 762, 3, 4, 0, 0, 84, 10, 1], "semantic": {"name": "setup_result", "arg_names": [], "import_names": [], "rhs_call_name": "move_arm_pose_biased", "annotation": ""}, "snippet": " setup_result = cm.move_arm_pose_biased(grasp_pose, JOINTS_BIAS, SETUP_VELOCITY, \n blocking = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L348_C12", "label": "sleep()", "type": "expression", "loc": [348, 348], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L340_C8", "vector": [8, 3, 0.1986, 0.0006, 3, 0.43, 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(0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L349_C12", "label": "if", "type": "if", "loc": [349, 350], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L340_C8", "vector": [4, 3, 0.1995, 0.0011, 3, 0.43, 0.8333, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if skip_grasp:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "label": "if", "type": "if", "loc": [351, 374], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L340_C8", "vector": [4, 3, 0.2069, 0.0137, 3, 0.43, 1.0, 0, 0, 0, 0, 0, 0, 0, 18], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if setup_result is not None:\n if zeros is None:\n # wait for a bit to get the zeros here\n rospy.sleep(0.5)\n zeros = apm.get_zeros(0.6)\n\n goal_pose = create_goal_pose(xyr[0], xyr[1], \n HOVER_Z - GRASP_DIST, get_gripper_pose(xyr[2]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L352_C16", "label": "if", "type": "if", "loc": [352, 355], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "vector": [4, 4, 0.2018, 0.0023, 4, 0.76, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if zeros is None:\n # wait for a bit to get the zeros here\n rospy.sleep(0.5)\n zeros = apm.get_zeros(0.6)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L354_C20", "label": "sleep()", "type": "expression", "loc": [354, 354], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L352_C16", "vector": [8, 5, 0.2021, 0.0006, 5, 0.4, 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.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L355_C20", "label": "zeros = get_zeros()", "type": "assigned_variable", "loc": [355, 355], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L352_C16", "vector": [14, 5, 0.2026, 0.0006, 5, 0.4, 1.0, 213, 3, 1, 0, 0, 264, 10, 1], "semantic": {"name": "zeros", "arg_names": [], "import_names": [], "rhs_call_name": "get_zeros", "annotation": ""}, "snippet": " zeros = apm.get_zeros(0.6)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L357_C16", "label": "goal_pose = create_goal_pose()", "type": "assigned_variable", "loc": [357, 358], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "vector": [14, 4, 0.2041, 0.0011, 4, 0.76, 0.0769, 109, 3, 4, 0, 0, 758, 10, 2], "semantic": {"name": "goal_pose", "arg_names": [], "import_names": [], "rhs_call_name": "create_goal_pose", "annotation": ""}, "snippet": " goal_pose = create_goal_pose(xyr[0], xyr[1], \n HOVER_Z - GRASP_DIST, get_gripper_pose(xyr[2]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L360_C16", "label": "start_training()", "type": "expression", "loc": [360, 360], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "vector": [8, 4, 0.2055, 0.0006, 4, 0.76, 0.1538, 638, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start_training", "arg_names": [], "import_names": [], "rhs_call_name": "start_training", "annotation": ""}, "snippet": " apm.start_training()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L362_C16", "label": "print()", "type": "expression", "loc": [362, 362], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "vector": [8, 4, 0.2066, 0.0006, 4, 0.76, 0.2308, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Moving arm down\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L363_C16", "label": "sttime = to_sec()", "type": "assigned_variable", "loc": [363, 363], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "vector": [14, 4, 0.2072, 0.0006, 4, 0.76, 0.3077, 574, 3, 0, 0, 0, 750, 10, 2], "semantic": {"name": "sttime", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " sttime = rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L364_C16", "label": "result = downward_grasp()", "type": "assigned_variable", "loc": [364, 364], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "vector": [14, 4, 0.2078, 0.0006, 4, 0.76, 0.3846, 51, 3, 3, 0, 0, 695, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "downward_grasp", "annotation": ""}, "snippet": " result = downward_grasp(cm, goal_pose, block=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L365_C16", "label": "endtime = to_sec()", "type": "assigned_variable", "loc": [365, 365], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "vector": [14, 4, 0.2083, 0.0006, 4, 0.76, 0.4615, 975, 3, 0, 0, 0, 750, 10, 2], "semantic": {"name": "endtime", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " endtime = rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L366_C16", "label": "print()", "type": "expression", "loc": [366, 366], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "vector": [8, 4, 0.2089, 0.0006, 4, 0.76, 0.5385, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"dur:\", endtime - sttime)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L367_C16", "label": "print()", "type": "expression", "loc": [367, 367], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "vector": [8, 4, 0.2095, 0.0006, 4, 0.76, 0.6154, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L368_C16", "label": "print()", "type": "expression", "loc": [368, 368], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "vector": [8, 4, 0.21, 0.0006, 4, 0.76, 0.6923, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Finished moving arm\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L369_C16", "label": "length = stop_training()", "type": "assigned_variable", "loc": [369, 369], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "vector": [14, 4, 0.2106, 0.0006, 4, 0.76, 0.7692, 221, 3, 0, 0, 0, 347, 10, 1], "semantic": {"name": "length", "arg_names": [], "import_names": [], "rhs_call_name": "stop_training", "annotation": ""}, "snippet": " length = apm.stop_training()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L370_C16", "label": "print()", "type": "expression", "loc": [370, 370], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "vector": [8, 4, 0.2112, 0.0006, 4, 0.76, 0.8462, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"length:\", length)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L371_C16", "label": "print()", "type": "expression", "loc": [371, 371], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "vector": [8, 4, 0.2118, 0.0006, 4, 0.76, 0.9231, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"len/dur\", length / (endtime - sttime))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L372_C16", "label": "sleep()", "type": "expression", "loc": [372, 372], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "vector": [8, 4, 0.2123, 0.0006, 4, 0.76, 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.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L377_C8", "label": "if", "type": "if", "loc": [377, 378], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L331_C4", "vector": [4, 2, 0.2155, 0.0011, 2, 0.78, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if setup_result is None or skip_grasp:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L380_C8", "label": "fn =", "type": "assigned_variable", "loc": [380, 380], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L331_C4", "vector": [14, 2, 0.2169, 0.0006, 2, 0.78, 0.6, 59, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "fn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fn = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L381_C8", "label": "if", "type": "if", "loc": [381, 384], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L331_C4", "vector": [4, 2, 0.2183, 0.0023, 2, 0.78, 0.7, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if result != \"no solution\" and generate_models:\n models = apm.generate_models()\n else:\n models = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L382_C12", "label": "models = generate_models()", "type": "assigned_variable", "loc": [382, 382], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L381_C8", "vector": [14, 3, 0.218, 0.0006, 3, 0.47, 0.0, 495, 3, 0, 0, 0, 956, 10, 1], "semantic": {"name": "models", "arg_names": [], "import_names": [], "rhs_call_name": "generate_models", "annotation": ""}, "snippet": " models = apm.generate_models()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L384_C12", "label": "models =", "type": "assigned_variable", "loc": [384, 384], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L381_C8", "vector": [14, 3, 0.2192, 0.0006, 3, 0.47, 1.0, 495, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " models = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L385_C8", "label": "if", "type": "if", "loc": [385, 389], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L331_C4", "vector": [4, 2, 0.2209, 0.0029, 2, 0.78, 0.8, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if result != \"no solution\":\n # grasp_data += [(xyr, None, apm.datasets, models, zeros)]\n fn = save_grasp([xyr, None, apm.datasets, models, zeros], GRASP_DATA_PREFIX)\n else:\n print(\"Grasp Failed, not adding data\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L387_C12", "label": "fn = save_grasp()", "type": "assigned_variable", "loc": [387, 387], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L385_C8", "vector": [14, 3, 0.2209, 0.0006, 3, 0.56, 0.0, 59, 3, 2, 0, 0, 833, 10, 1], "semantic": {"name": "fn", "arg_names": [], "import_names": [], "rhs_call_name": "save_grasp", "annotation": ""}, "snippet": " fn = save_grasp([xyr, None, apm.datasets, models, zeros], GRASP_DATA_PREFIX)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L389_C12", "label": "print()", "type": "expression", "loc": [389, 389], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L385_C8", "vector": [8, 3, 0.222, 0.0006, 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(\"Grasp Failed, not adding data\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L390_C8", "label": "append()", "type": "expression", "loc": [390, 390], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L331_C4", "vector": [8, 2, 0.2226, 0.0006, 2, 0.78, 0.9, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " grasp_index.append([xyr, fn])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L391_C8", "label": "clear_vars()", "type": "expression", "loc": [391, 391], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L331_C4", "vector": [8, 2, 0.2232, 0.0006, 2, 0.78, 1.0, 806, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clear_vars", "arg_names": [], "import_names": [], "rhs_call_name": "clear_vars", "annotation": ""}, "snippet": " apm.clear_vars()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L393_C4", "label": "print()", "type": "expression", "loc": [393, 393], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "vector": [8, 1, 0.2243, 0.0006, 1, 0.79, 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 Data\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L395_C4", "label": "save_pickle()", "type": "expression", "loc": [395, 395], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "vector": [8, 1, 0.2255, 0.0006, 1, 0.79, 0.8333, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " save_pickle(grasp_index, GRASP_DATA_INDEX_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L396_C4", "label": "print()", "type": "expression", "loc": [396, 396], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "vector": [8, 1, 0.226, 0.0006, 1, 0.79, 0.9167, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Data save complete\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L397_C4", "label": "return", "type": "return", "loc": [397, 397], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "vector": [13, 1, 0.2266, 0.0006, 1, 0.79, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None #grasp_data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L399_C0", "label": "load_data_and_generate", "type": "function", "loc": [399, 410], "level": 0, "parent": null, "vector": [2, 0, 0.2309, 0.0068, 0, 0.66, 0.6923, 657, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "load_data_and_generate", "arg_names": ["grasp_data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def load_data_and_generate(grasp_data):\n ret = []\n n = 0\n for grasp in grasp_data:\n apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_MON_LIST)\n apm.datasets = grasp[2]\n apm.generate_models()\n ret += [(grasp[0], grasp[1], grasp[2], apm.models, grasp[4])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L400_C4", "label": "ret =", "type": "assigned_variable", "loc": [400, 400], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L399_C0", "vector": [14, 1, 0.2283, 0.0006, 1, 0.81, 0.0, 501, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L401_C4", "label": "n =", "type": "assigned_variable", "loc": [401, 401], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L399_C0", "vector": [14, 1, 0.2289, 0.0006, 1, 0.81, 0.3333, 773, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L402_C4", "label": "for grasp", "type": "for", "loc": [402, 408], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L399_C0", "vector": [6, 1, 0.2312, 0.004, 1, 0.81, 0.6667, 766, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "grasp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for grasp in grasp_data:\n apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_MON_LIST)\n apm.datasets = grasp[2]\n apm.generate_models()\n ret += [(grasp[0], grasp[1], grasp[2], apm.models, grasp[4])]\n n += 1\n print(\"Generated %d models\" % (n))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L403_C8", "label": "apm = ArmPerceptionMonitor()", "type": "assigned_variable", "loc": [403, 403], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L402_C4", "vector": [14, 2, 0.23, 0.0006, 2, 0.67, 0.0, 21, 3, 2, 0, 0, 815, 10, 1], "semantic": {"name": "apm", "arg_names": [], "import_names": [], "rhs_call_name": "ArmPerceptionMonitor", "annotation": ""}, "snippet": " apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_MON_LIST)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L404_C8", "label": "apm.datasets =", "type": "assigned_variable", "loc": [404, 404], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L402_C4", "vector": [14, 2, 0.2306, 0.0006, 2, 0.67, 0.3333, 72, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "apm.datasets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " apm.datasets = grasp[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L405_C8", "label": "generate_models()", "type": "expression", "loc": [405, 405], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L402_C4", "vector": [8, 2, 0.2312, 0.0006, 2, 0.67, 0.6667, 956, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "generate_models", "arg_names": [], "import_names": [], "rhs_call_name": "generate_models", "annotation": ""}, "snippet": " apm.generate_models()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L408_C8", "label": "print()", "type": "expression", "loc": [408, 408], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L402_C4", "vector": [8, 2, 0.2329, 0.0006, 2, 0.67, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Generated %d models\" % (n))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L410_C4", "label": "return", "type": "return", "loc": [410, 410], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L399_C0", "vector": [13, 1, 0.234, 0.0006, 1, 0.81, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L412_C0", "label": "generate_space_models", "type": "function", "loc": [412, 482], "level": 0, "parent": null, "vector": [2, 0, 0.2551, 0.0405, 0, 0.66, 0.7, 753, 0, 0, 1, 0, 0, 0, 38], "semantic": {"name": "generate_space_models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def generate_space_models():\n mean_grasps = [] \n grasps = []\n grasp_xyr_list = get_xyr_list()\n for grasp in grasp_data:\n mean_grasps.append([grasp[0], generate_mean_grasp(grasp[2])])\n\n def dist1(o):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L413_C4", "label": "mean_grasps =", "type": "assigned_variable", "loc": [413, 413], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L412_C0", "vector": [14, 1, 0.2357, 0.0006, 1, 0.24, 0.0, 603, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "mean_grasps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mean_grasps = [] "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L414_C4", "label": "grasps =", "type": "assigned_variable", "loc": [414, 414], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L412_C0", "vector": [14, 1, 0.2363, 0.0006, 1, 0.24, 0.1, 384, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "grasps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasps = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L415_C4", "label": "grasp_xyr_list = get_xyr_list()", "type": "assigned_variable", "loc": [415, 415], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L412_C0", "vector": [14, 1, 0.2369, 0.0006, 1, 0.24, 0.2, 976, 3, 0, 0, 0, 986, 10, 1], "semantic": {"name": "grasp_xyr_list", "arg_names": [], "import_names": [], "rhs_call_name": "get_xyr_list", "annotation": ""}, "snippet": " grasp_xyr_list = get_xyr_list()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L416_C4", "label": "for grasp", "type": "for", "loc": [416, 417], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L412_C0", "vector": [6, 1, 0.2377, 0.0011, 1, 0.24, 0.3, 766, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "grasp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for grasp in grasp_data:\n mean_grasps.append([grasp[0], generate_mean_grasp(grasp[2])])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L417_C8", "label": "append()", "type": "expression", "loc": [417, 417], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L416_C4", "vector": [8, 2, 0.238, 0.0006, 2, 0.87, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " mean_grasps.append([grasp[0], generate_mean_grasp(grasp[2])])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L419_C4", "label": "dist1", "type": "function", "loc": [419, 420], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L412_C0", "vector": [2, 1, 0.2394, 0.0011, 1, 0.24, 0.4, 119, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "dist1", "arg_names": ["o"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def dist1(o):\n return np.fabs(o[0][0] - x) + np.fabs(o[0][1] - y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L420_C8", "label": "return", "type": "return", "loc": [420, 420], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L419_C4", "vector": [13, 2, 0.2397, 0.0006, 2, 0.69, 0.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.fabs(o[0][0] - x) + np.fabs(o[0][1] - y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L422_C4", "label": "xs =", "type": "assigned_variable", "loc": [422, 422], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L412_C0", "vector": [14, 1, 0.2409, 0.0006, 1, 0.24, 0.5, 928, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xs = (RECT[1][0] - RECT[0][0]) / (NUM_X - 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L423_C4", "label": "ys =", "type": "assigned_variable", "loc": [423, 423], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L412_C0", "vector": [14, 1, 0.2414, 0.0006, 1, 0.24, 0.6, 578, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ys", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ys = (RECT[0][1] - RECT[1][1]) / (NUM_Y - 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L424_C4", "label": "rs =", "type": "assigned_variable", "loc": [424, 424], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L412_C0", "vector": [14, 1, 0.242, 0.0006, 1, 0.24, 0.7, 594, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rs = np.pi / NUM_R"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L425_C4", "label": "st =", "type": "assigned_variable", "loc": [425, 425], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L412_C0", "vector": [14, 1, 0.2426, 0.0006, 1, 0.24, 0.8, 93, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "st", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " st = [RECT[0][0] + xs/2., RECT[1][1] + ys/2., rs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L426_C4", "label": "num_gen =", "type": "assigned_variable", "loc": [426, 426], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L412_C0", "vector": [14, 1, 0.2432, 0.0006, 1, 0.24, 0.9, 900, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "num_gen", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " num_gen = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L427_C4", "label": "for i", "type": "for", "loc": [427, 482], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L412_C0", "vector": [6, 1, 0.2594, 0.032, 1, 0.24, 1.0, 826, 3, 0, 0, 0, 0, 0, 33], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(NUM_X - 1):\n for j in range(NUM_Y - 1):\n for k in range(NUM_R):\n print(\"Number of models generated:\", num_gen)\n num_gen += 1\n pauser()\n close_models = []\n def dist1(o):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L428_C8", "label": "for j", "type": "for", "loc": [428, 481], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L427_C4", "vector": [6, 2, 0.2594, 0.0308, 2, 0.75, 0.0, 100, 3, 0, 0, 0, 0, 0, 32], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for j in range(NUM_Y - 1):\n for k in range(NUM_R):\n print(\"Number of models generated:\", num_gen)\n num_gen += 1\n pauser()\n close_models = []\n def dist1(o):\n return np.fabs(o[0][0] - st[0]) + np.fabs(o[0][1] - st[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L429_C12", "label": "for k", "type": "for", "loc": [429, 480], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L428_C8", "vector": [6, 3, 0.2594, 0.0297, 3, 0.4, 0.0, 954, 3, 0, 0, 0, 0, 0, 31], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in range(NUM_R):\n print(\"Number of models generated:\", num_gen)\n num_gen += 1\n pauser()\n close_models = []\n def dist1(o):\n return np.fabs(o[0][0] - st[0]) + np.fabs(o[0][1] - st[1])\n def rotdist(o):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L430_C16", "label": "print()", "type": "expression", "loc": [430, 430], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L429_C12", "vector": [8, 4, 0.2454, 0.0006, 4, 0.44, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Number of models generated:\", num_gen)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L432_C16", "label": "pauser()", "type": "expression", "loc": [432, 432], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L429_C12", "vector": [8, 4, 0.2466, 0.0006, 4, 0.44, 0.1, 777, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pauser", "arg_names": [], "import_names": [], "rhs_call_name": "pauser", "annotation": ""}, "snippet": " pauser()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L433_C16", "label": "close_models =", "type": "assigned_variable", "loc": [433, 433], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L429_C12", "vector": [14, 4, 0.2471, 0.0006, 4, 0.44, 0.2, 863, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "close_models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " close_models = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L434_C16", "label": "dist1", "type": "function", "loc": [434, 435], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L429_C12", "vector": [2, 4, 0.248, 0.0011, 4, 0.44, 0.3, 119, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "dist1", "arg_names": ["o"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def dist1(o):\n return np.fabs(o[0][0] - st[0]) + np.fabs(o[0][1] - st[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L435_C20", "label": "return", "type": "return", "loc": [435, 435], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L434_C16", "vector": [13, 5, 0.2483, 0.0006, 5, 0.32, 0.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.fabs(o[0][0] - st[0]) + np.fabs(o[0][1] - st[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L436_C16", "label": "rotdist", "type": "function", "loc": [436, 441], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L429_C12", "vector": [2, 4, 0.2503, 0.0034, 4, 0.44, 0.4, 966, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "rotdist", "arg_names": ["o"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def rotdist(o):\n if np.allclose(o[0][2], 0.0):\n # for loop around\n return min(np.fabs(np.pi - st[2]), np.fabs(0. - st[2]))\n else:\n return np.fabs(o[0][2] - st[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L437_C24", "label": "if", "type": "if", "loc": [437, 441], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L436_C16", "vector": [4, 5, 0.2506, 0.0029, 5, 0.72, 0.0, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.allclose(o[0][2], 0.0):\n # for loop around\n return min(np.fabs(np.pi - st[2]), np.fabs(0. - st[2]))\n else:\n return np.fabs(o[0][2] - st[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L439_C28", "label": "return", "type": "return", "loc": [439, 439], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L437_C24", "vector": [13, 6, 0.2506, 0.0006, 6, 0.35, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return min(np.fabs(np.pi - st[2]), np.fabs(0. - st[2]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L441_C28", "label": "return", "type": "return", "loc": [441, 441], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L437_C24", "vector": [13, 6, 0.2517, 0.0006, 6, 0.35, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.fabs(o[0][2] - st[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L442_C16", "label": "for i, dist", "type": "for", "loc": [442, 444], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L429_C12", "vector": [6, 4, 0.2529, 0.0017, 4, 0.44, 0.5, 931, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i, dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, dist in enumerate(map(dist1, mean_grasps)):\n if np.allclose(dist, (xs/2. + ys/2.), 0.0001) and np.allclose(rotdist(xyr_index[i]), rs/2., 0.0001):\n close_models += [mean_grasps[i]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L443_C20", "label": "if", "type": "if", "loc": [443, 444], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L442_C16", "vector": [4, 5, 0.2531, 0.0011, 5, 0.68, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.allclose(dist, (xs/2. + ys/2.), 0.0001) and np.allclose(rotdist(xyr_index[i]), rs/2., 0.0001):\n close_models += [mean_grasps[i]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L446_C16", "label": "if", "type": "if", "loc": [446, 447], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L429_C12", "vector": [4, 4, 0.2549, 0.0011, 4, 0.44, 0.6, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(close_models) < 5:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L450_C16", "label": "models =", "type": "assigned_variable", "loc": [450, 450], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L429_C12", "vector": [14, 4, 0.2568, 0.0006, 4, 0.44, 0.7, 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_99294:For_L451_C16", "label": "for p", "type": "for", "loc": [451, 475], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L429_C12", "vector": [6, 4, 0.2643, 0.0143, 4, 0.44, 0.8, 491, 2, 0, 0, 0, 0, 0, 14], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for p in close_models:\n lens = [len(m) for m in close_models[p]]\n max_len = np.max(lens)\n signals = zip(*close_models[p])\n ammodels, vmodels = [], []\n for signal in signals:\n avg_means_model = np.array([0.] * max_len)\n sqr_means_model = np.array([0.] * max_len)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L452_C20", "label": "lens =", "type": "assigned_variable", "loc": [452, 452], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L451_C16", "vector": [14, 5, 0.258, 0.0006, 5, 0.39, 0.0, 770, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "lens", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lens = [len(m) for m in close_models[p]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L453_C20", "label": "max_len = max()", "type": "assigned_variable", "loc": [453, 453], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L451_C16", "vector": [14, 5, 0.2586, 0.0006, 5, 0.39, 0.1429, 851, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "max_len", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_len = np.max(lens)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L454_C20", "label": "signals = zip()", "type": "assigned_variable", "loc": [454, 454], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L451_C16", "vector": [14, 5, 0.2591, 0.0006, 5, 0.39, 0.2857, 415, 3, 1, 0, 0, 814, 10, 1], "semantic": {"name": "signals", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": " signals = zip(*close_models[p])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L455_C20", "label": "ammodels, vmodels =", "type": "assigned_variable", "loc": [455, 455], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L451_C16", "vector": [14, 5, 0.2597, 0.0006, 5, 0.39, 0.4286, 248, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "ammodels, vmodels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ammodels, vmodels = [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L456_C20", "label": "for signal", "type": "for", "loc": [456, 471], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L451_C16", "vector": [6, 5, 0.2646, 0.0091, 5, 0.39, 0.5714, 621, 2, 0, 0, 0, 0, 0, 9], "semantic": {"name": "signal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for signal in signals:\n avg_means_model = np.array([0.] * max_len)\n sqr_means_model = np.array([0.] * max_len)\n for i in range(max_len):\n n = 0\n for j in range(len(signal)):\n if i < len(signal[j]):\n avg_means_model[i] += close_models[j][i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L457_C24", "label": "avg_means_model = array()", "type": "assigned_variable", "loc": [457, 457], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L456_C20", "vector": [14, 6, 0.2608, 0.0006, 6, 0.39, 0.0, 177, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "avg_means_model", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " avg_means_model = np.array([0.] * max_len)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L458_C24", "label": "sqr_means_model = array()", "type": "assigned_variable", "loc": [458, 458], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L456_C20", "vector": [14, 6, 0.2614, 0.0006, 6, 0.39, 0.2, 915, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "sqr_means_model", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " sqr_means_model = np.array([0.] * max_len)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L459_C24", "label": "for i", "type": "for", "loc": [459, 467], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L456_C20", "vector": [6, 6, 0.2643, 0.0051, 6, 0.39, 0.4, 826, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(max_len):\n n = 0\n for j in range(len(signal)):\n if i < len(signal[j]):\n avg_means_model[i] += close_models[j][i]\n sqr_means_model[i] += close_models[j][i] ** 2\n n += 1\n avg_means_model[i] /= n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L460_C28", "label": "n =", "type": "assigned_variable", "loc": [460, 460], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L459_C24", "vector": [14, 7, 0.2626, 0.0006, 7, 0.46, 0.0, 773, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L461_C28", "label": "for j", "type": "for", "loc": [461, 465], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L459_C24", "vector": [6, 7, 0.2643, 0.0029, 7, 0.46, 1.0, 100, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for j in range(len(signal)):\n if i < len(signal[j]):\n avg_means_model[i] += close_models[j][i]\n sqr_means_model[i] += close_models[j][i] ** 2\n n += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L462_C32", "label": "if", "type": "if", "loc": [462, 465], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L461_C28", "vector": [4, 8, 0.2646, 0.0023, 8, 0.17, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i < len(signal[j]):\n avg_means_model[i] += close_models[j][i]\n sqr_means_model[i] += close_models[j][i] ** 2\n n += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L469_C24", "label": "vars_model =", "type": "assigned_variable", "loc": [469, 469], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L456_C20", "vector": [14, 6, 0.2677, 0.0006, 6, 0.39, 0.6, 840, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "vars_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vars_model = signal_smooth(sqr_means_model, 30) - avg_means_model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L470_C24", "label": "append()", "type": "expression", "loc": [470, 470], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L456_C20", "vector": [8, 6, 0.2683, 0.0006, 6, 0.39, 0.8, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ammodels.append(avg_means_model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L471_C24", "label": "append()", "type": "expression", "loc": [471, 471], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L456_C20", "vector": [8, 6, 0.2688, 0.0006, 6, 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": " vmodels.append(vars_model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L473_C20", "label": "assign", "type": "assigned_variable", "loc": [473, 473], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L451_C16", "vector": [14, 5, 0.27, 0.0006, 5, 0.39, 0.7143, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " models[p] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L474_C20", "label": " = zip()", "type": "assigned_variable", "loc": [474, 474], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L451_C16", "vector": [14, 5, 0.2705, 0.0006, 5, 0.39, 0.8571, 0, 3, 1, 0, 0, 814, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": " models[p][\"mean\"] = zip(*ammodels)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L475_C20", "label": " = zip()", "type": "assigned_variable", "loc": [475, 475], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L451_C16", "vector": [14, 5, 0.2711, 0.0006, 5, 0.39, 1.0, 0, 3, 1, 0, 0, 814, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": " models[p][\"variance\"] = zip(*vmodels)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L477_C16", "label": "grasp =", "type": "assigned_variable", "loc": [477, 477], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L429_C12", "vector": [14, 4, 0.2723, 0.0006, 4, 0.44, 0.9, 766, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "grasp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp = [st, None, None, models, None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L478_C16", "label": "save_grasp()", "type": "expression", "loc": [478, 478], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L429_C12", "vector": [8, 4, 0.2728, 0.0006, 4, 0.44, 1.0, 833, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_grasp", "arg_names": [], "import_names": [], "rhs_call_name": "save_grasp", "annotation": ""}, "snippet": " save_grasp(grasp, GRASP_IND_PREFIX)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L496_C0", "label": "save_current_zeros", "type": "function", "loc": [496, 500], "level": 0, "parent": null, "vector": [2, 0, 0.2842, 0.0029, 0, 0.66, 0.7077, 569, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "save_current_zeros", "arg_names": ["filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def save_current_zeros(filename=ZEROS_FILE):\n apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_MON_LIST)\n zeros = apm.get_zeros()\n print(\"Zeros:\", zeros)\n save_pickle(zeros, filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L497_C4", "label": "apm = ArmPerceptionMonitor()", "type": "assigned_variable", "loc": [497, 497], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L496_C0", "vector": [14, 1, 0.2837, 0.0006, 1, 0.15, 0.0, 21, 3, 2, 0, 0, 815, 10, 1], "semantic": {"name": "apm", "arg_names": [], "import_names": [], "rhs_call_name": "ArmPerceptionMonitor", "annotation": ""}, "snippet": " apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_MON_LIST)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L498_C4", "label": "zeros = get_zeros()", "type": "assigned_variable", "loc": [498, 498], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L496_C0", "vector": [14, 1, 0.2842, 0.0006, 1, 0.15, 0.3333, 213, 3, 0, 0, 0, 264, 10, 1], "semantic": {"name": "zeros", "arg_names": [], "import_names": [], "rhs_call_name": "get_zeros", "annotation": ""}, "snippet": " zeros = apm.get_zeros()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L499_C4", "label": "print()", "type": "expression", "loc": [499, 499], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L496_C0", "vector": [8, 1, 0.2848, 0.0006, 1, 0.15, 0.6667, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Zeros:\", zeros)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L500_C4", "label": "save_pickle()", "type": "expression", "loc": [500, 500], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L496_C0", "vector": [8, 1, 0.2854, 0.0006, 1, 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": " save_pickle(zeros, filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L502_C0", "label": "load_current_zeros", "type": "function", "loc": [502, 503], "level": 0, "parent": null, "vector": [2, 0, 0.2868, 0.0011, 0, 0.66, 0.7154, 584, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "load_current_zeros", "arg_names": ["filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def load_current_zeros(filename=ZEROS_FILE):\n return load_pickle(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L503_C4", "label": "return", "type": "return", "loc": [503, 503], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L502_C0", "vector": [13, 1, 0.2871, 0.0006, 1, 0.73, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return load_pickle(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L505_C0", "label": "is_obj_in_gripper", "type": "function", "loc": [505, 508], "level": 0, "parent": null, "vector": [2, 0, 0.2891, 0.0023, 0, 0.66, 0.7231, 969, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "is_obj_in_gripper", "arg_names": ["cm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def is_obj_in_gripper(cm=None):\n if cm is None:\n cm = ControllerManager(armc)\n return cm.get_current_gripper_opening() > 0.01"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L506_C4", "label": "if", "type": "if", "loc": [506, 507], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L505_C0", "vector": [4, 1, 0.2891, 0.0011, 1, 0.03, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cm is None:\n cm = ControllerManager(armc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L507_C8", "label": "cm = ControllerManager()", "type": "assigned_variable", "loc": [507, 507], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L506_C4", "vector": [14, 2, 0.2894, 0.0006, 2, 0.62, 0.0, 675, 3, 1, 0, 0, 16, 10, 1], "semantic": {"name": "cm", "arg_names": [], "import_names": [], "rhs_call_name": "ControllerManager", "annotation": ""}, "snippet": " cm = ControllerManager(armc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L508_C4", "label": "return", "type": "return", "loc": [508, 508], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L505_C0", "vector": [13, 1, 0.29, 0.0006, 1, 0.03, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cm.get_current_gripper_opening() > 0.01"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L510_C0", "label": "open_gripper", "type": "function", "loc": [510, 515], "level": 0, "parent": null, "vector": [2, 0, 0.2925, 0.0034, 0, 0.66, 0.7308, 833, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "open_gripper", "arg_names": ["cm", "blocking"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def open_gripper(cm=None, blocking = False):\n if cm is None:\n cm = ControllerManager(armc)\n cm.command_gripper(0.08, -1.0, False)\n if blocking:\n cm.gripper_action_client.wait_for_result(rospy.Duration(4.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L511_C4", "label": "if", "type": "if", "loc": [511, 512], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L510_C0", "vector": [4, 1, 0.292, 0.0011, 1, 0.46, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cm is None:\n cm = ControllerManager(armc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L512_C8", "label": "cm = ControllerManager()", "type": "assigned_variable", "loc": [512, 512], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L511_C4", "vector": [14, 2, 0.2922, 0.0006, 2, 0.47, 0.0, 675, 3, 1, 0, 0, 16, 10, 1], "semantic": {"name": "cm", "arg_names": [], "import_names": [], "rhs_call_name": "ControllerManager", "annotation": ""}, "snippet": " cm = ControllerManager(armc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L513_C4", "label": "command_gripper()", "type": "expression", "loc": [513, 513], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L510_C0", "vector": [8, 1, 0.2928, 0.0006, 1, 0.46, 0.5, 250, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "command_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "command_gripper", "annotation": ""}, "snippet": " cm.command_gripper(0.08, -1.0, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L514_C4", "label": "if", "type": "if", "loc": [514, 515], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L510_C0", "vector": [4, 1, 0.2937, 0.0011, 1, 0.46, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if blocking:\n cm.gripper_action_client.wait_for_result(rospy.Duration(4.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L515_C8", "label": "wait_for_result()", "type": "expression", "loc": [515, 515], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L514_C4", "vector": [8, 2, 0.2939, 0.0006, 2, 0.0, 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": " cm.gripper_action_client.wait_for_result(rospy.Duration(4.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "label": "perform_grasp", "type": "function", "loc": [517, 674], "level": 0, "parent": null, "vector": [2, 0, 0.3399, 0.0902, 0, 0.66, 0.7385, 121, 0, 13, 1, 0, 0, 0, 72], "semantic": {"name": "perform_grasp", "arg_names": ["x", "y", "z", "gripper_rot", "grasp", "is_place", "is_grasp", "collide", "return_pose", "zeros", "grasp_data", "cm", "apm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def perform_grasp(x, y, z=None, gripper_rot = np.pi / 2., grasp=None, is_place=False,\n is_grasp=True, collide = True, return_pose=True,\n zeros = None, grasp_data=None, cm=None, apm=None):\n print(\"Performing grasp (%1.2f, %1.2f), rotation: %1.2f\" % (x, y, gripper_rot))\n gripper_rot = normalize_rot(gripper_rot)\n\n if cm is None:\n cm = ControllerManager(armc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L520_C4", "label": "print()", "type": "expression", "loc": [520, 520], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "vector": [8, 1, 0.2968, 0.0006, 1, 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(\"Performing grasp (%1.2f, %1.2f), rotation: %1.2f\" % (x, y, gripper_rot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L521_C4", "label": "gripper_rot = normalize_rot()", "type": "assigned_variable", "loc": [521, 521], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "vector": [14, 1, 0.2974, 0.0006, 1, 0.19, 0.0526, 541, 3, 1, 0, 0, 27, 10, 1], "semantic": {"name": "gripper_rot", "arg_names": [], "import_names": [], "rhs_call_name": "normalize_rot", "annotation": ""}, "snippet": " gripper_rot = normalize_rot(gripper_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L523_C4", "label": "if", "type": "if", "loc": [523, 524], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "vector": [4, 1, 0.2988, 0.0011, 1, 0.19, 0.1053, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cm is None:\n cm = ControllerManager(armc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L524_C8", "label": "cm = ControllerManager()", "type": "assigned_variable", "loc": [524, 524], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L523_C4", "vector": [14, 2, 0.2991, 0.0006, 2, 0.14, 0.0, 675, 3, 1, 0, 0, 16, 10, 1], "semantic": {"name": "cm", "arg_names": [], "import_names": [], "rhs_call_name": "ControllerManager", "annotation": ""}, "snippet": " cm = ControllerManager(armc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L525_C4", "label": "if", "type": "if", "loc": [525, 526], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "vector": [4, 1, 0.2999, 0.0011, 1, 0.19, 0.1579, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if apm is None:\n apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_GRASP_LIST)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L526_C8", "label": "apm = ArmPerceptionMonitor()", "type": "assigned_variable", "loc": [526, 526], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L525_C4", "vector": [14, 2, 0.3002, 0.0006, 2, 0.24, 0.0, 21, 3, 2, 0, 0, 815, 10, 1], "semantic": {"name": "apm", "arg_names": [], "import_names": [], "rhs_call_name": "ArmPerceptionMonitor", "annotation": ""}, "snippet": " apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_GRASP_LIST)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L528_C4", "label": "if", "type": "if", "loc": [528, 529], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "vector": [4, 1, 0.3017, 0.0011, 1, 0.19, 0.2105, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if grasp is None:\n grasp = get_grasp_model(x, y, gripper_rot, grasp_data = grasp_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L529_C8", "label": "grasp = get_grasp_model()", "type": "assigned_variable", "loc": [529, 529], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L528_C4", "vector": [14, 2, 0.3019, 0.0006, 2, 0.74, 0.0, 766, 3, 4, 0, 0, 85, 10, 1], "semantic": {"name": "grasp", "arg_names": [], "import_names": [], "rhs_call_name": "get_grasp_model", "annotation": ""}, "snippet": " grasp = get_grasp_model(x, y, gripper_rot, grasp_data = grasp_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L536_C4", "label": "print()", "type": "expression", "loc": [536, 536], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "vector": [8, 1, 0.3059, 0.0006, 1, 0.19, 0.2632, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Beginning grasp\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L538_C4", "label": "result =", "type": "assigned_variable", "loc": [538, 538], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "vector": [14, 1, 0.3071, 0.0006, 1, 0.19, 0.3158, 51, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = \"no solution\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L539_C4", "label": "iters =", "type": "assigned_variable", "loc": [539, 539], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "vector": [14, 1, 0.3076, 0.0006, 1, 0.19, 0.3684, 290, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "iters", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " iters = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "label": "while", "type": "while", "loc": [540, 617], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "vector": [5, 1, 0.3302, 0.0445, 1, 0.19, 0.4211, 0, 1, 0, 0, 0, 0, 0, 35], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while True:\n # Move to grasp position\n print(\"Moving to initial grasp position\")\n # cm.command_joint_trajectory([grasp[1]], SETUP_VELOCITY, blocking = True)\n\n # print \"Moving to final grasp position\"\n grasp_pose = create_goal_pose(x, y, HOVER_Z, get_gripper_pose(gripper_rot))\n cm.move_arm_pose_biased(grasp_pose, JOINTS_BIAS, SETUP_VELOCITY, blocking = False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L542_C8", "label": "print()", "type": "expression", "loc": [542, 542], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "vector": [8, 2, 0.3094, 0.0006, 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(\"Moving to initial grasp position\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L546_C8", "label": "grasp_pose = create_goal_pose()", "type": "assigned_variable", "loc": [546, 546], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "vector": [14, 2, 0.3116, 0.0006, 2, 0.12, 0.0588, 752, 3, 4, 0, 0, 758, 10, 2], "semantic": {"name": "grasp_pose", "arg_names": [], "import_names": [], "rhs_call_name": "create_goal_pose", "annotation": ""}, "snippet": " grasp_pose = create_goal_pose(x, y, HOVER_Z, get_gripper_pose(gripper_rot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L547_C8", "label": "move_arm_pose_biased()", "type": "expression", "loc": [547, 547], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "vector": [8, 2, 0.3122, 0.0006, 2, 0.12, 0.1176, 84, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "move_arm_pose_biased", "arg_names": [], "import_names": [], "rhs_call_name": "move_arm_pose_biased", "annotation": ""}, "snippet": " cm.move_arm_pose_biased(grasp_pose, JOINTS_BIAS, SETUP_VELOCITY, blocking = False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L548_C8", "label": "if", "type": "if", "loc": [548, 552], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "vector": [4, 2, 0.3139, 0.0029, 2, 0.12, 0.1765, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not is_place and is_grasp:\n # open gripper\n print(\"Opening gripper\")\n cm.command_gripper(0.08, -1.0, False)\n cm.gripper_action_client.wait_for_result(rospy.Duration(2.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L550_C12", "label": "print()", "type": "expression", "loc": [550, 550], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L548_C8", "vector": [8, 3, 0.3139, 0.0006, 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(\"Opening gripper\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L551_C12", "label": "command_gripper()", "type": "expression", "loc": [551, 551], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L548_C8", "vector": [8, 3, 0.3145, 0.0006, 3, 0.5, 0.5, 250, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "command_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "command_gripper", "annotation": ""}, "snippet": " cm.command_gripper(0.08, -1.0, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L552_C12", "label": "wait_for_result()", "type": "expression", "loc": [552, 552], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L548_C8", "vector": [8, 3, 0.3151, 0.0006, 3, 0.5, 1.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": " cm.gripper_action_client.wait_for_result(rospy.Duration(2.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L553_C8", "label": "wait_joint_trajectory_done()", "type": "expression", "loc": [553, 553], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "vector": [8, 2, 0.3156, 0.0006, 2, 0.12, 0.2353, 722, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_joint_trajectory_done", "arg_names": [], "import_names": [], "rhs_call_name": "wait_joint_trajectory_done", "annotation": ""}, "snippet": " cm.wait_joint_trajectory_done()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L554_C8", "label": "sleep()", "type": "expression", "loc": [554, 554], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "vector": [8, 2, 0.3162, 0.0006, 2, 0.12, 0.2941, 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_99294:Assign_L560_C8", "label": "goal_pose = create_goal_pose()", "type": "assigned_variable", "loc": [560, 560], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "vector": [14, 2, 0.3196, 0.0006, 2, 0.12, 0.3529, 109, 3, 4, 0, 0, 758, 10, 2], "semantic": {"name": "goal_pose", "arg_names": [], "import_names": [], "rhs_call_name": "create_goal_pose", "annotation": ""}, "snippet": " goal_pose = create_goal_pose(x, y, HOVER_Z - GRASP_DIST, get_gripper_pose(gripper_rot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:ClassDef_L562_C8", "label": "Collision", "type": "class", "loc": [562, 573], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "vector": [3, 2, 0.3239, 0.0068, 2, 0.12, 0.4118, 163, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "Collision", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class Collision():\n def __init__(self):\n self.collided = False\n # start gathering data\n def on_collision(self):\n print(\"Collision!\")\n self.collided = True\n while not cm.check_joint_trajectory_done():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L563_C12", "label": "__init__", "type": "function", "loc": [563, 564], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:ClassDef_L562_C8", "vector": [2, 3, 0.3216, 0.0011, 3, 0.79, 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.collided = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L564_C16", "label": "self.collided =", "type": "assigned_variable", "loc": [564, 564], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L563_C12", "vector": [14, 4, 0.3219, 0.0006, 4, 0.88, 0.0, 80, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.collided", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.collided = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L566_C12", "label": "on_collision", "type": "function", "loc": [566, 573], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:ClassDef_L562_C8", "vector": [2, 3, 0.3251, 0.0046, 3, 0.79, 1.0, 976, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "on_collision", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def on_collision(self):\n print(\"Collision!\")\n self.collided = True\n while not cm.check_joint_trajectory_done():\n cm.joint_action_client.cancel_all_goals()\n rospy.sleep(0.01)\n if rospy.is_shutdown():\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L567_C16", "label": "print()", "type": "expression", "loc": [567, 567], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L566_C12", "vector": [8, 4, 0.3236, 0.0006, 4, 0.54, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Collision!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L568_C16", "label": "self.collided =", "type": "assigned_variable", "loc": [568, 568], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L566_C12", "vector": [14, 4, 0.3242, 0.0006, 4, 0.54, 0.5, 80, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.collided", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.collided = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L569_C16", "label": "while", "type": "while", "loc": [569, 573], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L566_C12", "vector": [5, 4, 0.3259, 0.0029, 4, 0.54, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not cm.check_joint_trajectory_done():\n cm.joint_action_client.cancel_all_goals()\n rospy.sleep(0.01)\n if rospy.is_shutdown():\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L570_C20", "label": "cancel_all_goals()", "type": "expression", "loc": [570, 570], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L569_C16", "vector": [8, 5, 0.3253, 0.0006, 5, 0.72, 0.0, 699, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel_all_goals", "arg_names": [], "import_names": [], "rhs_call_name": "cancel_all_goals", "annotation": ""}, "snippet": " cm.joint_action_client.cancel_all_goals()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L571_C20", "label": "sleep()", "type": "expression", "loc": [571, 571], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L569_C16", "vector": [8, 5, 0.3259, 0.0006, 5, 0.72, 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.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L572_C20", "label": "if", "type": "if", "loc": [572, 573], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L569_C16", "vector": [4, 5, 0.3268, 0.0011, 5, 0.72, 1.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 return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L573_C24", "label": "return", "type": "return", "loc": [573, 573], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L572_C20", "vector": [13, 6, 0.3271, 0.0006, 6, 0.47, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L574_C8", "label": "col = Collision()", "type": "assigned_variable", "loc": [574, 574], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "vector": [14, 2, 0.3276, 0.0006, 2, 0.12, 0.4706, 157, 3, 0, 0, 0, 163, 10, 1], "semantic": {"name": "col", "arg_names": [], "import_names": [], "rhs_call_name": "Collision", "annotation": ""}, "snippet": " col = Collision()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L575_C8", "label": "rotate_acceleration", "type": "function", "loc": [575, 582], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "vector": [2, 2, 0.3302, 0.0046, 2, 0.12, 0.5294, 757, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "rotate_acceleration", "arg_names": ["data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def rotate_acceleration(data):\n return data\n data -= zeros[\"accelerometer\"]\n a = gripper_rot\n data[1] = np.cos(a) * data[1] - np.sin(a) * data[2]\n data[2] = np.sin(a) * data[1] + np.cos(a) * data[2]\n data += zeros[\"accelerometer\"]\n return data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L576_C12", "label": "return", "type": "return", "loc": [576, 576], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L575_C8", "vector": [13, 3, 0.3288, 0.0006, 3, 0.58, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L578_C12", "label": "a =", "type": "assigned_variable", "loc": [578, 578], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L575_C8", "vector": [14, 3, 0.3299, 0.0006, 3, 0.58, 0.25, 475, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " a = gripper_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L579_C12", "label": "assign", "type": "assigned_variable", "loc": [579, 579], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L575_C8", "vector": [14, 3, 0.3305, 0.0006, 3, 0.58, 0.5, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data[1] = np.cos(a) * data[1] - np.sin(a) * data[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L580_C12", "label": "assign", "type": "assigned_variable", "loc": [580, 580], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L575_C8", "vector": [14, 3, 0.3311, 0.0006, 3, 0.58, 0.75, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data[2] = np.sin(a) * data[1] + np.cos(a) * data[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L582_C12", "label": "return", "type": "return", "loc": [582, 582], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L575_C8", "vector": [13, 3, 0.3322, 0.0006, 3, 0.58, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L584_C8", "label": "transforms =", "type": "assigned_variable", "loc": [584, 584], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "vector": [14, 2, 0.3333, 0.0006, 2, 0.12, 0.5882, 578, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "transforms", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " transforms = { \"accelerometer\" : rotate_acceleration }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L586_C8", "label": "while", "type": "while", "loc": [586, 587], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "vector": [5, 2, 0.3348, 0.0011, 2, 0.12, 0.6471, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown() and len(grasp) < 5:\n rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L587_C12", "label": "sleep()", "type": "expression", "loc": [587, 587], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L586_C8", "vector": [8, 3, 0.335, 0.0006, 3, 0.33, 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_99294:Expr_L589_C8", "label": "begin_monitoring()", "type": "expression", "loc": [589, 596], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "vector": [8, 2, 0.3382, 0.0046, 2, 0.12, 0.7059, 794, 3, 11, 0, 0, 0, 0, 1], "semantic": {"name": "begin_monitoring", "arg_names": [], "import_names": [], "rhs_call_name": "begin_monitoring", "annotation": ""}, "snippet": " apm.begin_monitoring(grasp[3], \n model_zeros = grasp[4], \n contingency=col.on_collision, window_size=MONITOR_WINDOW,\n current_zeros=zeros, std_dev_default=STD_DEV, \n std_dev_dict = STD_DEV_DICT,\n tol_thresh_dict = TOL_THRESH_DICT,\n noise_dev_default=NOISE_DEV, collide=collide,\n transform_dict = transforms) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L598_C8", "label": "print()", "type": "expression", "loc": [598, 598], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "vector": [8, 2, 0.3413, 0.0006, 2, 0.12, 0.7647, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Moving arm down\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L599_C8", "label": "startt = to_sec()", "type": "assigned_variable", "loc": [599, 599], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "vector": [14, 2, 0.3419, 0.0006, 2, 0.12, 0.8235, 312, 3, 0, 0, 0, 750, 10, 2], "semantic": {"name": "startt", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " startt = rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L600_C8", "label": "result = downward_grasp()", "type": "assigned_variable", "loc": [600, 600], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "vector": [14, 2, 0.3425, 0.0006, 2, 0.12, 0.8824, 51, 3, 3, 0, 0, 695, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "downward_grasp", "annotation": ""}, "snippet": " result = downward_grasp(cm, goal_pose, block = False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L601_C8", "label": "print()", "type": "expression", "loc": [601, 601], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "vector": [8, 2, 0.343, 0.0006, 2, 0.12, 0.9412, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Grasp result:\", result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L602_C8", "label": "if", "type": "if", "loc": [602, 617], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "vector": [4, 2, 0.3479, 0.0091, 2, 0.12, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if result == \"no solution\":\n # Jiggle it to see if it works\n apm.end_monitoring()\n dx = random.uniform(-0.015, 0.015)\n dy = random.uniform(-0.015, 0.015)\n x += dx\n y += dy\n iters += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L604_C12", "label": "end_monitoring()", "type": "expression", "loc": [604, 604], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L602_C8", "vector": [8, 3, 0.3447, 0.0006, 3, 0.08, 0.0, 790, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "end_monitoring", "arg_names": [], "import_names": [], "rhs_call_name": "end_monitoring", "annotation": ""}, "snippet": " apm.end_monitoring()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L605_C12", "label": "dx = uniform()", "type": "assigned_variable", "loc": [605, 605], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L602_C8", "vector": [14, 3, 0.3453, 0.0006, 3, 0.08, 0.3333, 870, 3, 2, 0, 0, 463, 10, 1], "semantic": {"name": "dx", "arg_names": [], "import_names": [], "rhs_call_name": "uniform", "annotation": ""}, "snippet": " dx = random.uniform(-0.015, 0.015)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L606_C12", "label": "dy = uniform()", "type": "assigned_variable", "loc": [606, 606], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L602_C8", "vector": [14, 3, 0.3459, 0.0006, 3, 0.08, 0.6667, 477, 3, 2, 0, 0, 463, 10, 1], "semantic": {"name": "dy", "arg_names": [], "import_names": [], "rhs_call_name": "uniform", "annotation": ""}, "snippet": " dy = random.uniform(-0.015, 0.015)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L611_C12", "label": "if", "type": "if", "loc": [611, 615], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L602_C8", "vector": [4, 3, 0.3499, 0.0029, 3, 0.08, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if iters == 4:\n print(\"Cannot find IK solution!!!\" * 8)\n return\n else:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L612_C16", "label": "print()", "type": "expression", "loc": [612, 612], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L611_C12", "vector": [8, 4, 0.3493, 0.0006, 4, 0.71, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Cannot find IK solution!!!\" * 8)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L613_C16", "label": "return", "type": "return", "loc": [613, 613], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L611_C12", "vector": [13, 4, 0.3499, 0.0006, 4, 0.71, 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_99294:If_L619_C4", "label": "if", "type": "if", "loc": [619, 644], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "vector": [4, 1, 0.3604, 0.0148, 1, 0.19, 0.4737, 0, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if z is None:\n while not cm.check_joint_trajectory_done():\n if col.collided:\n cm.joint_action_client.cancel_all_goals()\n rospy.sleep(0.01)\n if rospy.is_shutdown():\n return None\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L620_C8", "label": "while", "type": "while", "loc": [620, 625], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L619_C4", "vector": [5, 2, 0.3553, 0.0034, 2, 0.05, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not cm.check_joint_trajectory_done():\n if col.collided:\n cm.joint_action_client.cancel_all_goals()\n rospy.sleep(0.01)\n if rospy.is_shutdown():\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L621_C12", "label": "if", "type": "if", "loc": [621, 622], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L620_C8", "vector": [4, 3, 0.3547, 0.0011, 3, 0.05, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if col.collided:\n cm.joint_action_client.cancel_all_goals()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L622_C16", "label": "cancel_all_goals()", "type": "expression", "loc": [622, 622], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L621_C12", "vector": [8, 4, 0.355, 0.0006, 4, 0.82, 0.0, 699, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel_all_goals", "arg_names": [], "import_names": [], "rhs_call_name": "cancel_all_goals", "annotation": ""}, "snippet": " cm.joint_action_client.cancel_all_goals()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L623_C12", "label": "sleep()", "type": "expression", "loc": [623, 623], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L620_C8", "vector": [8, 3, 0.3556, 0.0006, 3, 0.05, 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.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L624_C12", "label": "if", "type": "if", "loc": [624, 625], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L620_C8", "vector": [4, 3, 0.3564, 0.0011, 3, 0.05, 1.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 return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L625_C16", "label": "return", "type": "return", "loc": [625, 625], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L624_C12", "vector": [13, 4, 0.3567, 0.0006, 4, 0.36, 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_99294:While_L627_C8", "label": "while", "type": "while", "loc": [627, 644], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L619_C4", "vector": [5, 2, 0.3627, 0.0103, 2, 0.05, 1.0, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not cm.check_joint_trajectory_done():\n if col.collided:\n cm.joint_action_client.cancel_all_goals()\n wrist_pose = cm.get_current_wrist_pose_stamped(\"torso_lift_link\")\n p = wrist_pose.pose.position\n o = wrist_pose.pose.orientation\n affector_pos = transform_in_frame([p.x, p.y, p.z],\n [o.x, o.y, o.z, o.w], GRIPPER_POINT)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L628_C12", "label": "if", "type": "if", "loc": [628, 629], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L627_C8", "vector": [4, 3, 0.3587, 0.0011, 3, 0.93, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if col.collided:\n cm.joint_action_client.cancel_all_goals()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L629_C16", "label": "cancel_all_goals()", "type": "expression", "loc": [629, 629], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L628_C12", "vector": [8, 4, 0.359, 0.0006, 4, 0.03, 0.0, 699, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel_all_goals", "arg_names": [], "import_names": [], "rhs_call_name": "cancel_all_goals", "annotation": ""}, "snippet": " cm.joint_action_client.cancel_all_goals()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L630_C12", "label": "wrist_pose = get_current_wrist_pose_stamped()", "type": "assigned_variable", "loc": [630, 630], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L627_C8", "vector": [14, 3, 0.3596, 0.0006, 3, 0.93, 0.1429, 718, 3, 1, 0, 0, 662, 10, 1], "semantic": {"name": "wrist_pose", "arg_names": [], "import_names": [], "rhs_call_name": "get_current_wrist_pose_stamped", "annotation": ""}, "snippet": " wrist_pose = cm.get_current_wrist_pose_stamped(\"torso_lift_link\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L631_C12", "label": "p =", "type": "assigned_variable", "loc": [631, 631], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L627_C8", "vector": [14, 3, 0.3602, 0.0006, 3, 0.93, 0.2857, 491, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = wrist_pose.pose.position"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L632_C12", "label": "o =", "type": "assigned_variable", "loc": [632, 632], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L627_C8", "vector": [14, 3, 0.3607, 0.0006, 3, 0.93, 0.4286, 926, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "o", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " o = wrist_pose.pose.orientation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L633_C12", "label": "affector_pos = transform_in_frame()", "type": "assigned_variable", "loc": [633, 634], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L627_C8", "vector": [14, 3, 0.3616, 0.0011, 3, 0.93, 0.5714, 383, 3, 3, 0, 0, 114, 10, 1], "semantic": {"name": "affector_pos", "arg_names": [], "import_names": [], "rhs_call_name": "transform_in_frame", "annotation": ""}, "snippet": " affector_pos = transform_in_frame([p.x, p.y, p.z],\n [o.x, o.y, o.z, o.w], GRIPPER_POINT)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L635_C12", "label": "if", "type": "if", "loc": [635, 641], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L627_C8", "vector": [4, 3, 0.3642, 0.004, 3, 0.93, 0.7143, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if affector_pos[2] <= z:\n print(\"Reached z position\")\n print(\"Affector position:\", affector_pos)\n while not cm.check_joint_trajectory_done():\n cm.joint_action_client.cancel_all_goals()\n rospy.sleep(0.01)\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L636_C16", "label": "print()", "type": "expression", "loc": [636, 636], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L635_C12", "vector": [8, 4, 0.363, 0.0006, 4, 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(\"Reached z position\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L637_C16", "label": "print()", "type": "expression", "loc": [637, 637], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L635_C12", "vector": [8, 4, 0.3636, 0.0006, 4, 0.45, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Affector position:\", affector_pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L638_C16", "label": "while", "type": "while", "loc": [638, 640], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L635_C12", "vector": [5, 4, 0.3647, 0.0017, 4, 0.45, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not cm.check_joint_trajectory_done():\n cm.joint_action_client.cancel_all_goals()\n rospy.sleep(0.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L639_C20", "label": "cancel_all_goals()", "type": "expression", "loc": [639, 639], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L638_C16", "vector": [8, 5, 0.3647, 0.0006, 5, 0.75, 0.0, 699, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel_all_goals", "arg_names": [], "import_names": [], "rhs_call_name": "cancel_all_goals", "annotation": ""}, "snippet": " cm.joint_action_client.cancel_all_goals()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L640_C20", "label": "sleep()", "type": "expression", "loc": [640, 640], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L638_C16", "vector": [8, 5, 0.3653, 0.0006, 5, 0.75, 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_99294:Expr_L642_C12", "label": "sleep()", "type": "expression", "loc": [642, 642], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L627_C8", "vector": [8, 3, 0.3664, 0.0006, 3, 0.93, 0.8571, 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_99294:If_L643_C12", "label": "if", "type": "if", "loc": [643, 644], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L627_C8", "vector": [4, 3, 0.3673, 0.0011, 3, 0.93, 1.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 return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L644_C16", "label": "return", "type": "return", "loc": [644, 644], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L643_C12", "vector": [13, 4, 0.3676, 0.0006, 4, 0.69, 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_99294:Assign_L646_C4", "label": "endt = to_sec()", "type": "assigned_variable", "loc": [646, 646], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "vector": [14, 1, 0.3687, 0.0006, 1, 0.19, 0.5263, 857, 3, 0, 0, 0, 750, 10, 2], "semantic": {"name": "endt", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " endt = rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L647_C4", "label": "print()", "type": "expression", "loc": [647, 647], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "vector": [8, 1, 0.3693, 0.0006, 1, 0.19, 0.5789, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Grasp duration:\", startt - endt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L648_C4", "label": "print()", "type": "expression", "loc": [648, 648], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "vector": [8, 1, 0.3699, 0.0006, 1, 0.19, 0.6316, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Finished moving arm\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L650_C4", "label": "avg_list = end_monitoring()", "type": "assigned_variable", "loc": [650, 650], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "vector": [14, 1, 0.371, 0.0006, 1, 0.19, 0.6842, 368, 3, 0, 0, 0, 790, 10, 1], "semantic": {"name": "avg_list", "arg_names": [], "import_names": [], "rhs_call_name": "end_monitoring", "annotation": ""}, "snippet": " avg_list = apm.end_monitoring()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L651_C4", "label": "sleep()", "type": "expression", "loc": [651, 651], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "vector": [8, 1, 0.3716, 0.0006, 1, 0.19, 0.7368, 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_99294:For_L653_C4", "label": "for k", "type": "for", "loc": [653, 657], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "vector": [6, 1, 0.3739, 0.0029, 1, 0.19, 0.7895, 954, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in apm.z_avg:\n if not k in z_sum:\n z_sum[k] = np.copy(apm.z_avg[k])\n else:\n z_sum[k] += apm.z_avg[k]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L654_C8", "label": "if", "type": "if", "loc": [654, 657], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L653_C4", "vector": [4, 2, 0.3741, 0.0023, 2, 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 k in z_sum:\n z_sum[k] = np.copy(apm.z_avg[k])\n else:\n z_sum[k] += apm.z_avg[k]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L655_C12", "label": " = copy()", "type": "assigned_variable", "loc": [655, 655], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L654_C8", "vector": [14, 3, 0.3739, 0.0006, 3, 0.42, 0.0, 0, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " z_sum[k] = np.copy(apm.z_avg[k])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L659_C4", "label": "if", "type": "if", "loc": [659, 666], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "vector": [4, 1, 0.3781, 0.0046, 1, 0.19, 0.8421, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not is_place and is_grasp:\n print(\"Closing gripper\")\n cm.command_gripper(0.0, 30.0, True)\n print(\"Gripper closed\")\n elif is_place:\n print(\"Opening gripper\")\n cm.command_gripper(0.08, -1.0, True)\n print(\"Gripper opened\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L660_C8", "label": "print()", "type": "expression", "loc": [660, 660], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L659_C4", "vector": [8, 2, 0.3767, 0.0006, 2, 0.32, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Closing gripper\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L661_C8", "label": "command_gripper()", "type": "expression", "loc": [661, 661], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L659_C4", "vector": [8, 2, 0.3773, 0.0006, 2, 0.32, 0.3333, 250, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "command_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "command_gripper", "annotation": ""}, "snippet": " cm.command_gripper(0.0, 30.0, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L662_C8", "label": "print()", "type": "expression", "loc": [662, 662], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L659_C4", "vector": [8, 2, 0.3779, 0.0006, 2, 0.32, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Gripper closed\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L663_C4", "label": "if", "type": "if", "loc": [663, 666], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L659_C4", "vector": [4, 2, 0.3793, 0.0023, 2, 0.32, 1.0, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif is_place:\n print(\"Opening gripper\")\n cm.command_gripper(0.08, -1.0, True)\n print(\"Gripper opened\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L664_C8", "label": "print()", "type": "expression", "loc": [664, 664], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L663_C4", "vector": [8, 3, 0.379, 0.0006, 3, 0.3, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Opening gripper\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L665_C8", "label": "command_gripper()", "type": "expression", "loc": [665, 665], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L663_C4", "vector": [8, 3, 0.3796, 0.0006, 3, 0.3, 0.5, 250, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "command_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "command_gripper", "annotation": ""}, "snippet": " cm.command_gripper(0.08, -1.0, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L666_C8", "label": "print()", "type": "expression", "loc": [666, 666], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L663_C4", "vector": [8, 3, 0.3801, 0.0006, 3, 0.3, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Gripper opened\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L668_C4", "label": "if", "type": "if", "loc": [668, 670], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "vector": [4, 1, 0.3818, 0.0017, 1, 0.19, 0.8947, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if return_pose and is_grasp:\n print(\"Moving back to grasp position\")\n cm.move_arm_pose_biased(grasp_pose, JOINTS_BIAS, SETUP_VELOCITY, blocking = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L669_C8", "label": "print()", "type": "expression", "loc": [669, 669], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L668_C4", "vector": [8, 2, 0.3818, 0.0006, 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(\"Moving back to grasp position\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L670_C8", "label": "move_arm_pose_biased()", "type": "expression", "loc": [670, 670], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L668_C4", "vector": [8, 2, 0.3824, 0.0006, 2, 0.53, 1.0, 84, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "move_arm_pose_biased", "arg_names": [], "import_names": [], "rhs_call_name": "move_arm_pose_biased", "annotation": ""}, "snippet": " cm.move_arm_pose_biased(grasp_pose, JOINTS_BIAS, SETUP_VELOCITY, blocking = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L672_C4", "label": "print()", "type": "expression", "loc": [672, 672], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "vector": [8, 1, 0.3836, 0.0006, 1, 0.19, 0.9474, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Grasp complete!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L674_C4", "label": "return", "type": "return", "loc": [674, 674], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "vector": [13, 1, 0.3847, 0.0006, 1, 0.19, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return grasp, avg_list, col.collided, zeros"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L708_C0", "label": "display_grasp_data", "type": "function", "loc": [708, 801], "level": 0, "parent": null, "vector": [2, 0, 0.4307, 0.0537, 0, 0.66, 0.7462, 150, 0, 12, 0, 0, 0, 0, 37], "semantic": {"name": "display_grasp_data", "arg_names": ["grasps", "percept", "indicies", "std_dev", "noise_dev_add", "monitor_data", "std_dev_dict", "tol_thresh_dict", "model_zeros", "monitor_zeros", "plot_data", "colors"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def display_grasp_data(grasps, percept=\"accelerometer\", indicies=range(3), \n std_dev=STD_DEV, noise_dev_add=NOISE_DEV, monitor_data=[], \n std_dev_dict=STD_DEV_DICT,\n tol_thresh_dict=TOL_THRESH_DICT,\n model_zeros=None, monitor_zeros=None,\n plot_data=False, colors=None):\n import matplotlib.pyplot as plt\n if colors is None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Import_L714_C4", "label": "matplotlib.pyplot import plt", "type": "import", "loc": [714, 714], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L708_C0", "vector": [1, 1, 0.4075, 0.0006, 1, 0.37, 0.0, 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_99294:If_L715_C4", "label": "if", "type": "if", "loc": [715, 716], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L708_C0", "vector": [4, 1, 0.4084, 0.0011, 1, 0.37, 0.1667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if colors is None:\n colors = ['r', 'b', 'g', 'c']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L716_C8", "label": "colors =", "type": "assigned_variable", "loc": [716, 716], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L715_C4", "vector": [14, 2, 0.4087, 0.0006, 2, 0.55, 0.0, 656, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "colors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " colors = ['r', 'b', 'g', 'c']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L717_C4", "label": "j =", "type": "assigned_variable", "loc": [717, 717], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L708_C0", "vector": [14, 1, 0.4092, 0.0006, 1, 0.37, 0.3333, 100, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " j = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L718_C4", "label": "rows = len()", "type": "assigned_variable", "loc": [718, 718], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L708_C0", "vector": [14, 1, 0.4098, 0.0006, 1, 0.37, 0.5, 275, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "rows", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " rows = len(grasps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L719_C4", "label": "cols = len()", "type": "assigned_variable", "loc": [719, 719], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L708_C0", "vector": [14, 1, 0.4104, 0.0006, 1, 0.37, 0.6667, 876, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "cols", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " cols = len(indicies)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "label": "for i, grasp", "type": "for", "loc": [720, 799], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L708_C0", "vector": [6, 1, 0.4335, 0.0457, 1, 0.37, 0.8333, 333, 3, 0, 0, 0, 0, 0, 33], "semantic": {"name": "i, grasp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, grasp in enumerate(grasps):\n models = grasp[3]\n means = models[percept][\"mean\"]\n vars = models[percept][\"variance\"]\n maxs = models[percept][\"max\"]\n mins = models[percept][\"min\"]\n if \"smoothed_signals\" in models[percept]:\n signals = models[percept][\"smoothed_signals\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L721_C8", "label": "models =", "type": "assigned_variable", "loc": [721, 721], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "vector": [14, 2, 0.4115, 0.0006, 2, 0.19, 0.0, 495, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " models = grasp[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L722_C8", "label": "means =", "type": "assigned_variable", "loc": [722, 722], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "vector": [14, 2, 0.4121, 0.0006, 2, 0.19, 0.0625, 622, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "means", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " means = models[percept][\"mean\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L723_C8", "label": "vars =", "type": "assigned_variable", "loc": [723, 723], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "vector": [14, 2, 0.4127, 0.0006, 2, 0.19, 0.125, 302, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vars", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vars = models[percept][\"variance\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L724_C8", "label": "maxs =", "type": "assigned_variable", "loc": [724, 724], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "vector": [14, 2, 0.4132, 0.0006, 2, 0.19, 0.1875, 313, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "maxs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " maxs = models[percept][\"max\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L725_C8", "label": "mins =", "type": "assigned_variable", "loc": [725, 725], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "vector": [14, 2, 0.4138, 0.0006, 2, 0.19, 0.25, 606, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mins", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mins = models[percept][\"min\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L726_C8", "label": "if", "type": "if", "loc": [726, 731], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "vector": [4, 2, 0.4158, 0.0034, 2, 0.19, 0.3125, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if \"smoothed_signals\" in models[percept]:\n signals = models[percept][\"smoothed_signals\"]\n zip_signals = [ zip(*sig) for sig in signals ]\n else:\n signals = None\n zip_signals = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L727_C12", "label": "signals =", "type": "assigned_variable", "loc": [727, 727], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L726_C8", "vector": [14, 3, 0.415, 0.0006, 3, 0.05, 0.0, 415, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "signals", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " signals = models[percept][\"smoothed_signals\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L728_C12", "label": "zip_signals =", "type": "assigned_variable", "loc": [728, 728], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L726_C8", "vector": [14, 3, 0.4155, 0.0006, 3, 0.05, 0.3333, 85, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "zip_signals", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " zip_signals = [ zip(*sig) for sig in signals ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L730_C12", "label": "signals =", "type": "assigned_variable", "loc": [730, 730], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L726_C8", "vector": [14, 3, 0.4167, 0.0006, 3, 0.05, 0.6667, 415, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "signals", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " signals = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L731_C12", "label": "zip_signals =", "type": "assigned_variable", "loc": [731, 731], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L726_C8", "vector": [14, 3, 0.4172, 0.0006, 3, 0.05, 1.0, 85, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "zip_signals", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " zip_signals = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L732_C8", "label": "if", "type": "if", "loc": [732, 737], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "vector": [4, 2, 0.4192, 0.0034, 2, 0.19, 0.375, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if \"noise_variance\" in models[percept]:\n noise_var = models[percept][\"noise_variance\"]\n noise_dev = np.sqrt(noise_var)\n else:\n noise_var = None\n noise_dev = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L733_C12", "label": "noise_var =", "type": "assigned_variable", "loc": [733, 733], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L732_C8", "vector": [14, 3, 0.4184, 0.0006, 3, 0.87, 0.0, 393, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "noise_var", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " noise_var = models[percept][\"noise_variance\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L734_C12", "label": "noise_dev = sqrt()", "type": "assigned_variable", "loc": [734, 734], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L732_C8", "vector": [14, 3, 0.4189, 0.0006, 3, 0.87, 0.3333, 208, 3, 1, 0, 0, 259, 10, 1], "semantic": {"name": "noise_dev", "arg_names": [], "import_names": [], "rhs_call_name": "sqrt", "annotation": ""}, "snippet": " noise_dev = np.sqrt(noise_var)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L736_C12", "label": "noise_var =", "type": "assigned_variable", "loc": [736, 736], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L732_C8", "vector": [14, 3, 0.4201, 0.0006, 3, 0.87, 0.6667, 393, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "noise_var", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " noise_var = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L737_C12", "label": "noise_dev =", "type": "assigned_variable", "loc": [737, 737], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L732_C8", "vector": [14, 3, 0.4207, 0.0006, 3, 0.87, 1.0, 208, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "noise_dev", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " noise_dev = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L738_C8", "label": "print()", "type": "expression", "loc": [738, 738], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "vector": [8, 2, 0.4212, 0.0006, 2, 0.19, 0.4375, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"noise variance\", noise_var)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L740_C8", "label": "zip_means = array()", "type": "assigned_variable", "loc": [740, 740], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "vector": [14, 2, 0.4224, 0.0006, 2, 0.19, 0.5, 701, 3, 1, 0, 0, 80, 10, 2], "semantic": {"name": "zip_means", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " zip_means = np.array(zip(*means))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L741_C8", "label": "zip_vars = array()", "type": "assigned_variable", "loc": [741, 741], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "vector": [14, 2, 0.4229, 0.0006, 2, 0.19, 0.5625, 52, 3, 1, 0, 0, 80, 10, 2], "semantic": {"name": "zip_vars", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " zip_vars = np.array(zip(*vars))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L742_C8", "label": "zip_maxs = array()", "type": "assigned_variable", "loc": [742, 742], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "vector": [14, 2, 0.4235, 0.0006, 2, 0.19, 0.625, 631, 3, 1, 0, 0, 80, 10, 2], "semantic": {"name": "zip_maxs", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " zip_maxs = np.array(zip(*maxs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L743_C8", "label": "zip_mins = array()", "type": "assigned_variable", "loc": [743, 743], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "vector": [14, 2, 0.4241, 0.0006, 2, 0.19, 0.6875, 952, 3, 1, 0, 0, 80, 10, 2], "semantic": {"name": "zip_mins", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " zip_mins = np.array(zip(*mins))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L745_C8", "label": "zip_monitors =", "type": "assigned_variable", "loc": [745, 745], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "vector": [14, 2, 0.4252, 0.0006, 2, 0.19, 0.75, 636, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "zip_monitors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " zip_monitors = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L746_C8", "label": "for d", "type": "for", "loc": [746, 747], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "vector": [6, 2, 0.4261, 0.0011, 2, 0.19, 0.8125, 355, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for d in monitor_data:\n zip_monitors += [zip(*d[percept])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L748_C8", "label": "graph_means, graph_devs, mmax, mmin =", "type": "assigned_variable", "loc": [748, 748], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "vector": [14, 2, 0.4269, 0.0006, 2, 0.19, 0.875, 864, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "graph_means, graph_devs, mmax, mmin", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " graph_means, graph_devs, mmax, mmin = [], [], [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L749_C8", "label": "for w", "type": "for", "loc": [749, 763], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "vector": [6, 2, 0.4315, 0.0086, 2, 0.19, 0.9375, 549, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for w in indicies:\n graph_means += [zip_means[w]]\n graph_devs += [np.sqrt(zip_vars[w])]\n\n if std_dev_dict is not None and percept in std_dev_dict:\n std_dev = std_dev_dict[percept][w]\n if tol_thresh_dict is not None and percept in tol_thresh_dict:\n tol_thresh = tol_thresh_dict[percept][w]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L753_C12", "label": "if", "type": "if", "loc": [753, 754], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L749_C8", "vector": [4, 3, 0.4301, 0.0011, 3, 0.07, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if std_dev_dict is not None and percept in std_dev_dict:\n std_dev = std_dev_dict[percept][w]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L754_C16", "label": "std_dev =", "type": "assigned_variable", "loc": [754, 754], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L753_C12", "vector": [14, 4, 0.4304, 0.0006, 4, 0.04, 0.0, 784, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "std_dev", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " std_dev = std_dev_dict[percept][w]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L755_C12", "label": "if", "type": "if", "loc": [755, 758], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L749_C8", "vector": [4, 3, 0.4318, 0.0023, 3, 0.07, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tol_thresh_dict is not None and percept in tol_thresh_dict:\n tol_thresh = tol_thresh_dict[percept][w]\n else:\n tol_thresh = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L756_C16", "label": "tol_thresh =", "type": "assigned_variable", "loc": [756, 756], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L755_C12", "vector": [14, 4, 0.4315, 0.0006, 4, 0.51, 0.0, 420, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tol_thresh", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tol_thresh = tol_thresh_dict[percept][w]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L758_C16", "label": "tol_thresh =", "type": "assigned_variable", "loc": [758, 758], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L755_C12", "vector": [14, 4, 0.4326, 0.0006, 4, 0.51, 1.0, 420, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "tol_thresh", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tol_thresh = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L760_C12", "label": "if", "type": "if", "loc": [760, 763], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L749_C8", "vector": [4, 3, 0.4346, 0.0023, 3, 0.07, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if noise_dev is not None:\n noise_dev_term = noise_dev[w] * noise_dev_add\n else:\n noise_dev_term = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L761_C16", "label": "noise_dev_term =", "type": "assigned_variable", "loc": [761, 761], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L760_C12", "vector": [14, 4, 0.4344, 0.0006, 4, 0.8, 0.0, 349, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "noise_dev_term", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " noise_dev_term = noise_dev[w] * noise_dev_add"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L763_C16", "label": "noise_dev_term =", "type": "assigned_variable", "loc": [763, 763], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L760_C12", "vector": [14, 4, 0.4355, 0.0006, 4, 0.8, 1.0, 349, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "noise_dev_term", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " noise_dev_term = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L771_C8", "label": "for k", "type": "for", "loc": [771, 798], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "vector": [6, 2, 0.4478, 0.016, 2, 0.19, 1.0, 954, 3, 0, 0, 0, 0, 0, 19], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in range(len(indicies)):\n plt.subplot(rows, cols, i*cols + 1 + k)\n cnum = 0\n if plot_data:\n for stream in grasp[2][percept]:\n # s_mag = [np.sqrt(x[1][0]**2 + x[1][1]**2 + x[1][2]**2) for x in stream]\n # plt.plot(s_mag,colors[cnum])\n plt.plot([x[1][k] for x in stream],colors[cnum])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L772_C12", "label": "subplot()", "type": "expression", "loc": [772, 772], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L771_C8", "vector": [8, 3, 0.4406, 0.0006, 3, 0.92, 0.0, 905, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "subplot", "arg_names": [], "import_names": [], "rhs_call_name": "subplot", "annotation": ""}, "snippet": " plt.subplot(rows, cols, i*cols + 1 + k)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L773_C12", "label": "cnum =", "type": "assigned_variable", "loc": [773, 773], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L771_C8", "vector": [14, 3, 0.4412, 0.0006, 3, 0.92, 0.125, 767, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "cnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cnum = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L774_C12", "label": "if", "type": "if", "loc": [774, 780], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L771_C8", "vector": [4, 3, 0.4435, 0.004, 3, 0.92, 0.25, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_data:\n for stream in grasp[2][percept]:\n # s_mag = [np.sqrt(x[1][0]**2 + x[1][1]**2 + x[1][2]**2) for x in stream]\n # plt.plot(s_mag,colors[cnum])\n plt.plot([x[1][k] for x in stream],colors[cnum])\n cnum += 1\n cnum %= len(colors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L775_C16", "label": "for stream", "type": "for", "loc": [775, 780], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L774_C12", "vector": [6, 4, 0.4438, 0.0034, 4, 0.27, 0.0, 517, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "stream", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for stream in grasp[2][percept]:\n # s_mag = [np.sqrt(x[1][0]**2 + x[1][1]**2 + x[1][2]**2) for x in stream]\n # plt.plot(s_mag,colors[cnum])\n plt.plot([x[1][k] for x in stream],colors[cnum])\n cnum += 1\n cnum %= len(colors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L778_C20", "label": "plot()", "type": "expression", "loc": [778, 778], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L775_C16", "vector": [8, 5, 0.4441, 0.0006, 5, 0.12, 0.0, 929, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " plt.plot([x[1][k] for x in stream],colors[cnum])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L781_C12", "label": "for sig", "type": "for", "loc": [781, 783], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L771_C8", "vector": [6, 3, 0.4463, 0.0017, 3, 0.92, 0.375, 899, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "sig", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for sig in zip_signals:\n if indicies[k] < len(sig):\n plt.plot(sig[indicies[k]], colors[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L782_C16", "label": "if", "type": "if", "loc": [782, 783], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L781_C12", "vector": [4, 4, 0.4466, 0.0011, 4, 0.69, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if indicies[k] < len(sig):\n plt.plot(sig[indicies[k]], colors[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L783_C20", "label": "plot()", "type": "expression", "loc": [783, 783], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L782_C16", "vector": [8, 5, 0.4469, 0.0006, 5, 0.45, 0.0, 929, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " plt.plot(sig[indicies[k]], colors[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L784_C12", "label": "if", "type": "if", "loc": [784, 792], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L771_C8", "vector": [4, 3, 0.4498, 0.0051, 3, 0.92, 0.5, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i < len(zip_monitors):\n zip_monitor = zip_monitors[i]\n len_diff = len(graph_means[k]) - len(zip_monitor[indicies[k]])\n add_vals = [zip_monitor[indicies[k]][0]] * MONITOR_WINDOW\n # add_vals = [zip_monitor[indicies[k]][0]] * len_diff\n print(len_diff)\n g = np.array(add_vals + list(zip_monitor[indicies[k]]))\n # g += grasp[4][percept][indicies[k]] - monitor_zeros[i][percept][indicies[k]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L785_C16", "label": "zip_monitor =", "type": "assigned_variable", "loc": [785, 785], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L784_C12", "vector": [14, 4, 0.4481, 0.0006, 4, 0.66, 0.0, 902, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "zip_monitor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " zip_monitor = zip_monitors[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L786_C16", "label": "len_diff =", "type": "assigned_variable", "loc": [786, 786], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L784_C12", "vector": [14, 4, 0.4486, 0.0006, 4, 0.66, 0.2, 387, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "len_diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " len_diff = len(graph_means[k]) - len(zip_monitor[indicies[k]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L787_C16", "label": "add_vals =", "type": "assigned_variable", "loc": [787, 787], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L784_C12", "vector": [14, 4, 0.4492, 0.0006, 4, 0.66, 0.4, 808, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "add_vals", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " add_vals = [zip_monitor[indicies[k]][0]] * MONITOR_WINDOW"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L789_C16", "label": "print()", "type": "expression", "loc": [789, 789], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L784_C12", "vector": [8, 4, 0.4503, 0.0006, 4, 0.66, 0.6, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(len_diff)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L790_C16", "label": "g = array()", "type": "assigned_variable", "loc": [790, 790], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L784_C12", "vector": [14, 4, 0.4509, 0.0006, 4, 0.66, 0.8, 384, 3, 1, 0, 0, 80, 10, 2], "semantic": {"name": "g", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " g = np.array(add_vals + list(zip_monitor[indicies[k]]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L792_C16", "label": "plot()", "type": "expression", "loc": [792, 792], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L784_C12", "vector": [8, 4, 0.4521, 0.0006, 4, 0.66, 1.0, 929, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " plt.plot(g.tolist(),colors[3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L793_C12", "label": "plot()", "type": "expression", "loc": [793, 793], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L771_C8", "vector": [8, 3, 0.4526, 0.0006, 3, 0.92, 0.625, 929, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " plt.plot(graph_means[k], colors[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L794_C12", "label": "plot()", "type": "expression", "loc": [794, 794], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L771_C8", "vector": [8, 3, 0.4532, 0.0006, 3, 0.92, 0.75, 929, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " plt.plot(zip_maxs[indicies[k]], colors[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L795_C12", "label": "plot()", "type": "expression", "loc": [795, 795], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L771_C8", "vector": [8, 3, 0.4538, 0.0006, 3, 0.92, 0.875, 929, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " plt.plot(zip_mins[indicies[k]], colors[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L798_C12", "label": "title()", "type": "expression", "loc": [798, 798], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L771_C8", "vector": [8, 3, 0.4555, 0.0006, 3, 0.92, 1.0, 48, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "title", "arg_names": [], "import_names": [], "rhs_call_name": "title", "annotation": ""}, "snippet": " plt.title(\"%1.2f, %1.2f: coord %d\" % (grasp[0][0], grasp[0][1], k))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L801_C4", "label": "show()", "type": "expression", "loc": [801, 801], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L708_C0", "vector": [8, 1, 0.4572, 0.0006, 1, 0.37, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " plt.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L803_C0", "label": "die", "type": "function", "loc": [803, 804], "level": 0, "parent": null, "vector": [2, 0, 0.4586, 0.0011, 0, 0.66, 0.7538, 952, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "die", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def die():\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L804_C4", "label": "exit()", "type": "expression", "loc": [804, 804], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L803_C0", "vector": [8, 1, 0.4589, 0.0006, 1, 0.72, 0.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_99294:FunctionDef_L806_C0", "label": "test_num_samples", "type": "function", "loc": [806, 825], "level": 0, "parent": null, "vector": [2, 0, 0.4655, 0.0114, 0, 0.66, 0.7615, 539, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "test_num_samples", "arg_names": ["percept"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def test_num_samples(percept=\"accelerometer\"):\n # This function proves that adding more than 3-4 grasps per location is unnecessary\n # Grasping trajectories are very repeatable given a specific grasping location.\n # The issue comes from more from shifting of the actual trajectory from expected\n # given a grasping location just a few cm off. The models can handle the trajectory\n # so long as it is not much more than 5cm away from the training model.\n\n grasp_data = load_pickle(GRASP_DATA_FILE)[0:1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L813_C4", "label": "grasp_data =", "type": "assigned_variable", "loc": [813, 813], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L806_C0", "vector": [14, 1, 0.464, 0.0006, 1, 0.0, 0.0, 717, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "grasp_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_data = load_pickle(GRASP_DATA_FILE)[0:1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L814_C4", "label": "data_list =", "type": "assigned_variable", "loc": [814, 814], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L806_C0", "vector": [14, 1, 0.4646, 0.0006, 1, 0.0, 0.5, 390, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "data_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_list = grasp_data[0][2][percept]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L815_C4", "label": "for i", "type": "for", "loc": [815, 825], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L806_C0", "vector": [6, 1, 0.468, 0.0063, 1, 0.0, 1.0, 826, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in [3, 6, 9]:\n apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_MON_LIST)\n grasp_data[0][2][percept] = data_list[0:i+1]\n apm.datasets = grasp_data[0][2]\n apm.generate_models()\n grasp_data[0][3][percept] = apm.models[percept]\n if i != 3:\n colors = ['m', 'y', 'k', 'r']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L816_C8", "label": "apm = ArmPerceptionMonitor()", "type": "assigned_variable", "loc": [816, 816], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L815_C4", "vector": [14, 2, 0.4658, 0.0006, 2, 0.6, 0.0, 21, 3, 2, 0, 0, 815, 10, 1], "semantic": {"name": "apm", "arg_names": [], "import_names": [], "rhs_call_name": "ArmPerceptionMonitor", "annotation": ""}, "snippet": " apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_MON_LIST)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L817_C8", "label": "assign", "type": "assigned_variable", "loc": [817, 817], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L815_C4", "vector": [14, 2, 0.4663, 0.0006, 2, 0.6, 0.1667, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_data[0][2][percept] = data_list[0:i+1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L818_C8", "label": "apm.datasets =", "type": "assigned_variable", "loc": [818, 818], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L815_C4", "vector": [14, 2, 0.4669, 0.0006, 2, 0.6, 0.3333, 72, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "apm.datasets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " apm.datasets = grasp_data[0][2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L819_C8", "label": "generate_models()", "type": "expression", "loc": [819, 819], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L815_C4", "vector": [8, 2, 0.4675, 0.0006, 2, 0.6, 0.5, 956, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "generate_models", "arg_names": [], "import_names": [], "rhs_call_name": "generate_models", "annotation": ""}, "snippet": " apm.generate_models()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L820_C8", "label": "assign", "type": "assigned_variable", "loc": [820, 820], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L815_C4", "vector": [14, 2, 0.468, 0.0006, 2, 0.6, 0.6667, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_data[0][3][percept] = apm.models[percept]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L821_C8", "label": "if", "type": "if", "loc": [821, 824], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L815_C4", "vector": [4, 2, 0.4695, 0.0023, 2, 0.6, 0.8333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i != 3:\n colors = ['m', 'y', 'k', 'r']\n else:\n colors = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L822_C12", "label": "colors =", "type": "assigned_variable", "loc": [822, 822], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L821_C8", "vector": [14, 3, 0.4692, 0.0006, 3, 0.07, 0.0, 656, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "colors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " colors = ['m', 'y', 'k', 'r']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L824_C12", "label": "colors =", "type": "assigned_variable", "loc": [824, 824], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L821_C8", "vector": [14, 3, 0.4703, 0.0006, 3, 0.07, 1.0, 656, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "colors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " colors = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L825_C8", "label": "display_grasp_data()", "type": "expression", "loc": [825, 825], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L815_C4", "vector": [8, 2, 0.4709, 0.0006, 2, 0.6, 1.0, 150, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "display_grasp_data", "arg_names": [], "import_names": [], "rhs_call_name": "display_grasp_data", "annotation": ""}, "snippet": " display_grasp_data(grasp_data, percept, rows=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L827_C0", "label": "detect_tabletop_objects", "type": "function", "loc": [827, 852], "level": 0, "parent": null, "vector": [2, 0, 0.4792, 0.0148, 0, 0.66, 0.7692, 463, 0, 0, 1, 0, 0, 0, 11], "semantic": {"name": "detect_tabletop_objects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def detect_tabletop_objects():\n cbbf = ClusterBoundingBoxFinder()\n object_detector = rospy.ServiceProxy(\"/object_detection\", TabletopDetection)\n detects = object_detector(True, False).detection\n object_detector.close()\n if detects.result != 4:\n print(\"Detection failed (err %d)\" % (detects.result))\n return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L828_C4", "label": "cbbf = ClusterBoundingBoxFinder()", "type": "assigned_variable", "loc": [828, 828], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L827_C0", "vector": [14, 1, 0.4726, 0.0006, 1, 0.37, 0.0, 428, 3, 0, 0, 0, 518, 10, 1], "semantic": {"name": "cbbf", "arg_names": [], "import_names": [], "rhs_call_name": "ClusterBoundingBoxFinder", "annotation": ""}, "snippet": " cbbf = ClusterBoundingBoxFinder()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L829_C4", "label": "object_detector = ServiceProxy()", "type": "assigned_variable", "loc": [829, 829], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L827_C0", "vector": [14, 1, 0.4732, 0.0006, 1, 0.37, 0.125, 484, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "object_detector", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " object_detector = rospy.ServiceProxy(\"/object_detection\", TabletopDetection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L830_C4", "label": "detects =", "type": "assigned_variable", "loc": [830, 830], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L827_C0", "vector": [14, 1, 0.4737, 0.0006, 1, 0.37, 0.25, 200, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "detects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " detects = object_detector(True, False).detection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L831_C4", "label": "close()", "type": "expression", "loc": [831, 831], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L827_C0", "vector": [8, 1, 0.4743, 0.0006, 1, 0.37, 0.375, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " object_detector.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L832_C4", "label": "if", "type": "if", "loc": [832, 834], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L827_C0", "vector": [4, 1, 0.4755, 0.0017, 1, 0.37, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if detects.result != 4:\n print(\"Detection failed (err %d)\" % (detects.result))\n return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L833_C8", "label": "print()", "type": "expression", "loc": [833, 833], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L832_C4", "vector": [8, 2, 0.4755, 0.0006, 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(\"Detection failed (err %d)\" % (detects.result))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L834_C8", "label": "return", "type": "return", "loc": [834, 834], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L832_C4", "vector": [13, 2, 0.476, 0.0006, 2, 0.09, 1.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L835_C4", "label": "table_z =", "type": "assigned_variable", "loc": [835, 835], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L827_C0", "vector": [14, 1, 0.4766, 0.0006, 1, 0.37, 0.625, 93, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "table_z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " table_z = detects.table.pose.pose.position.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L836_C4", "label": "objects =", "type": "assigned_variable", "loc": [836, 836], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L827_C0", "vector": [14, 1, 0.4772, 0.0006, 1, 0.37, 0.75, 550, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "objects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " objects = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L837_C4", "label": "for cluster", "type": "for", "loc": [837, 851], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L827_C0", "vector": [6, 1, 0.4817, 0.0086, 1, 0.37, 0.875, 446, 7, 0, 0, 0, 0, 0, 6], "semantic": {"name": "cluster", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for cluster in detects.clusters:\n (object_points, \n object_bounding_box_dims, \n object_bounding_box, \n object_to_base_link_frame, \n object_to_cluster_frame) = cbbf.find_object_frame_and_bounding_box(cluster)\n # print \"bounding box:\", object_bounding_box\n (object_pos, object_quat) = cf.mat_to_pos_and_quat(object_to_cluster_frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L838_C8", "label": "object_points, object_bounding_box_dims, object_bounding_box, object_to_base_link_frame, object_to_cluster_frame = find_object_frame_and_bounding_box()", "type": "assigned_variable", "loc": [838, 842], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L837_C4", "vector": [14, 2, 0.4795, 0.0029, 2, 0.38, 0.0, 499, 3, 1, 0, 0, 584, 10, 1], "semantic": {"name": "object_points, object_bounding_box_dims, object_bounding_box, object_to_base_link_frame, object_to_cluster_frame", "arg_names": [], "import_names": [], "rhs_call_name": "find_object_frame_and_bounding_box", "annotation": ""}, "snippet": " (object_points, \n object_bounding_box_dims, \n object_bounding_box, \n object_to_base_link_frame, \n object_to_cluster_frame) = cbbf.find_object_frame_and_bounding_box(cluster)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L844_C8", "label": "object_pos, object_quat = mat_to_pos_and_quat()", "type": "assigned_variable", "loc": [844, 844], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L837_C4", "vector": [14, 2, 0.4817, 0.0006, 2, 0.38, 0.1667, 564, 3, 1, 0, 0, 711, 10, 1], "semantic": {"name": "object_pos, object_quat", "arg_names": [], "import_names": [], "rhs_call_name": "mat_to_pos_and_quat", "annotation": ""}, "snippet": " (object_pos, object_quat) = cf.mat_to_pos_and_quat(object_to_cluster_frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L845_C8", "label": "angs = euler_from_quaternion()", "type": "assigned_variable", "loc": [845, 845], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L837_C4", "vector": [14, 2, 0.4823, 0.0006, 2, 0.38, 0.3333, 510, 3, 1, 0, 0, 409, 10, 1], "semantic": {"name": "angs", "arg_names": [], "import_names": [], "rhs_call_name": "euler_from_quaternion", "annotation": ""}, "snippet": " angs = euler_from_quaternion(object_quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L846_C8", "label": "print()", "type": "expression", "loc": [846, 846], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L837_C4", "vector": [8, 2, 0.4829, 0.0006, 2, 0.38, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"angs:\", angs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L848_C8", "label": "assign", "type": "assigned_variable", "loc": [848, 848], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L837_C4", "vector": [14, 2, 0.484, 0.0006, 2, 0.38, 0.6667, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " object_pos[2] = table_z + object_bounding_box[1][2] / 2. + DETECT_ERROR"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L849_C8", "label": "print()", "type": "expression", "loc": [849, 849], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L837_C4", "vector": [8, 2, 0.4846, 0.0006, 2, 0.38, 0.8333, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"pos:\", object_pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L850_C8", "label": "print()", "type": "expression", "loc": [850, 850], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L837_C4", "vector": [8, 2, 0.4852, 0.0006, 2, 0.38, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"table_z:\", table_z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L852_C4", "label": "return", "type": "return", "loc": [852, 852], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L827_C0", "vector": [13, 1, 0.4863, 0.0006, 1, 0.37, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return objects"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L854_C0", "label": "grasp_object", "type": "function", "loc": [854, 860], "level": 0, "parent": null, "vector": [2, 0, 0.4892, 0.004, 0, 0.66, 0.7769, 428, 0, 7, 1, 0, 0, 0, 2], "semantic": {"name": "grasp_object", "arg_names": ["obj", "grasp", "collide", "is_place", "zeros", "cm", "apm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def grasp_object(obj, grasp=None, collide=True, is_place=False, zeros=None, cm=None, apm=None):\n if collide:\n return perform_grasp(obj[0][0], obj[0][1], is_place=is_place,\n gripper_rot=obj[1], grasp=grasp, zeros=zeros, cm=cm, apm=apm)\n else:\n return perform_grasp(obj[0][0], obj[0][1], z=obj[0][2], is_place=is_place,\n gripper_rot=obj[1], grasp=grasp, zeros=zeros, cm=cm, apm=apm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L855_C4", "label": "if", "type": "if", "loc": [855, 860], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L854_C0", "vector": [4, 1, 0.4894, 0.0034, 1, 0.73, 0.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if collide:\n return perform_grasp(obj[0][0], obj[0][1], is_place=is_place,\n gripper_rot=obj[1], grasp=grasp, zeros=zeros, cm=cm, apm=apm)\n else:\n return perform_grasp(obj[0][0], obj[0][1], z=obj[0][2], is_place=is_place,\n gripper_rot=obj[1], grasp=grasp, zeros=zeros, cm=cm, apm=apm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L856_C8", "label": "return", "type": "return", "loc": [856, 857], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L855_C4", "vector": [13, 2, 0.4889, 0.0011, 2, 0.66, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return perform_grasp(obj[0][0], obj[0][1], is_place=is_place,\n gripper_rot=obj[1], grasp=grasp, zeros=zeros, cm=cm, apm=apm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L859_C8", "label": "return", "type": "return", "loc": [859, 860], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L855_C4", "vector": [13, 2, 0.4906, 0.0011, 2, 0.66, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return perform_grasp(obj[0][0], obj[0][1], z=obj[0][2], is_place=is_place,\n gripper_rot=obj[1], grasp=grasp, zeros=zeros, cm=cm, apm=apm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L862_C0", "label": "grasp_closest_object", "type": "function", "loc": [862, 913], "level": 0, "parent": null, "vector": [2, 0, 0.5066, 0.0297, 0, 0.66, 0.7846, 670, 0, 8, 1, 0, 0, 0, 25], "semantic": {"name": "grasp_closest_object", "arg_names": ["x", "y", "grasp", "collide", "repeat", "zeros", "cm", "apm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def grasp_closest_object(x, y, grasp=None, collide=True, repeat=True, zeros=None, cm=None, apm=None):\n def dist(o):\n return (o[0][0] - x) ** 2 + (o[0][1] - y) ** 2\n\n grasped = False\n num_tries = 0\n\n point_head([x,y,-0.2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L863_C4", "label": "dist", "type": "function", "loc": [863, 864], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L862_C0", "vector": [2, 1, 0.4929, 0.0011, 1, 0.64, 0.0, 673, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "dist", "arg_names": ["o"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def dist(o):\n return (o[0][0] - x) ** 2 + (o[0][1] - y) ** 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L864_C8", "label": "return", "type": "return", "loc": [864, 864], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L863_C4", "vector": [13, 2, 0.4932, 0.0006, 2, 0.98, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (o[0][0] - x) ** 2 + (o[0][1] - y) ** 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L866_C4", "label": "grasped =", "type": "assigned_variable", "loc": [866, 866], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L862_C0", "vector": [14, 1, 0.4943, 0.0006, 1, 0.64, 0.25, 785, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "grasped", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasped = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L867_C4", "label": "num_tries =", "type": "assigned_variable", "loc": [867, 867], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L862_C0", "vector": [14, 1, 0.4949, 0.0006, 1, 0.64, 0.5, 388, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "num_tries", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " num_tries = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L869_C4", "label": "point_head()", "type": "expression", "loc": [869, 869], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L862_C0", "vector": [8, 1, 0.496, 0.0006, 1, 0.64, 0.75, 553, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "point_head", "arg_names": [], "import_names": [], "rhs_call_name": "point_head", "annotation": ""}, "snippet": " point_head([x,y,-0.2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L871_C4", "label": "while", "type": "while", "loc": [871, 913], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L862_C0", "vector": [5, 1, 0.5091, 0.0245, 1, 0.64, 1.0, 0, 0, 0, 0, 0, 0, 0, 24], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not grasped and num_tries < 4:\n print(\"Detect in\")\n change_projector_mode(True)\n rospy.sleep(0.6)\n detect_tries = 0\n objects = None\n while (objects is None or len(objects) == 0):\n objects = detect_tabletop_objects()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L872_C8", "label": "print()", "type": "expression", "loc": [872, 872], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L871_C4", "vector": [8, 2, 0.4977, 0.0006, 2, 0.91, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Detect in\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L873_C8", "label": "change_projector_mode()", "type": "expression", "loc": [873, 873], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L871_C4", "vector": [8, 2, 0.4983, 0.0006, 2, 0.91, 0.1429, 446, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "change_projector_mode", "arg_names": [], "import_names": [], "rhs_call_name": "change_projector_mode", "annotation": ""}, "snippet": " change_projector_mode(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L874_C8", "label": "sleep()", "type": "expression", "loc": [874, 874], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L871_C4", "vector": [8, 2, 0.4989, 0.0006, 2, 0.91, 0.2857, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(0.6)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L875_C8", "label": "detect_tries =", "type": "assigned_variable", "loc": [875, 875], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L871_C4", "vector": [14, 2, 0.4994, 0.0006, 2, 0.91, 0.4286, 616, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "detect_tries", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " detect_tries = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L876_C8", "label": "objects =", "type": "assigned_variable", "loc": [876, 876], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L871_C4", "vector": [14, 2, 0.5, 0.0006, 2, 0.91, 0.5714, 550, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "objects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " objects = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L877_C8", "label": "while", "type": "while", "loc": [877, 883], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L871_C4", "vector": [5, 2, 0.5023, 0.004, 2, 0.91, 0.7143, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while (objects is None or len(objects) == 0):\n objects = detect_tabletop_objects()\n rospy.sleep(0.6)\n detect_tries += 1\n if detect_tries == 3 and (objects is None or len(objects) == 0):\n print(\"Cannot detect any objects\")\n return None, None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L878_C12", "label": "objects = detect_tabletop_objects()", "type": "assigned_variable", "loc": [878, 878], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L877_C8", "vector": [14, 3, 0.5011, 0.0006, 3, 0.32, 0.0, 550, 3, 0, 0, 0, 463, 10, 1], "semantic": {"name": "objects", "arg_names": [], "import_names": [], "rhs_call_name": "detect_tabletop_objects", "annotation": ""}, "snippet": " objects = detect_tabletop_objects()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L879_C12", "label": "sleep()", "type": "expression", "loc": [879, 879], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L877_C8", "vector": [8, 3, 0.5017, 0.0006, 3, 0.32, 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.6)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L881_C12", "label": "if", "type": "if", "loc": [881, 883], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L877_C8", "vector": [4, 3, 0.5034, 0.0017, 3, 0.32, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if detect_tries == 3 and (objects is None or len(objects) == 0):\n print(\"Cannot detect any objects\")\n return None, None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L882_C16", "label": "print()", "type": "expression", "loc": [882, 882], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L881_C12", "vector": [8, 4, 0.5034, 0.0006, 4, 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(\"Cannot detect any objects\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L883_C16", "label": "return", "type": "return", "loc": [883, 883], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L881_C12", "vector": [13, 4, 0.504, 0.0006, 4, 0.34, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L884_C8", "label": "print()", "type": "expression", "loc": [884, 884], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L871_C4", "vector": [8, 2, 0.5046, 0.0006, 2, 0.91, 0.8571, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Detect out\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L885_C8", "label": "if", "type": "if", "loc": [885, 913], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L871_C4", "vector": [4, 2, 0.5131, 0.0166, 2, 0.91, 1.0, 0, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(objects) > 0:\n obj = min(objects, key=dist)\n\n # Get better look\n if True:\n point_head(obj[0])\n rospy.sleep(0.2)\n print(\"Detect2 in\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L886_C12", "label": "obj = min()", "type": "assigned_variable", "loc": [886, 886], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L885_C8", "vector": [14, 3, 0.5057, 0.0006, 3, 0.53, 0.0, 505, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " obj = min(objects, key=dist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L889_C12", "label": "if", "type": "if", "loc": [889, 895], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L885_C8", "vector": [4, 3, 0.5091, 0.004, 3, 0.53, 0.1111, 0, 1, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if True:\n point_head(obj[0])\n rospy.sleep(0.2)\n print(\"Detect2 in\")\n objects = detect_tabletop_objects()\n print(\"Detect2 out\")\n obj = min(objects, key=dist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L890_C16", "label": "point_head()", "type": "expression", "loc": [890, 890], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L889_C12", "vector": [8, 4, 0.508, 0.0006, 4, 0.46, 0.0, 553, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "point_head", "arg_names": [], "import_names": [], "rhs_call_name": "point_head", "annotation": ""}, "snippet": " point_head(obj[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L891_C16", "label": "sleep()", "type": "expression", "loc": [891, 891], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L889_C12", "vector": [8, 4, 0.5086, 0.0006, 4, 0.46, 0.2, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(0.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L892_C16", "label": "print()", "type": "expression", "loc": [892, 892], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L889_C12", "vector": [8, 4, 0.5091, 0.0006, 4, 0.46, 0.4, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Detect2 in\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L893_C16", "label": "objects = detect_tabletop_objects()", "type": "assigned_variable", "loc": [893, 893], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L889_C12", "vector": [14, 4, 0.5097, 0.0006, 4, 0.46, 0.6, 550, 3, 0, 0, 0, 463, 10, 1], "semantic": {"name": "objects", "arg_names": [], "import_names": [], "rhs_call_name": "detect_tabletop_objects", "annotation": ""}, "snippet": " objects = detect_tabletop_objects()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L894_C16", "label": "print()", "type": "expression", "loc": [894, 894], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L889_C12", "vector": [8, 4, 0.5103, 0.0006, 4, 0.46, 0.8, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Detect2 out\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L895_C16", "label": "obj = min()", "type": "assigned_variable", "loc": [895, 895], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L889_C12", "vector": [14, 4, 0.5108, 0.0006, 4, 0.46, 1.0, 505, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " obj = min(objects, key=dist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L897_C12", "label": "change_projector_mode()", "type": "expression", "loc": [897, 897], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L885_C8", "vector": [8, 3, 0.512, 0.0006, 3, 0.53, 0.2222, 446, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "change_projector_mode", "arg_names": [], "import_names": [], "rhs_call_name": "change_projector_mode", "annotation": ""}, "snippet": " change_projector_mode(False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L898_C12", "label": "grasp, avg_list, collided, zeros = grasp_object()", "type": "assigned_variable", "loc": [898, 899], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L885_C8", "vector": [14, 3, 0.5128, 0.0011, 3, 0.53, 0.3333, 88, 3, 6, 0, 0, 428, 10, 1], "semantic": {"name": "grasp, avg_list, collided, zeros", "arg_names": [], "import_names": [], "rhs_call_name": "grasp_object", "annotation": ""}, "snippet": " (grasp, avg_list, collided, zeros) = grasp_object(obj, grasp=grasp, \n collide=collide, zeros=zeros, cm=cm, apm=apm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L900_C12", "label": "sleep()", "type": "expression", "loc": [900, 900], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L885_C8", "vector": [8, 3, 0.5137, 0.0006, 3, 0.53, 0.4444, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(0.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L901_C12", "label": "grasped = is_obj_in_gripper()", "type": "assigned_variable", "loc": [901, 901], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L885_C8", "vector": [14, 3, 0.5143, 0.0006, 3, 0.53, 0.5556, 785, 3, 1, 0, 0, 969, 10, 1], "semantic": {"name": "grasped", "arg_names": [], "import_names": [], "rhs_call_name": "is_obj_in_gripper", "annotation": ""}, "snippet": " grasped = is_obj_in_gripper(cm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L902_C12", "label": "if", "type": "if", "loc": [902, 904], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L885_C8", "vector": [4, 3, 0.5154, 0.0017, 3, 0.53, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if repeat and not grasped:\n num_tries += 1\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L905_C12", "label": "if", "type": "if", "loc": [905, 910], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L885_C8", "vector": [4, 3, 0.518, 0.0034, 3, 0.53, 0.7778, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if grasped:\n print(\"Grasp success!\")\n return obj, grasp, avg_list, collided, zeros\n else:\n print(\"Grasp failure\")\n return obj, grasp, avg_list, collided, zeros"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L906_C16", "label": "print()", "type": "expression", "loc": [906, 906], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L905_C12", "vector": [8, 4, 0.5171, 0.0006, 4, 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(\"Grasp success!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L907_C16", "label": "return", "type": "return", "loc": [907, 907], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L905_C12", "vector": [13, 4, 0.5177, 0.0006, 4, 0.86, 0.3333, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return obj, grasp, avg_list, collided, zeros"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L909_C16", "label": "print()", "type": "expression", "loc": [909, 909], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L905_C12", "vector": [8, 4, 0.5188, 0.0006, 4, 0.86, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Grasp failure\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L910_C16", "label": "return", "type": "return", "loc": [910, 910], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L905_C12", "vector": [13, 4, 0.5194, 0.0006, 4, 0.86, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return obj, grasp, avg_list, collided, zeros"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L912_C12", "label": "print()", "type": "expression", "loc": [912, 912], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L885_C8", "vector": [8, 3, 0.5205, 0.0006, 3, 0.53, 0.8889, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"No objects near point\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L913_C12", "label": "return", "type": "return", "loc": [913, 913], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L885_C8", "vector": [13, 3, 0.5211, 0.0006, 3, 0.53, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "label": "grasp_demo", "type": "function", "loc": [915, 939], "level": 0, "parent": null, "vector": [2, 0, 0.5291, 0.0143, 0, 0.66, 0.7923, 560, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "grasp_demo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def grasp_demo():\n cm = ControllerManager(armc)\n apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_MON_LIST)\n grasps, avg_lists = [], []\n (obj1, grasp, avg_list, collided, zeros) = grasp_closest_object(0.45, 0.1, cm=cm, apm=apm)\n grasps += [grasp]\n avg_lists += [avg_list]\n obj1pl = [[obj1[0][0], obj1[0][1] - 0.18], obj1[1]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L916_C4", "label": "cm = ControllerManager()", "type": "assigned_variable", "loc": [916, 916], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "vector": [14, 1, 0.5228, 0.0006, 1, 0.92, 0.0, 675, 3, 1, 0, 0, 16, 10, 1], "semantic": {"name": "cm", "arg_names": [], "import_names": [], "rhs_call_name": "ControllerManager", "annotation": ""}, "snippet": " cm = ControllerManager(armc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L917_C4", "label": "apm = ArmPerceptionMonitor()", "type": "assigned_variable", "loc": [917, 917], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "vector": [14, 1, 0.5234, 0.0006, 1, 0.92, 0.0909, 21, 3, 2, 0, 0, 815, 10, 1], "semantic": {"name": "apm", "arg_names": [], "import_names": [], "rhs_call_name": "ArmPerceptionMonitor", "annotation": ""}, "snippet": " apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_MON_LIST)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L918_C4", "label": "grasps, avg_lists =", "type": "assigned_variable", "loc": [918, 918], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "vector": [14, 1, 0.524, 0.0006, 1, 0.92, 0.1818, 558, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "grasps, avg_lists", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasps, avg_lists = [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L919_C4", "label": "obj1, grasp, avg_list, collided, zeros = grasp_closest_object()", "type": "assigned_variable", "loc": [919, 919], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "vector": [14, 1, 0.5245, 0.0006, 1, 0.92, 0.2727, 319, 3, 4, 0, 0, 670, 10, 1], "semantic": {"name": "obj1, grasp, avg_list, collided, zeros", "arg_names": [], "import_names": [], "rhs_call_name": "grasp_closest_object", "annotation": ""}, "snippet": " (obj1, grasp, avg_list, collided, zeros) = grasp_closest_object(0.45, 0.1, cm=cm, apm=apm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L922_C4", "label": "obj1pl =", "type": "assigned_variable", "loc": [922, 922], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "vector": [14, 1, 0.5263, 0.0006, 1, 0.92, 0.3636, 244, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "obj1pl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " obj1pl = [[obj1[0][0], obj1[0][1] - 0.18], obj1[1]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L923_C4", "label": "grasp, avg_list, collided, zeros = grasp_object()", "type": "assigned_variable", "loc": [923, 923], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "vector": [14, 1, 0.5268, 0.0006, 1, 0.92, 0.4545, 88, 3, 5, 0, 0, 428, 10, 1], "semantic": {"name": "grasp, avg_list, collided, zeros", "arg_names": [], "import_names": [], "rhs_call_name": "grasp_object", "annotation": ""}, "snippet": " (grasp, avg_list, collided, zeros) = grasp_object(obj1pl, is_place=True, zeros=zeros, cm=cm, apm=apm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L926_C4", "label": "obj2, grasp, avg_list, collided, zeros = grasp_closest_object()", "type": "assigned_variable", "loc": [926, 926], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "vector": [14, 1, 0.5285, 0.0006, 1, 0.92, 0.5455, 812, 3, 5, 0, 0, 670, 10, 1], "semantic": {"name": "obj2, grasp, avg_list, collided, zeros", "arg_names": [], "import_names": [], "rhs_call_name": "grasp_closest_object", "annotation": ""}, "snippet": " (obj2, grasp, avg_list, collided, zeros) = grasp_closest_object(0.7, 0.1, zeros=zeros, cm=cm, apm=apm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L929_C4", "label": "grasp, avg_list, collided, zeros = grasp_object()", "type": "assigned_variable", "loc": [929, 929], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "vector": [14, 1, 0.5303, 0.0006, 1, 0.92, 0.6364, 88, 3, 5, 0, 0, 428, 10, 1], "semantic": {"name": "grasp, avg_list, collided, zeros", "arg_names": [], "import_names": [], "rhs_call_name": "grasp_object", "annotation": ""}, "snippet": " (grasp, avg_list, collided, zeros) = grasp_object(obj1, is_place=True, zeros=zeros, cm=cm, apm=apm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L932_C4", "label": "obj3, grasp, avg_list, collided, zeros = grasp_closest_object()", "type": "assigned_variable", "loc": [932, 932], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "vector": [14, 1, 0.532, 0.0006, 1, 0.92, 0.7273, 544, 3, 5, 0, 0, 670, 10, 1], "semantic": {"name": "obj3, grasp, avg_list, collided, zeros", "arg_names": [], "import_names": [], "rhs_call_name": "grasp_closest_object", "annotation": ""}, "snippet": " (obj3, grasp, avg_list, collided, zeros) = grasp_closest_object(obj1pl[0][0], obj1pl[0][1], zeros=zeros, cm=cm, apm=apm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L935_C4", "label": "grasp, avg_list, collided, zeros = grasp_object()", "type": "assigned_variable", "loc": [935, 935], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "vector": [14, 1, 0.5337, 0.0006, 1, 0.92, 0.8182, 88, 3, 5, 0, 0, 428, 10, 1], "semantic": {"name": "grasp, avg_list, collided, zeros", "arg_names": [], "import_names": [], "rhs_call_name": "grasp_object", "annotation": ""}, "snippet": " (grasp, avg_list, collided, zeros) = grasp_object(obj2, is_place=True, zeros=zeros, cm=cm, apm=apm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L938_C4", "label": "display_grasp_data()", "type": "expression", "loc": [938, 938], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "vector": [8, 1, 0.5354, 0.0006, 1, 0.92, 0.9091, 150, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "display_grasp_data", "arg_names": [], "import_names": [], "rhs_call_name": "display_grasp_data", "annotation": ""}, "snippet": " display_grasp_data(grasps[0:3], \"accelerometer\", monitor_data=avg_lists[0:3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L939_C4", "label": "display_grasp_data()", "type": "expression", "loc": [939, 939], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "vector": [8, 1, 0.536, 0.0006, 1, 0.92, 1.0, 150, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "display_grasp_data", "arg_names": [], "import_names": [], "rhs_call_name": "display_grasp_data", "annotation": ""}, "snippet": " display_grasp_data(grasps[3:-1], \"accelerometer\", monitor_data=avg_lists[3:-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L941_C0", "label": "trim_test_data", "type": "function", "loc": [941, 948], "level": 0, "parent": null, "vector": [2, 0, 0.5391, 0.0046, 0, 0.66, 0.8, 102, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "trim_test_data", "arg_names": ["grasp_data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def trim_test_data(grasp_data=None):\n if grasp_data is None:\n grasp_data = load_pickle(GRASP_DATA_FILE)\n new_data = []\n for grasp in grasp_data:\n new_data += [(grasp[0], grasp[1], None, grasp[3], grasp[4])]\n save_pickle(new_data, GRASP_MODELS_FILE)\n return new_data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L942_C4", "label": "if", "type": "if", "loc": [942, 943], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L941_C0", "vector": [4, 1, 0.538, 0.0011, 1, 0.85, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if grasp_data is None:\n grasp_data = load_pickle(GRASP_DATA_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L943_C8", "label": "grasp_data = load_pickle()", "type": "assigned_variable", "loc": [943, 943], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L942_C4", "vector": [14, 2, 0.5382, 0.0006, 2, 0.2, 0.0, 717, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "grasp_data", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " grasp_data = load_pickle(GRASP_DATA_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L944_C4", "label": "new_data =", "type": "assigned_variable", "loc": [944, 944], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L941_C0", "vector": [14, 1, 0.5388, 0.0006, 1, 0.85, 0.25, 524, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "new_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_data = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L945_C4", "label": "for grasp", "type": "for", "loc": [945, 946], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L941_C0", "vector": [6, 1, 0.5397, 0.0011, 1, 0.85, 0.5, 766, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "grasp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for grasp in grasp_data:\n new_data += [(grasp[0], grasp[1], None, grasp[3], grasp[4])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L947_C4", "label": "save_pickle()", "type": "expression", "loc": [947, 947], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L941_C0", "vector": [8, 1, 0.5405, 0.0006, 1, 0.85, 0.75, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " save_pickle(new_data, GRASP_MODELS_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L948_C4", "label": "return", "type": "return", "loc": [948, 948], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L941_C0", "vector": [13, 1, 0.5411, 0.0006, 1, 0.85, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return new_data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L950_C0", "label": "save_grasp", "type": "function", "loc": [950, 953], "level": 0, "parent": null, "vector": [2, 0, 0.5431, 0.0023, 0, 0.66, 0.8077, 833, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "save_grasp", "arg_names": ["grasp", "prefix"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def save_grasp(grasp, prefix):\n filename = prefix + \"%04d-%04d-%04d.pickle\" % (int(grasp[0][0]*100),int(grasp[0][1]*100),int(grasp[0][2]*100))\n save_pickle(grasp, filename)\n return filename"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L951_C4", "label": "filename =", "type": "assigned_variable", "loc": [951, 951], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L950_C0", "vector": [14, 1, 0.5428, 0.0006, 1, 0.96, 0.0, 275, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filename = prefix + \"%04d-%04d-%04d.pickle\" % (int(grasp[0][0]*100),int(grasp[0][1]*100),int(grasp[0][2]*100))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L952_C4", "label": "save_pickle()", "type": "expression", "loc": [952, 952], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L950_C0", "vector": [8, 1, 0.5434, 0.0006, 1, 0.96, 0.5, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " save_pickle(grasp, filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L953_C4", "label": "return", "type": "return", "loc": [953, 953], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L950_C0", "vector": [13, 1, 0.5439, 0.0006, 1, 0.96, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return filename"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L955_C0", "label": "split_model_data", "type": "function", "loc": [955, 965], "level": 0, "parent": null, "vector": [2, 0, 0.5479, 0.0063, 0, 0.66, 0.8154, 203, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "split_model_data", "arg_names": ["data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def split_model_data(data=None):\n if data is None:\n data = load_pickle(GRASP_MODELS_FILE)\n xyr_index = []\n n = 1\n for grasp in data:\n filename = GRASP_IND_PREFIX + \"%03d-%03d-%03d.pickle\" % (int(grasp[0][0]*100),int(grasp[0][1]*100),int(grasp[0][2]*100))\n xyr_index += [[grasp[0], filename]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L956_C4", "label": "if", "type": "if", "loc": [956, 957], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L955_C0", "vector": [4, 1, 0.5459, 0.0011, 1, 0.24, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data is None:\n data = load_pickle(GRASP_MODELS_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L957_C8", "label": "data = load_pickle()", "type": "assigned_variable", "loc": [957, 957], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L956_C4", "vector": [14, 2, 0.5462, 0.0006, 2, 0.5, 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 = load_pickle(GRASP_MODELS_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L958_C4", "label": "xyr_index =", "type": "assigned_variable", "loc": [958, 958], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L955_C0", "vector": [14, 1, 0.5468, 0.0006, 1, 0.24, 0.25, 414, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "xyr_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xyr_index = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L959_C4", "label": "n =", "type": "assigned_variable", "loc": [959, 959], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L955_C0", "vector": [14, 1, 0.5474, 0.0006, 1, 0.24, 0.5, 773, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L960_C4", "label": "for grasp", "type": "for", "loc": [960, 964], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L955_C0", "vector": [6, 1, 0.5491, 0.0029, 1, 0.24, 0.75, 766, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "grasp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for grasp in data:\n filename = GRASP_IND_PREFIX + \"%03d-%03d-%03d.pickle\" % (int(grasp[0][0]*100),int(grasp[0][1]*100),int(grasp[0][2]*100))\n xyr_index += [[grasp[0], filename]]\n save_pickle(grasp, filename)\n n += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L961_C8", "label": "filename =", "type": "assigned_variable", "loc": [961, 961], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L960_C4", "vector": [14, 2, 0.5485, 0.0006, 2, 0.61, 0.0, 275, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filename = GRASP_IND_PREFIX + \"%03d-%03d-%03d.pickle\" % (int(grasp[0][0]*100),int(grasp[0][1]*100),int(grasp[0][2]*100))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L963_C8", "label": "save_pickle()", "type": "expression", "loc": [963, 963], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L960_C4", "vector": [8, 2, 0.5497, 0.0006, 2, 0.61, 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": " save_pickle(grasp, filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L965_C4", "label": "save_pickle()", "type": "expression", "loc": [965, 965], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L955_C0", "vector": [8, 1, 0.5508, 0.0006, 1, 0.24, 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": " save_pickle(xyr_index, GRASP_INDEX_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L967_C0", "label": "resample_split_model_data", "type": "function", "loc": [967, 974], "level": 0, "parent": null, "vector": [2, 0, 0.5539, 0.0046, 0, 0.66, 0.8231, 96, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "resample_split_model_data", "arg_names": ["apm", "models", "sampling_rate"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def resample_split_model_data(apm, models=None, sampling_rate=4):\n if models is None:\n models = load_pickle(GRASP_MODELS_FILE)\n new_models = []\n for model in models:\n new_model = apm.resample_and_thin_data(model[3], sampling_rate)\n new_models.append([model[0], None, None, new_model, model[4]])\n split_model_data(new_models)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L968_C4", "label": "if", "type": "if", "loc": [968, 969], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L967_C0", "vector": [4, 1, 0.5528, 0.0011, 1, 0.59, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if models is None:\n models = load_pickle(GRASP_MODELS_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L969_C8", "label": "models = load_pickle()", "type": "assigned_variable", "loc": [969, 969], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L968_C4", "vector": [14, 2, 0.5531, 0.0006, 2, 0.6, 0.0, 495, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "models", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " models = load_pickle(GRASP_MODELS_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L970_C4", "label": "new_models =", "type": "assigned_variable", "loc": [970, 970], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L967_C0", "vector": [14, 1, 0.5537, 0.0006, 1, 0.59, 0.3333, 957, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "new_models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_models = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L971_C4", "label": "for model", "type": "for", "loc": [971, 973], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L967_C0", "vector": [6, 1, 0.5548, 0.0017, 1, 0.59, 0.6667, 722, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for model in models:\n new_model = apm.resample_and_thin_data(model[3], sampling_rate)\n new_models.append([model[0], None, None, new_model, model[4]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L972_C8", "label": "new_model = resample_and_thin_data()", "type": "assigned_variable", "loc": [972, 972], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L971_C4", "vector": [14, 2, 0.5548, 0.0006, 2, 0.26, 0.0, 795, 3, 2, 0, 0, 225, 10, 1], "semantic": {"name": "new_model", "arg_names": [], "import_names": [], "rhs_call_name": "resample_and_thin_data", "annotation": ""}, "snippet": " new_model = apm.resample_and_thin_data(model[3], sampling_rate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L973_C8", "label": "append()", "type": "expression", "loc": [973, 973], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L971_C4", "vector": [8, 2, 0.5554, 0.0006, 2, 0.26, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " new_models.append([model[0], None, None, new_model, model[4]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L974_C4", "label": "split_model_data()", "type": "expression", "loc": [974, 974], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L967_C0", "vector": [8, 1, 0.5559, 0.0006, 1, 0.59, 1.0, 203, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "split_model_data", "arg_names": [], "import_names": [], "rhs_call_name": "split_model_data", "annotation": ""}, "snippet": " split_model_data(new_models)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L976_C0", "label": "normalize_rot", "type": "function", "loc": [976, 981], "level": 0, "parent": null, "vector": [2, 0, 0.5585, 0.0034, 0, 0.66, 0.8308, 27, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "normalize_rot", "arg_names": ["gripper_rot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def normalize_rot(gripper_rot):\n while gripper_rot >= np.pi:\n gripper_rot -= np.pi\n while gripper_rot < 0.:\n gripper_rot += np.pi\n return gripper_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L977_C4", "label": "while", "type": "while", "loc": [977, 978], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L976_C0", "vector": [5, 1, 0.5579, 0.0011, 1, 0.74, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while gripper_rot >= np.pi:\n gripper_rot -= np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L979_C4", "label": "while", "type": "while", "loc": [979, 980], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L976_C0", "vector": [5, 1, 0.5591, 0.0011, 1, 0.74, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while gripper_rot < 0.:\n gripper_rot += np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L981_C4", "label": "return", "type": "return", "loc": [981, 981], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L976_C0", "vector": [13, 1, 0.5599, 0.0006, 1, 0.74, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return gripper_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L983_C0", "label": "grasp_loader", "type": "function", "loc": [983, 996], "level": 0, "parent": null, "vector": [2, 0, 0.5648, 0.008, 0, 0.66, 0.8385, 900, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "grasp_loader", "arg_names": ["filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def grasp_loader(filename):\n class GLoader(threading.Thread):\n def __init__(self):\n threading.Thread.__init__(self)\n self.grasp = []\n\n def run(self):\n tg = load_pickle(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:ClassDef_L984_C4", "label": "GLoader", "type": "class", "loc": [984, 992], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L983_C0", "vector": [3, 1, 0.5639, 0.0051, 1, 0.67, 0.0, 374, 0, 2, 0, 0, 634, 0, 3], "semantic": {"name": "GLoader", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class GLoader(threading.Thread):\n def __init__(self):\n threading.Thread.__init__(self)\n self.grasp = []\n\n def run(self):\n tg = load_pickle(filename)\n for v in tg:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L985_C8", "label": "__init__", "type": "function", "loc": [985, 987], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:ClassDef_L984_C4", "vector": [2, 2, 0.5628, 0.0017, 2, 0.34, 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 threading.Thread.__init__(self)\n self.grasp = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L986_C12", "label": "__init__()", "type": "expression", "loc": [986, 986], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L985_C8", "vector": [8, 3, 0.5628, 0.0006, 3, 0.38, 0.0, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " threading.Thread.__init__(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L987_C12", "label": "self.grasp =", "type": "assigned_variable", "loc": [987, 987], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L985_C8", "vector": [14, 3, 0.5634, 0.0006, 3, 0.38, 1.0, 407, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.grasp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grasp = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L989_C8", "label": "run", "type": "function", "loc": [989, 992], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:ClassDef_L984_C4", "vector": [2, 2, 0.5654, 0.0023, 2, 0.34, 1.0, 679, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run(self):\n tg = load_pickle(filename)\n for v in tg:\n self.grasp.append(v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L990_C12", "label": "tg = load_pickle()", "type": "assigned_variable", "loc": [990, 990], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L989_C8", "vector": [14, 3, 0.5651, 0.0006, 3, 0.34, 0.0, 870, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "tg", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " tg = load_pickle(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L991_C12", "label": "for v", "type": "for", "loc": [991, 992], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L989_C8", "vector": [6, 3, 0.5659, 0.0011, 3, 0.34, 1.0, 553, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for v in tg:\n self.grasp.append(v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L992_C16", "label": "append()", "type": "expression", "loc": [992, 992], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L991_C12", "vector": [8, 4, 0.5662, 0.0006, 4, 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": " self.grasp.append(v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L994_C4", "label": "gl = GLoader()", "type": "assigned_variable", "loc": [994, 994], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L983_C0", "vector": [14, 1, 0.5674, 0.0006, 1, 0.67, 0.3333, 898, 3, 0, 0, 0, 374, 10, 1], "semantic": {"name": "gl", "arg_names": [], "import_names": [], "rhs_call_name": "GLoader", "annotation": ""}, "snippet": " gl = GLoader()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L995_C4", "label": "start()", "type": "expression", "loc": [995, 995], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L983_C0", "vector": [8, 1, 0.5679, 0.0006, 1, 0.67, 0.6667, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " gl.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L996_C4", "label": "return", "type": "return", "loc": [996, 996], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L983_C0", "vector": [13, 1, 0.5685, 0.0006, 1, 0.67, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return gl.grasp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L998_C0", "label": "load_grasp", "type": "function", "loc": [998, 999], "level": 0, "parent": null, "vector": [2, 0, 0.5699, 0.0011, 0, 0.66, 0.8462, 870, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "load_grasp", "arg_names": ["xyr", "xyr_index"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def load_grasp(xyr, xyr_index = GRASP_DATA_INDEX_FILE):\n return get_grasp_model(xyr[0], xyr[1], xyr[2], xyr_index = xyr_index, no_wait=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L999_C4", "label": "return", "type": "return", "loc": [999, 999], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L998_C0", "vector": [13, 1, 0.5702, 0.0006, 1, 0.12, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return get_grasp_model(xyr[0], xyr[1], xyr[2], xyr_index = xyr_index, no_wait=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1001_C0", "label": "get_grasp_model", "type": "function", "loc": [1001, 1027], "level": 0, "parent": null, "vector": [2, 0, 0.5788, 0.0154, 0, 0.66, 0.8538, 85, 0, 6, 1, 0, 0, 0, 11], "semantic": {"name": "get_grasp_model", "arg_names": ["x", "y", "r", "xyr_index", "grasp_data", "no_wait"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_grasp_model(x, y, r, xyr_index = None, grasp_data = None, no_wait = True):\n r = normalize_rot(r)\n if grasp_data is None:\n if xyr_index is None:\n xyr_index = load_pickle(GRASP_INDEX_FILE)\n else:\n xyr_index = grasp_data\n if len(xyr_index) > 0:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1002_C4", "label": "r = normalize_rot()", "type": "assigned_variable", "loc": [1002, 1002], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1001_C0", "vector": [14, 1, 0.5719, 0.0006, 1, 0.94, 0.0, 436, 3, 1, 0, 0, 27, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "normalize_rot", "annotation": ""}, "snippet": " r = normalize_rot(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1003_C4", "label": "if", "type": "if", "loc": [1003, 1007], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1001_C0", "vector": [4, 1, 0.5736, 0.0029, 1, 0.94, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if grasp_data is None:\n if xyr_index is None:\n xyr_index = load_pickle(GRASP_INDEX_FILE)\n else:\n xyr_index = grasp_data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1004_C8", "label": "if", "type": "if", "loc": [1004, 1005], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1003_C4", "vector": [4, 2, 0.5733, 0.0011, 2, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if xyr_index is None:\n xyr_index = load_pickle(GRASP_INDEX_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1005_C12", "label": "xyr_index = load_pickle()", "type": "assigned_variable", "loc": [1005, 1005], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1004_C8", "vector": [14, 3, 0.5736, 0.0006, 3, 0.42, 0.0, 414, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "xyr_index", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " xyr_index = load_pickle(GRASP_INDEX_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1007_C8", "label": "xyr_index =", "type": "assigned_variable", "loc": [1007, 1007], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1003_C4", "vector": [14, 2, 0.5748, 0.0006, 2, 0.37, 1.0, 414, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xyr_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xyr_index = grasp_data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1008_C4", "label": "if", "type": "if", "loc": [1008, 1027], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1001_C0", "vector": [4, 1, 0.5808, 0.0114, 1, 0.94, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(xyr_index) > 0:\n def dist(o):\n if np.allclose(o[0][2], 0.0):\n # for loop around\n rot_dist = min((np.pi - r) ** 2, (0. - r) ** 2)\n else:\n rot_dist = (o[0][2] - r) ** 2\n return (o[0][0] - x) ** 2 + (o[0][1] - y) ** 2 + rot_dist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1009_C8", "label": "dist", "type": "function", "loc": [1009, 1015], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1008_C4", "vector": [2, 2, 0.5776, 0.004, 2, 0.47, 0.0, 673, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "dist", "arg_names": ["o"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def dist(o):\n if np.allclose(o[0][2], 0.0):\n # for loop around\n rot_dist = min((np.pi - r) ** 2, (0. - r) ** 2)\n else:\n rot_dist = (o[0][2] - r) ** 2\n return (o[0][0] - x) ** 2 + (o[0][1] - y) ** 2 + rot_dist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1010_C12", "label": "if", "type": "if", "loc": [1010, 1014], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1009_C8", "vector": [4, 3, 0.5776, 0.0029, 3, 0.89, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.allclose(o[0][2], 0.0):\n # for loop around\n rot_dist = min((np.pi - r) ** 2, (0. - r) ** 2)\n else:\n rot_dist = (o[0][2] - r) ** 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1012_C16", "label": "rot_dist = min()", "type": "assigned_variable", "loc": [1012, 1012], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1010_C12", "vector": [14, 4, 0.5776, 0.0006, 4, 0.9, 0.0, 224, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "rot_dist", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " rot_dist = min((np.pi - r) ** 2, (0. - r) ** 2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1014_C16", "label": "rot_dist =", "type": "assigned_variable", "loc": [1014, 1014], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1010_C12", "vector": [14, 4, 0.5788, 0.0006, 4, 0.9, 1.0, 224, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rot_dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_dist = (o[0][2] - r) ** 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1015_C12", "label": "return", "type": "return", "loc": [1015, 1015], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1009_C8", "vector": [13, 3, 0.5793, 0.0006, 3, 0.89, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (o[0][0] - x) ** 2 + (o[0][1] - y) ** 2 + rot_dist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1016_C8", "label": "xyr = min()", "type": "assigned_variable", "loc": [1016, 1016], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1008_C4", "vector": [14, 2, 0.5799, 0.0006, 2, 0.47, 0.2, 90, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "xyr", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " xyr = min(xyr_index, key=dist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1017_C8", "label": "print()", "type": "expression", "loc": [1017, 1017], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1008_C4", "vector": [8, 2, 0.5805, 0.0006, 2, 0.47, 0.4, 535, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Distance to grasp model:\", dist(xyr), \"rotation diff:\", xyr[0][2] - r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1018_C8", "label": "if", "type": "if", "loc": [1018, 1024], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1008_C4", "vector": [4, 2, 0.5828, 0.004, 2, 0.47, 0.6, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if grasp_data is None:\n if not no_wait:\n return load_pickle(xyr[1])\n\n return grasp_loader(xyr[1])\n else:\n return xyr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1019_C12", "label": "if", "type": "if", "loc": [1019, 1020], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1018_C8", "vector": [4, 3, 0.5819, 0.0011, 3, 0.75, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not no_wait:\n return load_pickle(xyr[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1020_C16", "label": "return", "type": "return", "loc": [1020, 1020], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1019_C12", "vector": [13, 4, 0.5822, 0.0006, 4, 0.66, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return load_pickle(xyr[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1022_C12", "label": "return", "type": "return", "loc": [1022, 1022], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1018_C8", "vector": [13, 3, 0.5833, 0.0006, 3, 0.75, 0.5, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return grasp_loader(xyr[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1024_C12", "label": "return", "type": "return", "loc": [1024, 1024], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1018_C8", "vector": [13, 3, 0.5845, 0.0006, 3, 0.75, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return xyr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1026_C8", "label": "print()", "type": "expression", "loc": [1026, 1026], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1008_C4", "vector": [8, 2, 0.5856, 0.0006, 2, 0.47, 0.8, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Bad index file\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1027_C8", "label": "return", "type": "return", "loc": [1027, 1027], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1008_C4", "vector": [13, 2, 0.5862, 0.0006, 2, 0.47, 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_99294:FunctionDef_L1029_C0", "label": "load_grasp", "type": "function", "loc": [1029, 1035], "level": 0, "parent": null, "vector": [2, 0, 0.589, 0.004, 0, 0.66, 0.8615, 870, 0, 4, 1, 0, 0, 0, 3], "semantic": {"name": "load_grasp", "arg_names": ["x", "y", "r", "xyr_index"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def load_grasp(x, y, r, xyr_index = None):\n if xyr_index is None:\n xyr_index = load_pickle(GRASP_INDEX_FILE)\n for xyr in xyr_index:\n if np.allclose([x, y, r], xyr[0]):\n return load_pickle(xyr[1])\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1030_C4", "label": "if", "type": "if", "loc": [1030, 1031], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1029_C0", "vector": [4, 1, 0.5882, 0.0011, 1, 0.72, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if xyr_index is None:\n xyr_index = load_pickle(GRASP_INDEX_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1031_C8", "label": "xyr_index = load_pickle()", "type": "assigned_variable", "loc": [1031, 1031], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1030_C4", "vector": [14, 2, 0.5885, 0.0006, 2, 0.88, 0.0, 414, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "xyr_index", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " xyr_index = load_pickle(GRASP_INDEX_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1032_C4", "label": "for xyr", "type": "for", "loc": [1032, 1034], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1029_C0", "vector": [6, 1, 0.5896, 0.0017, 1, 0.72, 0.5, 90, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "xyr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for xyr in xyr_index:\n if np.allclose([x, y, r], xyr[0]):\n return load_pickle(xyr[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1033_C8", "label": "if", "type": "if", "loc": [1033, 1034], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1032_C4", "vector": [4, 2, 0.5899, 0.0011, 2, 0.35, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.allclose([x, y, r], xyr[0]):\n return load_pickle(xyr[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1034_C12", "label": "return", "type": "return", "loc": [1034, 1034], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1033_C8", "vector": [13, 3, 0.5902, 0.0006, 3, 0.33, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return load_pickle(xyr[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1035_C4", "label": "return", "type": "return", "loc": [1035, 1035], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1029_C0", "vector": [13, 1, 0.5908, 0.0006, 1, 0.72, 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_99294:FunctionDef_L1037_C0", "label": "compute_sqr_diff_map", "type": "function", "loc": [1037, 1092], "level": 0, "parent": null, "vector": [2, 0, 0.6076, 0.032, 0, 0.66, 0.8692, 184, 0, 1, 1, 0, 0, 0, 22], "semantic": {"name": "compute_sqr_diff_map", "arg_names": ["percept"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compute_sqr_diff_map(percept=\"accelerometer\"):\n xys = get_xy_list()\n def get_xy(i, j):\n return xys[i * NUM_Y + j]\n def model_sqr_err(m1, xy, i, j):\n n = 0\n sum = 0.\n cxy = get_xy(i, j)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1038_C4", "label": "xys = get_xy_list()", "type": "assigned_variable", "loc": [1038, 1038], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1037_C0", "vector": [14, 1, 0.5925, 0.0006, 1, 0.02, 0.0, 51, 3, 0, 0, 0, 247, 10, 1], "semantic": {"name": "xys", "arg_names": [], "import_names": [], "rhs_call_name": "get_xy_list", "annotation": ""}, "snippet": " xys = get_xy_list()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1039_C4", "label": "get_xy", "type": "function", "loc": [1039, 1040], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1037_C0", "vector": [2, 1, 0.5933, 0.0011, 1, 0.02, 0.25, 562, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "get_xy", "arg_names": ["i", "j"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_xy(i, j):\n return xys[i * NUM_Y + j]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1040_C8", "label": "return", "type": "return", "loc": [1040, 1040], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1039_C4", "vector": [13, 2, 0.5936, 0.0006, 2, 0.87, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return xys[i * NUM_Y + j]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1041_C4", "label": "model_sqr_err", "type": "function", "loc": [1041, 1052], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1037_C0", "vector": [2, 1, 0.5973, 0.0068, 1, 0.02, 0.5, 220, 0, 4, 1, 0, 0, 0, 7], "semantic": {"name": "model_sqr_err", "arg_names": ["m1", "xy", "i", "j"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def model_sqr_err(m1, xy, i, j):\n n = 0\n sum = 0.\n cxy = get_xy(i, j)\n g2 = get_grasp_model(cxy[0], cxy[1])\n if np.allclose(g2[0], xy):\n return [-1.]\n m2 = g2[3][percept][\"mean\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1042_C8", "label": "n =", "type": "assigned_variable", "loc": [1042, 1042], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1041_C4", "vector": [14, 2, 0.5947, 0.0006, 2, 0.84, 0.0, 773, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1043_C8", "label": "sum =", "type": "assigned_variable", "loc": [1043, 1043], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1041_C4", "vector": [14, 2, 0.5953, 0.0006, 2, 0.84, 0.1429, 824, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "sum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sum = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1044_C8", "label": "cxy = get_xy()", "type": "assigned_variable", "loc": [1044, 1044], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1041_C4", "vector": [14, 2, 0.5959, 0.0006, 2, 0.84, 0.2857, 551, 3, 2, 0, 0, 562, 10, 1], "semantic": {"name": "cxy", "arg_names": [], "import_names": [], "rhs_call_name": "get_xy", "annotation": ""}, "snippet": " cxy = get_xy(i, j)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1045_C8", "label": "g2 = get_grasp_model()", "type": "assigned_variable", "loc": [1045, 1045], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1041_C4", "vector": [14, 2, 0.5965, 0.0006, 2, 0.84, 0.4286, 985, 3, 2, 0, 0, 85, 10, 1], "semantic": {"name": "g2", "arg_names": [], "import_names": [], "rhs_call_name": "get_grasp_model", "annotation": ""}, "snippet": " g2 = get_grasp_model(cxy[0], cxy[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1046_C8", "label": "if", "type": "if", "loc": [1046, 1047], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1041_C4", "vector": [4, 2, 0.5973, 0.0011, 2, 0.84, 0.5714, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.allclose(g2[0], xy):\n return [-1.]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1047_C12", "label": "return", "type": "return", "loc": [1047, 1047], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1046_C8", "vector": [13, 3, 0.5976, 0.0006, 3, 0.13, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [-1.]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1048_C8", "label": "m2 =", "type": "assigned_variable", "loc": [1048, 1048], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1041_C4", "vector": [14, 2, 0.5982, 0.0006, 2, 0.84, 0.7143, 562, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m2 = g2[3][percept][\"mean\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1049_C8", "label": "for i", "type": "for", "loc": [1049, 1051], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1041_C4", "vector": [6, 2, 0.5993, 0.0017, 2, 0.84, 0.8571, 826, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(min(len(m1),len(m2))):\n sum += (m1[i] - m2[i]) ** 2\n n += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1052_C8", "label": "return", "type": "return", "loc": [1052, 1052], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1041_C4", "vector": [13, 2, 0.6005, 0.0006, 2, 0.84, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sum / n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1053_C4", "label": "xy_index = load_pickle()", "type": "assigned_variable", "loc": [1053, 1053], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1037_C0", "vector": [14, 1, 0.601, 0.0006, 1, 0.02, 0.75, 667, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "xy_index", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " xy_index = load_pickle(GRASP_INDEX_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1054_C4", "label": "if", "type": "if", "loc": [1054, 1092], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1037_C0", "vector": [4, 1, 0.6124, 0.0223, 1, 0.02, 1.0, 0, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(xys) > 0:\n map = [] \n for i in range(NUM_X):\n map += [[]]\n for j in range(NUM_Y):\n cen_xy = get_xy(i, j)\n cen_grasp = get_grasp_model(cen_xy[0], cen_xy[1])\n cen_grasp_model = cen_grasp[3][percept][\"mean\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1055_C8", "label": "map =", "type": "assigned_variable", "loc": [1055, 1055], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1054_C4", "vector": [14, 2, 0.6022, 0.0006, 2, 0.5, 0.0, 53, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "map", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " map = [] "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1056_C8", "label": "for i", "type": "for", "loc": [1056, 1088], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1054_C4", "vector": [6, 2, 0.6119, 0.0188, 2, 0.5, 0.25, 826, 3, 0, 0, 0, 0, 0, 11], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(NUM_X):\n map += [[]]\n for j in range(NUM_Y):\n cen_xy = get_xy(i, j)\n cen_grasp = get_grasp_model(cen_xy[0], cen_xy[1])\n cen_grasp_model = cen_grasp[3][percept][\"mean\"]\n if not np.allclose(cen_xy, cen_grasp[0]):\n map[-1] += [0.]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1058_C12", "label": "for j", "type": "for", "loc": [1058, 1088], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1056_C8", "vector": [6, 3, 0.6124, 0.0177, 3, 0.78, 0.0, 100, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for j in range(NUM_Y):\n cen_xy = get_xy(i, j)\n cen_grasp = get_grasp_model(cen_xy[0], cen_xy[1])\n cen_grasp_model = cen_grasp[3][percept][\"mean\"]\n if not np.allclose(cen_xy, cen_grasp[0]):\n map[-1] += [0.]\n continue\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1059_C16", "label": "cen_xy = get_xy()", "type": "assigned_variable", "loc": [1059, 1059], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1058_C12", "vector": [14, 4, 0.6045, 0.0006, 4, 0.96, 0.0, 277, 3, 2, 0, 0, 562, 10, 1], "semantic": {"name": "cen_xy", "arg_names": [], "import_names": [], "rhs_call_name": "get_xy", "annotation": ""}, "snippet": " cen_xy = get_xy(i, j)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1060_C16", "label": "cen_grasp = get_grasp_model()", "type": "assigned_variable", "loc": [1060, 1060], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1058_C12", "vector": [14, 4, 0.605, 0.0006, 4, 0.96, 0.3333, 743, 3, 2, 0, 0, 85, 10, 1], "semantic": {"name": "cen_grasp", "arg_names": [], "import_names": [], "rhs_call_name": "get_grasp_model", "annotation": ""}, "snippet": " cen_grasp = get_grasp_model(cen_xy[0], cen_xy[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1061_C16", "label": "cen_grasp_model =", "type": "assigned_variable", "loc": [1061, 1061], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1058_C12", "vector": [14, 4, 0.6056, 0.0006, 4, 0.96, 0.6667, 218, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cen_grasp_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cen_grasp_model = cen_grasp[3][percept][\"mean\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "label": "if", "type": "if", "loc": [1062, 1088], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1058_C12", "vector": [4, 4, 0.6136, 0.0154, 4, 0.96, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not np.allclose(cen_xy, cen_grasp[0]):\n map[-1] += [0.]\n continue\n else:\n err = 0.\n n = 0\n new_err = model_sqr_err(cen_grasp_model, cen_xy, i+1, j)\n if new_err[0] != -1.:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1066_C20", "label": "err =", "type": "assigned_variable", "loc": [1066, 1066], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "vector": [14, 5, 0.6084, 0.0006, 5, 0.33, 0.0, 541, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " err = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1067_C20", "label": "n =", "type": "assigned_variable", "loc": [1067, 1067], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "vector": [14, 5, 0.609, 0.0006, 5, 0.33, 0.0909, 773, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1068_C20", "label": "new_err = model_sqr_err()", "type": "assigned_variable", "loc": [1068, 1068], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "vector": [14, 5, 0.6096, 0.0006, 5, 0.33, 0.1818, 859, 3, 4, 0, 0, 220, 10, 1], "semantic": {"name": "new_err", "arg_names": [], "import_names": [], "rhs_call_name": "model_sqr_err", "annotation": ""}, "snippet": " new_err = model_sqr_err(cen_grasp_model, cen_xy, i+1, j)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1069_C20", "label": "if", "type": "if", "loc": [1069, 1071], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "vector": [4, 5, 0.6107, 0.0017, 5, 0.33, 0.2727, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if new_err[0] != -1.:\n err += new_err\n n += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1072_C20", "label": "new_err = model_sqr_err()", "type": "assigned_variable", "loc": [1072, 1072], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "vector": [14, 5, 0.6119, 0.0006, 5, 0.33, 0.3636, 859, 3, 4, 0, 0, 220, 10, 1], "semantic": {"name": "new_err", "arg_names": [], "import_names": [], "rhs_call_name": "model_sqr_err", "annotation": ""}, "snippet": " new_err = model_sqr_err(cen_grasp_model, cen_xy, i-1, j)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1073_C20", "label": "if", "type": "if", "loc": [1073, 1075], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "vector": [4, 5, 0.613, 0.0017, 5, 0.33, 0.4545, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if new_err[0] != -1.:\n err += new_err\n n += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1076_C20", "label": "new_err = model_sqr_err()", "type": "assigned_variable", "loc": [1076, 1076], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "vector": [14, 5, 0.6142, 0.0006, 5, 0.33, 0.5455, 859, 3, 4, 0, 0, 220, 10, 1], "semantic": {"name": "new_err", "arg_names": [], "import_names": [], "rhs_call_name": "model_sqr_err", "annotation": ""}, "snippet": " new_err = model_sqr_err(cen_grasp_model, cen_xy, i, j+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1077_C20", "label": "if", "type": "if", "loc": [1077, 1079], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "vector": [4, 5, 0.6153, 0.0017, 5, 0.33, 0.6364, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if new_err[0] != -1.:\n err += new_err\n n += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1080_C20", "label": "new_err = model_sqr_err()", "type": "assigned_variable", "loc": [1080, 1080], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "vector": [14, 5, 0.6164, 0.0006, 5, 0.33, 0.7273, 859, 3, 4, 0, 0, 220, 10, 1], "semantic": {"name": "new_err", "arg_names": [], "import_names": [], "rhs_call_name": "model_sqr_err", "annotation": ""}, "snippet": " new_err = model_sqr_err(cen_grasp_model, cen_xy, i, j-1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1081_C20", "label": "if", "type": "if", "loc": [1081, 1083], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "vector": [4, 5, 0.6176, 0.0017, 5, 0.33, 0.8182, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if new_err[0] != -1.:\n err += new_err\n n += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1084_C20", "label": "err =", "type": "assigned_variable", "loc": [1084, 1084], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "vector": [14, 5, 0.6187, 0.0006, 5, 0.33, 0.9091, 541, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " err = np.linalg.norm(err) ** 2 / len(err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1085_C20", "label": "if", "type": "if", "loc": [1085, 1088], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "vector": [4, 5, 0.6201, 0.0023, 5, 0.33, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n > 0:\n map[-1] += [err / n]\n else:\n map[-1] += [0.]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1089_C8", "label": "return", "type": "return", "loc": [1089, 1089], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1054_C4", "vector": [13, 2, 0.6216, 0.0006, 2, 0.5, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return map"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1091_C8", "label": "print()", "type": "expression", "loc": [1091, 1091], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1054_C4", "vector": [8, 2, 0.6227, 0.0006, 2, 0.5, 0.75, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Bad index file\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1092_C8", "label": "return", "type": "return", "loc": [1092, 1092], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1054_C4", "vector": [13, 2, 0.6233, 0.0006, 2, 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_99294:FunctionDef_L1094_C0", "label": "sqr_diff_viz", "type": "function", "loc": [1094, 1108], "level": 0, "parent": null, "vector": [2, 0, 0.6284, 0.0086, 0, 0.66, 0.8769, 915, 0, 0, 0, 0, 0, 0, 14], "semantic": {"name": "sqr_diff_viz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def sqr_diff_viz():\n # save_pickle(compute_sqr_diff_map(), SQR_DIFF_MAP)\n map = load_pickle(SQR_DIFF_MAP)\n map.reverse()\n maxarg = max([max(row) for row in map])\n print(np.mat(map))\n for i in range(len(map)):\n for j in range(len(map[i])):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1096_C4", "label": "map = load_pickle()", "type": "assigned_variable", "loc": [1096, 1096], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1094_C0", "vector": [14, 1, 0.6256, 0.0006, 1, 0.16, 0.0, 53, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "map", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " map = load_pickle(SQR_DIFF_MAP)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1097_C4", "label": "reverse()", "type": "expression", "loc": [1097, 1097], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1094_C0", "vector": [8, 1, 0.6261, 0.0006, 1, 0.16, 0.1111, 109, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "reverse", "arg_names": [], "import_names": [], "rhs_call_name": "reverse", "annotation": ""}, "snippet": " map.reverse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1098_C4", "label": "maxarg = max()", "type": "assigned_variable", "loc": [1098, 1098], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1094_C0", "vector": [14, 1, 0.6267, 0.0006, 1, 0.16, 0.2222, 400, 3, 1, 0, 0, 442, 10, 2], "semantic": {"name": "maxarg", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " maxarg = max([max(row) for row in map])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1099_C4", "label": "print()", "type": "expression", "loc": [1099, 1099], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1094_C0", "vector": [8, 1, 0.6273, 0.0006, 1, 0.16, 0.3333, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(np.mat(map))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1100_C4", "label": "for i", "type": "for", "loc": [1100, 1103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1094_C0", "vector": [6, 1, 0.6287, 0.0023, 1, 0.16, 0.4444, 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(map)):\n for j in range(len(map[i])):\n if map[i][j] == -1.:\n map[i][j] = maxarg*1.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1101_C8", "label": "for j", "type": "for", "loc": [1101, 1103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1100_C4", "vector": [6, 2, 0.629, 0.0017, 2, 0.62, 0.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(len(map[i])):\n if map[i][j] == -1.:\n map[i][j] = maxarg*1.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1102_C12", "label": "if", "type": "if", "loc": [1102, 1103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1101_C8", "vector": [4, 3, 0.6293, 0.0011, 3, 0.91, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if map[i][j] == -1.:\n map[i][j] = maxarg*1.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1103_C16", "label": "assign", "type": "assigned_variable", "loc": [1103, 1103], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1102_C12", "vector": [14, 4, 0.6296, 0.0006, 4, 0.46, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " map[i][j] = maxarg*1.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Import_L1104_C4", "label": "matplotlib.pyplot import plt", "type": "import", "loc": [1104, 1104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1094_C0", "vector": [1, 1, 0.6301, 0.0006, 1, 0.16, 0.5556, 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_99294:Assign_L1105_C4", "label": "fig = figure()", "type": "assigned_variable", "loc": [1105, 1105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1094_C0", "vector": [14, 1, 0.6307, 0.0006, 1, 0.16, 0.6667, 806, 3, 0, 0, 0, 789, 10, 1], "semantic": {"name": "fig", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " fig = plt.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1106_C4", "label": "ax = add_subplot()", "type": "assigned_variable", "loc": [1106, 1106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1094_C0", "vector": [14, 1, 0.6313, 0.0006, 1, 0.16, 0.7778, 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_99294:Expr_L1107_C4", "label": "matshow()", "type": "expression", "loc": [1107, 1107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1094_C0", "vector": [8, 1, 0.6318, 0.0006, 1, 0.16, 0.8889, 593, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "matshow", "arg_names": [], "import_names": [], "rhs_call_name": "matshow", "annotation": ""}, "snippet": " ax.matshow(map)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1108_C4", "label": "show()", "type": "expression", "loc": [1108, 1108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1094_C0", "vector": [8, 1, 0.6324, 0.0006, 1, 0.16, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " plt.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1110_C0", "label": "process_data", "type": "function", "loc": [1110, 1121], "level": 0, "parent": null, "vector": [2, 0, 0.6367, 0.0068, 0, 0.66, 0.8846, 678, 0, 1, 0, 0, 0, 0, 10], "semantic": {"name": "process_data", "arg_names": ["grasp_data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def process_data(grasp_data=None):\n print(\"Loading data\")\n if grasp_data is None:\n grasp_data = load_pickle(GRASP_DATA_FILE)\n print(\"Data loaded, generating models\")\n grasp_data = load_data_and_generate(grasp_data)\n print(\"Saving models\")\n print(\"Trimming test data\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1111_C4", "label": "print()", "type": "expression", "loc": [1111, 1111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1110_C0", "vector": [8, 1, 0.6341, 0.0006, 1, 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(\"Loading data\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1112_C4", "label": "if", "type": "if", "loc": [1112, 1113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1110_C0", "vector": [4, 1, 0.635, 0.0011, 1, 0.03, 0.1111, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if grasp_data is None:\n grasp_data = load_pickle(GRASP_DATA_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1113_C8", "label": "grasp_data = load_pickle()", "type": "assigned_variable", "loc": [1113, 1113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1112_C4", "vector": [14, 2, 0.6353, 0.0006, 2, 0.09, 0.0, 717, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "grasp_data", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " grasp_data = load_pickle(GRASP_DATA_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1114_C4", "label": "print()", "type": "expression", "loc": [1114, 1114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1110_C0", "vector": [8, 1, 0.6358, 0.0006, 1, 0.03, 0.2222, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Data loaded, generating models\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1115_C4", "label": "grasp_data = load_data_and_generate()", "type": "assigned_variable", "loc": [1115, 1115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1110_C0", "vector": [14, 1, 0.6364, 0.0006, 1, 0.03, 0.3333, 717, 3, 1, 0, 0, 657, 10, 1], "semantic": {"name": "grasp_data", "arg_names": [], "import_names": [], "rhs_call_name": "load_data_and_generate", "annotation": ""}, "snippet": " grasp_data = load_data_and_generate(grasp_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1116_C4", "label": "print()", "type": "expression", "loc": [1116, 1116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1110_C0", "vector": [8, 1, 0.637, 0.0006, 1, 0.03, 0.4444, 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_99294:Expr_L1117_C4", "label": "print()", "type": "expression", "loc": [1117, 1117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1110_C0", "vector": [8, 1, 0.6376, 0.0006, 1, 0.03, 0.5556, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Trimming test data\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1118_C4", "label": "model_data = trim_test_data()", "type": "assigned_variable", "loc": [1118, 1118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1110_C0", "vector": [14, 1, 0.6381, 0.0006, 1, 0.03, 0.6667, 626, 3, 1, 0, 0, 102, 10, 1], "semantic": {"name": "model_data", "arg_names": [], "import_names": [], "rhs_call_name": "trim_test_data", "annotation": ""}, "snippet": " model_data = trim_test_data(grasp_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1119_C4", "label": "print()", "type": "expression", "loc": [1119, 1119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1110_C0", "vector": [8, 1, 0.6387, 0.0006, 1, 0.03, 0.7778, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Splitting models\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1120_C4", "label": "split_model_data()", "type": "expression", "loc": [1120, 1120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1110_C0", "vector": [8, 1, 0.6393, 0.0006, 1, 0.03, 0.8889, 203, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "split_model_data", "arg_names": [], "import_names": [], "rhs_call_name": "split_model_data", "annotation": ""}, "snippet": " split_model_data(model_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1121_C4", "label": "print()", "type": "expression", "loc": [1121, 1121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1110_C0", "vector": [8, 1, 0.6398, 0.0006, 1, 0.03, 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 processing data\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "label": "calc_model", "type": "function", "loc": [1123, 1179], "level": 0, "parent": null, "vector": [2, 0, 0.657, 0.0325, 0, 0.66, 0.8923, 911, 0, 7, 1, 0, 0, 0, 26], "semantic": {"name": "calc_model", "arg_names": ["x", "y", "r", "window_len", "samples", "xyr_index", "resample"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def calc_model(x, y, r, window_len= 200, samples=50, xyr_index = None, resample = 10):\n if xyr_index is None:\n xyr_index = load_pickle(GRASP_INDEX_FILE)\n xs = (RECT[1][0] - RECT[0][0]) / (NUM_X - 1)\n ys = (RECT[0][1] - RECT[1][1]) / (NUM_Y - 1)\n rs = np.pi / NUM_ROT\n def dist1(o):\n return np.fabs(o[0][0] - x) + np.fabs(o[0][1] - y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1124_C4", "label": "if", "type": "if", "loc": [1124, 1125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "vector": [4, 1, 0.6418, 0.0011, 1, 0.9, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if xyr_index is None:\n xyr_index = load_pickle(GRASP_INDEX_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1125_C8", "label": "xyr_index = load_pickle()", "type": "assigned_variable", "loc": [1125, 1125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1124_C4", "vector": [14, 2, 0.6421, 0.0006, 2, 0.08, 0.0, 414, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "xyr_index", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " xyr_index = load_pickle(GRASP_INDEX_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1126_C4", "label": "xs =", "type": "assigned_variable", "loc": [1126, 1126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "vector": [14, 1, 0.6427, 0.0006, 1, 0.9, 0.0833, 928, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xs = (RECT[1][0] - RECT[0][0]) / (NUM_X - 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1127_C4", "label": "ys =", "type": "assigned_variable", "loc": [1127, 1127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "vector": [14, 1, 0.6433, 0.0006, 1, 0.9, 0.1667, 578, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ys", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ys = (RECT[0][1] - RECT[1][1]) / (NUM_Y - 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1128_C4", "label": "rs =", "type": "assigned_variable", "loc": [1128, 1128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "vector": [14, 1, 0.6438, 0.0006, 1, 0.9, 0.25, 594, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rs = np.pi / NUM_ROT"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1129_C4", "label": "dist1", "type": "function", "loc": [1129, 1130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "vector": [2, 1, 0.6447, 0.0011, 1, 0.9, 0.3333, 119, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "dist1", "arg_names": ["o"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def dist1(o):\n return np.fabs(o[0][0] - x) + np.fabs(o[0][1] - y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1130_C8", "label": "return", "type": "return", "loc": [1130, 1130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1129_C4", "vector": [13, 2, 0.645, 0.0006, 2, 0.67, 0.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.fabs(o[0][0] - x) + np.fabs(o[0][1] - y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1131_C4", "label": "dist2", "type": "function", "loc": [1131, 1132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "vector": [2, 1, 0.6458, 0.0011, 1, 0.9, 0.4167, 533, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "dist2", "arg_names": ["o"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def dist2(o):\n return (o[0][0] - x) ** 2 + (o[0][1] - y) ** 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1132_C8", "label": "return", "type": "return", "loc": [1132, 1132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1131_C4", "vector": [13, 2, 0.6461, 0.0006, 2, 0.1, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (o[0][0] - x) ** 2 + (o[0][1] - y) ** 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1133_C4", "label": "rotdist", "type": "function", "loc": [1133, 1138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "vector": [2, 1, 0.6481, 0.0034, 1, 0.9, 0.5, 966, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "rotdist", "arg_names": ["o"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def rotdist(o):\n if np.allclose(o[0][2], 0.0):\n # for loop around\n return min(np.fabs(np.pi - r), np.fabs(0. - r))\n else:\n return np.fabs(o[0][2] - r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1134_C12", "label": "if", "type": "if", "loc": [1134, 1138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1133_C4", "vector": [4, 2, 0.6484, 0.0029, 2, 0.74, 0.0, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.allclose(o[0][2], 0.0):\n # for loop around\n return min(np.fabs(np.pi - r), np.fabs(0. - r))\n else:\n return np.fabs(o[0][2] - r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1136_C16", "label": "return", "type": "return", "loc": [1136, 1136], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1134_C12", "vector": [13, 3, 0.6484, 0.0006, 3, 0.01, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return min(np.fabs(np.pi - r), np.fabs(0. - r))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1138_C16", "label": "return", "type": "return", "loc": [1138, 1138], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1134_C12", "vector": [13, 3, 0.6495, 0.0006, 3, 0.01, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.fabs(o[0][2] - r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1140_C4", "label": "n =", "type": "assigned_variable", "loc": [1140, 1140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "vector": [14, 1, 0.6507, 0.0006, 1, 0.9, 0.5833, 773, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1142_C4", "label": "close_models =", "type": "assigned_variable", "loc": [1142, 1142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "vector": [14, 1, 0.6518, 0.0006, 1, 0.9, 0.6667, 863, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "close_models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " close_models = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1143_C4", "label": "for i, dist", "type": "for", "loc": [1143, 1148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "vector": [6, 1, 0.6538, 0.0034, 1, 0.9, 0.75, 931, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "i, dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, dist in enumerate(map(dist1, xyr_index)):\n if np.allclose([x, y, r], xyr_index[i][0]):\n close_models = [[xyr_index[i][0], load_pickle(xyr_index[i][1])]]\n break\n if dist < xs + ys and rotdist(xyr_index[i]) < rs:\n close_models += [[xyr_index[i][0], load_pickle(xyr_index[i][1])]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1144_C8", "label": "if", "type": "if", "loc": [1144, 1146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1143_C4", "vector": [4, 2, 0.6535, 0.0017, 2, 0.25, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.allclose([x, y, r], xyr_index[i][0]):\n close_models = [[xyr_index[i][0], load_pickle(xyr_index[i][1])]]\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1145_C12", "label": "close_models =", "type": "assigned_variable", "loc": [1145, 1145], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1144_C8", "vector": [14, 3, 0.6535, 0.0006, 3, 0.7, 0.0, 863, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "close_models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " close_models = [[xyr_index[i][0], load_pickle(xyr_index[i][1])]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1147_C8", "label": "if", "type": "if", "loc": [1147, 1148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1143_C4", "vector": [4, 2, 0.655, 0.0011, 2, 0.25, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dist < xs + ys and rotdist(xyr_index[i]) < rs:\n close_models += [[xyr_index[i][0], load_pickle(xyr_index[i][1])]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1150_C4", "label": "ret_models =", "type": "assigned_variable", "loc": [1150, 1150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "vector": [14, 1, 0.6564, 0.0006, 1, 0.9, 0.8333, 234, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "ret_models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret_models = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1152_C4", "label": "for k", "type": "for", "loc": [1152, 1178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "vector": [6, 1, 0.665, 0.0154, 1, 0.9, 0.9167, 954, 6, 0, 0, 0, 0, 0, 12], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in close_models[0][1][3]:\n close_stream_means = []\n minlen = min([len(cm[1][3][k][\"mean\"]) for cm in close_models])\n for close_model in close_models:\n mean = close_model[1][3][k][\"mean\"][0:minlen]\n stream_means = zip(*mean)\n close_stream_means += [[close_model[0], np.array(stream_means)]]\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1153_C8", "label": "close_stream_means =", "type": "assigned_variable", "loc": [1153, 1153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1152_C4", "vector": [14, 2, 0.6581, 0.0006, 2, 0.27, 0.0, 787, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "close_stream_means", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " close_stream_means = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1154_C8", "label": "minlen = min()", "type": "assigned_variable", "loc": [1154, 1154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1152_C4", "vector": [14, 2, 0.6587, 0.0006, 2, 0.27, 0.1667, 833, 3, 1, 0, 0, 867, 10, 2], "semantic": {"name": "minlen", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " minlen = min([len(cm[1][3][k][\"mean\"]) for cm in close_models])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1155_C8", "label": "for close_model", "type": "for", "loc": [1155, 1158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1152_C4", "vector": [6, 2, 0.6601, 0.0023, 2, 0.27, 0.3333, 789, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "close_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for close_model in close_models:\n mean = close_model[1][3][k][\"mean\"][0:minlen]\n stream_means = zip(*mean)\n close_stream_means += [[close_model[0], np.array(stream_means)]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1156_C12", "label": "mean =", "type": "assigned_variable", "loc": [1156, 1156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1155_C8", "vector": [14, 3, 0.6598, 0.0006, 3, 0.58, 0.0, 856, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mean", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mean = close_model[1][3][k][\"mean\"][0:minlen]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1157_C12", "label": "stream_means = zip()", "type": "assigned_variable", "loc": [1157, 1157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1155_C8", "vector": [14, 3, 0.6604, 0.0006, 3, 0.58, 1.0, 555, 3, 1, 0, 0, 814, 10, 1], "semantic": {"name": "stream_means", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": " stream_means = zip(*mean)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1160_C8", "label": "expected_means, expected_vars =", "type": "assigned_variable", "loc": [1160, 1160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1152_C4", "vector": [14, 2, 0.6621, 0.0006, 2, 0.27, 0.5, 312, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "expected_means, expected_vars", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " expected_means, expected_vars = [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1161_C8", "label": "for i", "type": "for", "loc": [1161, 1175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1152_C4", "vector": [6, 2, 0.6667, 0.0086, 2, 0.27, 0.6667, 826, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(len(close_stream_means[0][1])):\n close_signals = []\n sum = np.array([0.]*len(close_stream_means[0][1][0]))\n distsum = 0.\n for close_stream in close_stream_means:\n close_signals += [close_stream[1][i]]\n dist = dist2(close_stream)\n sum += close_stream[1][i] / dist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1162_C12", "label": "close_signals =", "type": "assigned_variable", "loc": [1162, 1162], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1161_C8", "vector": [14, 3, 0.6632, 0.0006, 3, 0.44, 0.0, 16, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "close_signals", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " close_signals = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1163_C12", "label": "sum = array()", "type": "assigned_variable", "loc": [1163, 1163], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1161_C8", "vector": [14, 3, 0.6638, 0.0006, 3, 0.44, 0.2, 824, 3, 1, 0, 0, 80, 10, 2], "semantic": {"name": "sum", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " sum = np.array([0.]*len(close_stream_means[0][1][0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1164_C12", "label": "distsum =", "type": "assigned_variable", "loc": [1164, 1164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1161_C8", "vector": [14, 3, 0.6644, 0.0006, 3, 0.44, 0.4, 347, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "distsum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " distsum = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1165_C12", "label": "for close_stream", "type": "for", "loc": [1165, 1169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1161_C8", "vector": [6, 3, 0.6661, 0.0029, 3, 0.44, 0.6, 642, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close_stream", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for close_stream in close_stream_means:\n close_signals += [close_stream[1][i]]\n dist = dist2(close_stream)\n sum += close_stream[1][i] / dist\n distsum += 1. / dist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1167_C16", "label": "dist = dist2()", "type": "assigned_variable", "loc": [1167, 1167], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1165_C12", "vector": [14, 4, 0.6661, 0.0006, 4, 0.59, 0.0, 673, 3, 1, 0, 0, 533, 10, 1], "semantic": {"name": "dist", "arg_names": [], "import_names": [], "rhs_call_name": "dist2", "annotation": ""}, "snippet": " dist = dist2(close_stream)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1170_C12", "label": "expected_mean =", "type": "assigned_variable", "loc": [1170, 1170], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1161_C8", "vector": [14, 3, 0.6678, 0.0006, 3, 0.44, 0.8, 191, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "expected_mean", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " expected_mean = sum / distsum"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1171_C12", "label": "expected_var = signal_list_variance()", "type": "assigned_variable", "loc": [1171, 1173], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1161_C8", "vector": [14, 3, 0.6689, 0.0017, 3, 0.44, 1.0, 525, 3, 5, 0, 0, 321, 10, 1], "semantic": {"name": "expected_var", "arg_names": [], "import_names": [], "rhs_call_name": "signal_list_variance", "annotation": ""}, "snippet": " expected_var = signal_list_variance(close_signals, expected_mean, \n window_len, samples,\n resample)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1177_C8", "label": "ret_model =", "type": "assigned_variable", "loc": [1177, 1177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1152_C4", "vector": [14, 2, 0.6718, 0.0006, 2, 0.27, 0.8333, 28, 0, 0, 0, 0, 0, 6, 2], "semantic": {"name": "ret_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret_model = { \"mean\" : zip(*expected_means), \"variance\" : zip(*expected_vars) }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1178_C8", "label": "assign", "type": "assigned_variable", "loc": [1178, 1178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1152_C4", "vector": [14, 2, 0.6724, 0.0006, 2, 0.27, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret_models[k] = ret_model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1179_C4", "label": "return", "type": "return", "loc": [1179, 1179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "vector": [13, 1, 0.6729, 0.0006, 1, 0.9, 1.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [[x, y, r], None, None, ret_models, None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1182_C0", "label": "random_grasp", "type": "function", "loc": [1182, 1188], "level": 0, "parent": null, "vector": [2, 0, 0.6764, 0.004, 0, 0.66, 0.9, 371, 0, 0, 1, 0, 0, 0, 3], "semantic": {"name": "random_grasp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def random_grasp():\n xs = (RECT[1][0] - RECT[0][0]) / (NUM_X - 1)\n ys = (RECT[0][1] - RECT[1][1]) / (NUM_Y - 1)\n x = random.uniform(RECT[0][0]-xs/2., RECT[1][0]+xs/2.)\n y = random.uniform(RECT[1][1]-ys/2., RECT[0][1]+ys/2.)\n r = random.uniform(0., np.pi)\n return x, y, r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1183_C4", "label": "xs =", "type": "assigned_variable", "loc": [1183, 1183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1182_C0", "vector": [14, 1, 0.6752, 0.0006, 1, 0.15, 0.0, 928, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xs = (RECT[1][0] - RECT[0][0]) / (NUM_X - 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1184_C4", "label": "ys =", "type": "assigned_variable", "loc": [1184, 1184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1182_C0", "vector": [14, 1, 0.6758, 0.0006, 1, 0.15, 0.2, 578, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ys", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ys = (RECT[0][1] - RECT[1][1]) / (NUM_Y - 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1185_C4", "label": "x = uniform()", "type": "assigned_variable", "loc": [1185, 1185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1182_C0", "vector": [14, 1, 0.6764, 0.0006, 1, 0.15, 0.4, 190, 3, 2, 0, 0, 463, 10, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "uniform", "annotation": ""}, "snippet": " x = random.uniform(RECT[0][0]-xs/2., RECT[1][0]+xs/2.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1186_C4", "label": "y = uniform()", "type": "assigned_variable", "loc": [1186, 1186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1182_C0", "vector": [14, 1, 0.6769, 0.0006, 1, 0.15, 0.6, 304, 3, 2, 0, 0, 463, 10, 1], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "uniform", "annotation": ""}, "snippet": " y = random.uniform(RECT[1][1]-ys/2., RECT[0][1]+ys/2.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1187_C4", "label": "r = uniform()", "type": "assigned_variable", "loc": [1187, 1187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1182_C0", "vector": [14, 1, 0.6775, 0.0006, 1, 0.15, 0.8, 436, 3, 2, 0, 0, 463, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "uniform", "annotation": ""}, "snippet": " r = random.uniform(0., np.pi)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1188_C4", "label": "return", "type": "return", "loc": [1188, 1188], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1182_C0", "vector": [13, 1, 0.6781, 0.0006, 1, 0.15, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return x, y, r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1190_C0", "label": "random_known_grasp", "type": "function", "loc": [1190, 1193], "level": 0, "parent": null, "vector": [2, 0, 0.6801, 0.0023, 0, 0.66, 0.9077, 288, 0, 0, 1, 0, 0, 0, 3], "semantic": {"name": "random_known_grasp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def random_known_grasp():\n xyr_index = load_pickle(GRASP_INDEX_FILE)\n ind = random.randint(0,len(xyr_index)-1)\n return xyr_index[ind][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1191_C4", "label": "xyr_index = load_pickle()", "type": "assigned_variable", "loc": [1191, 1191], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1190_C0", "vector": [14, 1, 0.6798, 0.0006, 1, 0.02, 0.0, 414, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "xyr_index", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " xyr_index = load_pickle(GRASP_INDEX_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1192_C4", "label": "ind = randint()", "type": "assigned_variable", "loc": [1192, 1192], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1190_C0", "vector": [14, 1, 0.6804, 0.0006, 1, 0.02, 0.5, 680, 3, 2, 0, 0, 449, 10, 2], "semantic": {"name": "ind", "arg_names": [], "import_names": [], "rhs_call_name": "randint", "annotation": ""}, "snippet": " ind = random.randint(0,len(xyr_index)-1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1193_C4", "label": "return", "type": "return", "loc": [1193, 1193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1190_C0", "vector": [13, 1, 0.6809, 0.0006, 1, 0.02, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return xyr_index[ind][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "label": "test_random_grasps", "type": "function", "loc": [1195, 1225], "level": 0, "parent": null, "vector": [2, 0, 0.6906, 0.0177, 0, 0.66, 0.9154, 955, 0, 1, 0, 0, 0, 0, 11], "semantic": {"name": "test_random_grasps", "arg_names": ["num_grasps"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def test_random_grasps(num_grasps=100):\n cm = ControllerManager(armc)\n apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_GRASP_LIST)\n monitor_data = []\n grasps = []\n collided_list = []\n num_collided = 0\n test_data = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1196_C4", "label": "cm = ControllerManager()", "type": "assigned_variable", "loc": [1196, 1196], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "vector": [14, 1, 0.6826, 0.0006, 1, 0.76, 0.0, 675, 3, 1, 0, 0, 16, 10, 1], "semantic": {"name": "cm", "arg_names": [], "import_names": [], "rhs_call_name": "ControllerManager", "annotation": ""}, "snippet": " cm = ControllerManager(armc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1197_C4", "label": "apm = ArmPerceptionMonitor()", "type": "assigned_variable", "loc": [1197, 1197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "vector": [14, 1, 0.6832, 0.0006, 1, 0.76, 0.0909, 21, 3, 2, 0, 0, 815, 10, 1], "semantic": {"name": "apm", "arg_names": [], "import_names": [], "rhs_call_name": "ArmPerceptionMonitor", "annotation": ""}, "snippet": " apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_GRASP_LIST)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1198_C4", "label": "monitor_data =", "type": "assigned_variable", "loc": [1198, 1198], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "vector": [14, 1, 0.6838, 0.0006, 1, 0.76, 0.1818, 156, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "monitor_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " monitor_data = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1199_C4", "label": "grasps =", "type": "assigned_variable", "loc": [1199, 1199], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "vector": [14, 1, 0.6844, 0.0006, 1, 0.76, 0.2727, 384, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "grasps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasps = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1200_C4", "label": "collided_list =", "type": "assigned_variable", "loc": [1200, 1200], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "vector": [14, 1, 0.6849, 0.0006, 1, 0.76, 0.3636, 816, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "collided_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " collided_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1201_C4", "label": "num_collided =", "type": "assigned_variable", "loc": [1201, 1201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "vector": [14, 1, 0.6855, 0.0006, 1, 0.76, 0.4545, 539, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "num_collided", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " num_collided = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1202_C4", "label": "test_data =", "type": "assigned_variable", "loc": [1202, 1202], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "vector": [14, 1, 0.6861, 0.0006, 1, 0.76, 0.5455, 415, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "test_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_data = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1203_C4", "label": "zeros =", "type": "assigned_variable", "loc": [1203, 1203], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "vector": [14, 1, 0.6866, 0.0006, 1, 0.76, 0.6364, 213, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "zeros", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " zeros = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1204_C4", "label": "open_gripper()", "type": "expression", "loc": [1204, 1204], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "vector": [8, 1, 0.6872, 0.0006, 1, 0.76, 0.7273, 833, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "open_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "open_gripper", "annotation": ""}, "snippet": " open_gripper(cm=cm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1206_C4", "label": "for i", "type": "for", "loc": [1206, 1222], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "vector": [6, 1, 0.6929, 0.0097, 1, 0.76, 0.8182, 826, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(num_grasps):\n if rospy.is_shutdown():\n break\n x, y, rot = random_grasp()\n\n (grasp, monitor, collided, zeros) = perform_grasp(x, y, gripper_rot = rot, \n collide=False, is_grasp = False, \n zeros=zeros, cm=cm, apm=apm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1207_C8", "label": "if", "type": "if", "loc": [1207, 1208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1206_C4", "vector": [4, 2, 0.6892, 0.0011, 2, 0.38, 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 break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1209_C8", "label": "x, y, rot = random_grasp()", "type": "assigned_variable", "loc": [1209, 1209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1206_C4", "vector": [14, 2, 0.6901, 0.0006, 2, 0.38, 0.3333, 540, 3, 0, 0, 0, 371, 10, 1], "semantic": {"name": "x, y, rot", "arg_names": [], "import_names": [], "rhs_call_name": "random_grasp", "annotation": ""}, "snippet": " x, y, rot = random_grasp()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1211_C8", "label": "grasp, monitor, collided, zeros = perform_grasp()", "type": "assigned_variable", "loc": [1211, 1213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1206_C4", "vector": [14, 2, 0.6918, 0.0017, 2, 0.38, 0.6667, 868, 3, 8, 0, 0, 121, 10, 1], "semantic": {"name": "grasp, monitor, collided, zeros", "arg_names": [], "import_names": [], "rhs_call_name": "perform_grasp", "annotation": ""}, "snippet": " (grasp, monitor, collided, zeros) = perform_grasp(x, y, gripper_rot = rot, \n collide=False, is_grasp = False, \n zeros=zeros, cm=cm, apm=apm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1220_C8", "label": "if", "type": "if", "loc": [1220, 1222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1206_C4", "vector": [4, 2, 0.6969, 0.0017, 2, 0.38, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if collided:\n print(\"COLLIDED\\n\"*10)\n num_collided += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1221_C12", "label": "print()", "type": "expression", "loc": [1221, 1221], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1220_C8", "vector": [8, 3, 0.6969, 0.0006, 3, 0.08, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"COLLIDED\\n\"*10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1224_C4", "label": "print()", "type": "expression", "loc": [1224, 1224], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "vector": [8, 1, 0.6986, 0.0006, 1, 0.76, 0.9091, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Accuracy: %d collisions out of %d grasps (%1.2f)\" % (num_collided, num_grasps, 1. - float(num_collided) / num_grasps))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1225_C4", "label": "save_pickle()", "type": "expression", "loc": [1225, 1225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "vector": [8, 1, 0.6992, 0.0006, 1, 0.76, 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": " save_pickle(test_data, TEST_DATA_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1227_C0", "label": "calc_false_pos", "type": "function", "loc": [1227, 1252], "level": 0, "parent": null, "vector": [2, 0, 0.7075, 0.0148, 0, 0.66, 0.9231, 171, 0, 3, 1, 0, 0, 0, 12], "semantic": {"name": "calc_false_pos", "arg_names": ["test_data", "xyr_index", "apm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def calc_false_pos(test_data=None, xyr_index=None, apm=None):\n if test_data is None:\n test_data = load_pickle(TEST_DATA_FILE)\n if apm is None:\n apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_GRASP_LIST)\n num_collisions = 0\n indicies = {}\n for test in test_data:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1228_C4", "label": "if", "type": "if", "loc": [1228, 1229], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1227_C0", "vector": [4, 1, 0.7012, 0.0011, 1, 0.87, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_data is None:\n test_data = load_pickle(TEST_DATA_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1229_C8", "label": "test_data = load_pickle()", "type": "assigned_variable", "loc": [1229, 1229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1228_C4", "vector": [14, 2, 0.7015, 0.0006, 2, 0.86, 0.0, 415, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "test_data", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " test_data = load_pickle(TEST_DATA_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1230_C4", "label": "if", "type": "if", "loc": [1230, 1231], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1227_C0", "vector": [4, 1, 0.7023, 0.0011, 1, 0.87, 0.1429, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if apm is None:\n apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_GRASP_LIST)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1231_C8", "label": "apm = ArmPerceptionMonitor()", "type": "assigned_variable", "loc": [1231, 1231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1230_C4", "vector": [14, 2, 0.7026, 0.0006, 2, 0.06, 0.0, 21, 3, 2, 0, 0, 815, 10, 1], "semantic": {"name": "apm", "arg_names": [], "import_names": [], "rhs_call_name": "ArmPerceptionMonitor", "annotation": ""}, "snippet": " apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_GRASP_LIST)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1232_C4", "label": "num_collisions =", "type": "assigned_variable", "loc": [1232, 1232], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1227_C0", "vector": [14, 1, 0.7032, 0.0006, 1, 0.87, 0.2857, 738, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "num_collisions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " num_collisions = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1233_C4", "label": "indicies =", "type": "assigned_variable", "loc": [1233, 1233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1227_C0", "vector": [14, 1, 0.7038, 0.0006, 1, 0.87, 0.4286, 344, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "indicies", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " indicies = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1234_C4", "label": "for test", "type": "for", "loc": [1234, 1249], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1227_C0", "vector": [6, 1, 0.7086, 0.0091, 1, 0.87, 0.5714, 224, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for test in test_data:\n model = get_grasp_model(test[\"loc\"][0], test[\"loc\"][1], test[\"loc\"][2], \n xyr_index=xyr_index)\n collision = apm.simulate_monitoring(test[\"monitor\"], models=model[3], \n model_zeros = test[\"zeros\"],\n window_size=MONITOR_WINDOW,\n std_dev_default=STD_DEV, \n std_dev_dict = STD_DEV_DICT,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1235_C8", "label": "model = get_grasp_model()", "type": "assigned_variable", "loc": [1235, 1236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1234_C4", "vector": [14, 2, 0.7052, 0.0011, 2, 0.08, 0.0, 722, 3, 4, 0, 0, 85, 10, 1], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "get_grasp_model", "annotation": ""}, "snippet": " model = get_grasp_model(test[\"loc\"][0], test[\"loc\"][1], test[\"loc\"][2], \n xyr_index=xyr_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1237_C8", "label": "collision = simulate_monitoring()", "type": "assigned_variable", "loc": [1237, 1243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1234_C4", "vector": [14, 2, 0.7078, 0.004, 2, 0.08, 0.5, 871, 3, 8, 0, 0, 330, 10, 1], "semantic": {"name": "collision", "arg_names": [], "import_names": [], "rhs_call_name": "simulate_monitoring", "annotation": ""}, "snippet": " collision = apm.simulate_monitoring(test[\"monitor\"], models=model[3], \n model_zeros = test[\"zeros\"],\n window_size=MONITOR_WINDOW,\n std_dev_default=STD_DEV, \n std_dev_dict = STD_DEV_DICT,\n tol_thresh_dict = TOL_THRESH_DICT,\n noise_dev_default=NOISE_DEV)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1244_C8", "label": "if", "type": "if", "loc": [1244, 1249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1234_C4", "vector": [4, 2, 0.7115, 0.0034, 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 collision is not None:\n num_collisions += 1\n k, index, diff = collision\n if not k in indicies:\n indicies[k] = [0]*len(model[3][k][\"mean\"][0])\n indicies[k][index] += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1246_C12", "label": "k, index, diff =", "type": "assigned_variable", "loc": [1246, 1246], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1244_C8", "vector": [14, 3, 0.7112, 0.0006, 3, 0.68, 0.0, 725, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "k, index, diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " k, index, diff = collision"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1247_C12", "label": "if", "type": "if", "loc": [1247, 1248], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1244_C8", "vector": [4, 3, 0.712, 0.0011, 3, 0.68, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not k in indicies:\n indicies[k] = [0]*len(model[3][k][\"mean\"][0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1248_C16", "label": "assign", "type": "assigned_variable", "loc": [1248, 1248], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1247_C12", "vector": [14, 4, 0.7123, 0.0006, 4, 0.86, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " indicies[k] = [0]*len(model[3][k][\"mean\"][0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1250_C4", "label": "print()", "type": "expression", "loc": [1250, 1250], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1227_C0", "vector": [8, 1, 0.7135, 0.0006, 1, 0.87, 0.7143, 535, 3, 1, 0, 0, 0, 0, 4], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Accuracy: %d collisions out of %d grasps (%1.2f)\" % (num_collisions, len(test_data), 1. - float(num_collisions) / len(test_data)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1251_C4", "label": "print()", "type": "expression", "loc": [1251, 1251], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1227_C0", "vector": [8, 1, 0.714, 0.0006, 1, 0.87, 0.8571, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(indicies)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1252_C4", "label": "return", "type": "return", "loc": [1252, 1252], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1227_C0", "vector": [13, 1, 0.7146, 0.0006, 1, 0.87, 1.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return float(num_collisions) / len(test_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1301_C0", "label": "visualize_objs", "type": "function", "loc": [1301, 1319], "level": 0, "parent": null, "vector": [2, 0, 0.7477, 0.0108, 0, 0.66, 0.9308, 174, 0, 0, 0, 0, 0, 0, 17], "semantic": {"name": "visualize_objs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def visualize_objs():\n objs = detect_tabletop_objects()\n pubm = rospy.Publisher('grasp_obj_positions', Marker)\n pubma = rospy.Publisher('grasp_obj_positions_array', MarkerArray)\n markers = []\n for obj in objs:\n pos, angle = np.mat(obj[0]).T, obj[1]\n marker = viz.single_marker(pos, np.mat(quaternion_about_axis(angle, (0, 0, 1))).T, \"arrow\", \"torso_lift_link\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1302_C4", "label": "objs = detect_tabletop_objects()", "type": "assigned_variable", "loc": [1302, 1302], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1301_C0", "vector": [14, 1, 0.7432, 0.0006, 1, 0.6, 0.0, 794, 3, 0, 0, 0, 463, 10, 1], "semantic": {"name": "objs", "arg_names": [], "import_names": [], "rhs_call_name": "detect_tabletop_objects", "annotation": ""}, "snippet": " objs = detect_tabletop_objects()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1303_C4", "label": "pubm = Publisher()", "type": "assigned_variable", "loc": [1303, 1303], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1301_C0", "vector": [14, 1, 0.7437, 0.0006, 1, 0.6, 0.1111, 142, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "pubm", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " pubm = rospy.Publisher('grasp_obj_positions', Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1304_C4", "label": "pubma = Publisher()", "type": "assigned_variable", "loc": [1304, 1304], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1301_C0", "vector": [14, 1, 0.7443, 0.0006, 1, 0.6, 0.2222, 991, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "pubma", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " pubma = rospy.Publisher('grasp_obj_positions_array', MarkerArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1305_C4", "label": "markers =", "type": "assigned_variable", "loc": [1305, 1305], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1301_C0", "vector": [14, 1, 0.7449, 0.0006, 1, 0.6, 0.3333, 586, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "markers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " markers = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1306_C4", "label": "for obj", "type": "for", "loc": [1306, 1311], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1301_C0", "vector": [6, 1, 0.7469, 0.0034, 1, 0.6, 0.4444, 505, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for obj in objs:\n pos, angle = np.mat(obj[0]).T, obj[1]\n marker = viz.single_marker(pos, np.mat(quaternion_about_axis(angle, (0, 0, 1))).T, \"arrow\", \"torso_lift_link\")\n marker.header.stamp = rospy.Time.now()\n markers.append(marker)\n pubm.publish(marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1307_C8", "label": "pos, angle =", "type": "assigned_variable", "loc": [1307, 1307], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1306_C4", "vector": [14, 2, 0.746, 0.0006, 2, 0.34, 0.0, 621, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "pos, angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos, angle = np.mat(obj[0]).T, obj[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1308_C8", "label": "marker = single_marker()", "type": "assigned_variable", "loc": [1308, 1308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1306_C4", "vector": [14, 2, 0.7466, 0.0006, 2, 0.34, 0.25, 864, 3, 4, 0, 0, 614, 10, 3], "semantic": {"name": "marker", "arg_names": [], "import_names": [], "rhs_call_name": "single_marker", "annotation": ""}, "snippet": " marker = viz.single_marker(pos, np.mat(quaternion_about_axis(angle, (0, 0, 1))).T, \"arrow\", \"torso_lift_link\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1309_C8", "label": "marker.header.stamp = now()", "type": "assigned_variable", "loc": [1309, 1309], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1306_C4", "vector": [14, 2, 0.7471, 0.0006, 2, 0.34, 0.5, 625, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "marker.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " marker.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1310_C8", "label": "append()", "type": "expression", "loc": [1310, 1310], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1306_C4", "vector": [8, 2, 0.7477, 0.0006, 2, 0.34, 0.75, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " markers.append(marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1311_C8", "label": "publish()", "type": "expression", "loc": [1311, 1311], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1306_C4", "vector": [8, 2, 0.7483, 0.0006, 2, 0.34, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " pubm.publish(marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1312_C4", "label": "ma = MarkerArray()", "type": "assigned_variable", "loc": [1312, 1312], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1301_C0", "vector": [14, 1, 0.7489, 0.0006, 1, 0.6, 0.5556, 321, 3, 1, 0, 0, 49, 10, 1], "semantic": {"name": "ma", "arg_names": [], "import_names": [], "rhs_call_name": "MarkerArray", "annotation": ""}, "snippet": " ma = MarkerArray(markers)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1313_C4", "label": "i =", "type": "assigned_variable", "loc": [1313, 1313], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1301_C0", "vector": [14, 1, 0.7494, 0.0006, 1, 0.6, 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_99294:While_L1314_C4", "label": "while", "type": "while", "loc": [1314, 1317], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1301_C0", "vector": [5, 1, 0.7509, 0.0023, 1, 0.6, 0.7778, 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 pubm.publish(markers[i])\n rospy.sleep(2.1)\n i = (i + 1) % len(markers)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1315_C8", "label": "publish()", "type": "expression", "loc": [1315, 1315], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1314_C4", "vector": [8, 2, 0.7506, 0.0006, 2, 0.15, 0.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " pubm.publish(markers[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1316_C8", "label": "sleep()", "type": "expression", "loc": [1316, 1316], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1314_C4", "vector": [8, 2, 0.7511, 0.0006, 2, 0.15, 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(2.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1317_C8", "label": "i =", "type": "assigned_variable", "loc": [1317, 1317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1314_C4", "vector": [14, 2, 0.7517, 0.0006, 2, 0.15, 1.0, 826, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = (i + 1) % len(markers)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1318_C4", "label": "print()", "type": "expression", "loc": [1318, 1318], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1301_C0", "vector": [8, 1, 0.7523, 0.0006, 1, 0.6, 0.8889, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1319_C4", "label": "spin()", "type": "expression", "loc": [1319, 1319], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1301_C0", "vector": [8, 1, 0.7529, 0.0006, 1, 0.6, 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_99294:FunctionDef_L1321_C0", "label": "get_laser_dclick", "type": "function", "loc": [1321, 1343], "level": 0, "parent": null, "vector": [2, 0, 0.7603, 0.0131, 0, 0.66, 0.9385, 909, 0, 3, 1, 0, 0, 0, 18], "semantic": {"name": "get_laser_dclick", "arg_names": ["tf_listener", "frame", "delay_time"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_laser_dclick(tf_listener, frame = \"/torso_lift_link\", delay_time = 3.0):\n c3d_lis = GenericListener(\"c3dlisnode\", PointStamped, CURSOR_TOPIC, 10.0)\n dc_lis = GenericListener(\"dclisnode\", String, MOUSE_DOUBLE_CLICK_TOPIC, 10.0)\n print(\"Waiting for laser click...\")\n while not rospy.is_shutdown():\n if dc_lis.read(allow_duplication = False, willing_to_wait = False) is not None:\n print(\"DC\")\n msg = c3d_lis.read(allow_duplication = True, willing_to_wait = False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1322_C4", "label": "c3d_lis = GenericListener()", "type": "assigned_variable", "loc": [1322, 1322], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1321_C0", "vector": [14, 1, 0.7546, 0.0006, 1, 0.09, 0.0, 537, 3, 4, 0, 0, 36, 10, 1], "semantic": {"name": "c3d_lis", "arg_names": [], "import_names": [], "rhs_call_name": "GenericListener", "annotation": ""}, "snippet": " c3d_lis = GenericListener(\"c3dlisnode\", PointStamped, CURSOR_TOPIC, 10.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1323_C4", "label": "dc_lis = GenericListener()", "type": "assigned_variable", "loc": [1323, 1323], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1321_C0", "vector": [14, 1, 0.7551, 0.0006, 1, 0.09, 0.25, 2, 3, 4, 0, 0, 36, 10, 1], "semantic": {"name": "dc_lis", "arg_names": [], "import_names": [], "rhs_call_name": "GenericListener", "annotation": ""}, "snippet": " dc_lis = GenericListener(\"dclisnode\", String, MOUSE_DOUBLE_CLICK_TOPIC, 10.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1324_C4", "label": "print()", "type": "expression", "loc": [1324, 1324], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1321_C0", "vector": [8, 1, 0.7557, 0.0006, 1, 0.09, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Waiting for laser click...\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1325_C4", "label": "while", "type": "while", "loc": [1325, 1342], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1321_C0", "vector": [5, 1, 0.7611, 0.0103, 1, 0.09, 0.75, 0, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n if dc_lis.read(allow_duplication = False, willing_to_wait = False) is not None:\n print(\"DC\")\n msg = c3d_lis.read(allow_duplication = True, willing_to_wait = False)\n print(msg)\n if msg is not None:\n if rospy.Time.now().to_sec() - msg.header.stamp.to_sec() <= delay_time:\n now = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1326_C8", "label": "if", "type": "if", "loc": [1326, 1341], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1325_C4", "vector": [4, 2, 0.7611, 0.0091, 2, 0.88, 0.0, 0, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dc_lis.read(allow_duplication = False, willing_to_wait = False) is not None:\n print(\"DC\")\n msg = c3d_lis.read(allow_duplication = True, willing_to_wait = False)\n print(msg)\n if msg is not None:\n if rospy.Time.now().to_sec() - msg.header.stamp.to_sec() <= delay_time:\n now = rospy.Time.now()\n tf_listener.waitForTransform(msg.header.frame_id, frame, "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1327_C12", "label": "print()", "type": "expression", "loc": [1327, 1327], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1326_C8", "vector": [8, 3, 0.7574, 0.0006, 3, 0.47, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"DC\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1328_C12", "label": "msg = read()", "type": "assigned_variable", "loc": [1328, 1328], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1326_C8", "vector": [14, 3, 0.758, 0.0006, 3, 0.47, 0.3333, 712, 3, 2, 0, 0, 453, 10, 1], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " msg = c3d_lis.read(allow_duplication = True, willing_to_wait = False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1329_C12", "label": "print()", "type": "expression", "loc": [1329, 1329], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1326_C8", "vector": [8, 3, 0.7586, 0.0006, 3, 0.47, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1330_C12", "label": "if", "type": "if", "loc": [1330, 1341], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1326_C8", "vector": [4, 3, 0.7623, 0.0068, 3, 0.47, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg is not None:\n if rospy.Time.now().to_sec() - msg.header.stamp.to_sec() <= delay_time:\n now = rospy.Time.now()\n tf_listener.waitForTransform(msg.header.frame_id, frame, \n now, rospy.Duration(4.0))\n tfmat = tf_utils.transform(frame, msg.header.frame_id, tf_listener)\n tfmat *= np.mat([[msg.point.x], [msg.point.y], [msg.point.z], [1.0]])\n pt = tfmat[0:3,3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1331_C16", "label": "if", "type": "if", "loc": [1331, 1341], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1330_C12", "vector": [4, 4, 0.7626, 0.0063, 4, 0.58, 0.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rospy.Time.now().to_sec() - msg.header.stamp.to_sec() <= delay_time:\n now = rospy.Time.now()\n tf_listener.waitForTransform(msg.header.frame_id, frame, \n now, rospy.Duration(4.0))\n tfmat = tf_utils.transform(frame, msg.header.frame_id, tf_listener)\n tfmat *= np.mat([[msg.point.x], [msg.point.y], [msg.point.z], [1.0]])\n pt = tfmat[0:3,3]\n #(trans, rot) = tf_listener.lookupTransform(msg.header.frame_id, frame, now)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1332_C20", "label": "now = now()", "type": "assigned_variable", "loc": [1332, 1332], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1331_C16", "vector": [14, 5, 0.7603, 0.0006, 5, 0.94, 0.0, 894, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "now", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " now = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1333_C20", "label": "waitForTransform()", "type": "expression", "loc": [1333, 1334], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1331_C16", "vector": [8, 5, 0.7611, 0.0011, 5, 0.94, 0.2, 900, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " tf_listener.waitForTransform(msg.header.frame_id, frame, \n now, rospy.Duration(4.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1335_C20", "label": "tfmat = transform()", "type": "assigned_variable", "loc": [1335, 1335], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1331_C16", "vector": [14, 5, 0.762, 0.0006, 5, 0.94, 0.4, 337, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "tfmat", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " tfmat = tf_utils.transform(frame, msg.header.frame_id, tf_listener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1337_C20", "label": "pt =", "type": "assigned_variable", "loc": [1337, 1337], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1331_C16", "vector": [14, 5, 0.7631, 0.0006, 5, 0.94, 0.6, 989, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = tfmat[0:3,3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1340_C20", "label": "print()", "type": "expression", "loc": [1340, 1340], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1331_C16", "vector": [8, 5, 0.7648, 0.0006, 5, 0.94, 0.8, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"pt\", pt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1341_C20", "label": "return", "type": "return", "loc": [1341, 1341], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1331_C16", "vector": [13, 5, 0.7654, 0.0006, 5, 0.94, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pt[0,0], pt[1,0], pt[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1342_C8", "label": "sleep()", "type": "expression", "loc": [1342, 1342], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1325_C4", "vector": [8, 2, 0.766, 0.0006, 2, 0.88, 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_99294:Return_L1343_C4", "label": "return", "type": "return", "loc": [1343, 1343], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1321_C0", "vector": [13, 1, 0.7666, 0.0006, 1, 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_99294:FunctionDef_L1345_C0", "label": "point_head", "type": "function", "loc": [1345, 1364], "level": 0, "parent": null, "vector": [2, 0, 0.7731, 0.0114, 0, 0.66, 0.9462, 553, 0, 4, 1, 0, 0, 0, 9], "semantic": {"name": "point_head", "arg_names": ["point", "velocity", "frame", "block"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def point_head(point, velocity = 0.6, frame=\"/torso_lift_link\", block = True):\n head_action_client = actionlib.SimpleActionClient(\"/head_traj_controller/point_head_action\", PointHeadAction)\n head_action_client.wait_for_server()\n goal = PointHeadGoal()\n goal.target = cf.create_point_stamped(point, frame)\n goal.pointing_frame = \"/narrow_stereo_optical_frame\"\n goal.max_velocity = velocity\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1346_C4", "label": "head_action_client = SimpleActionClient()", "type": "assigned_variable", "loc": [1346, 1346], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1345_C0", "vector": [14, 1, 0.7683, 0.0006, 1, 0.08, 0.0, 410, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "head_action_client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " head_action_client = actionlib.SimpleActionClient(\"/head_traj_controller/point_head_action\", PointHeadAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1347_C4", "label": "wait_for_server()", "type": "expression", "loc": [1347, 1347], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1345_C0", "vector": [8, 1, 0.7688, 0.0006, 1, 0.08, 0.1, 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": " head_action_client.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1348_C4", "label": "goal = PointHeadGoal()", "type": "assigned_variable", "loc": [1348, 1348], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1345_C0", "vector": [14, 1, 0.7694, 0.0006, 1, 0.08, 0.2, 914, 3, 0, 0, 0, 479, 10, 1], "semantic": {"name": "goal", "arg_names": [], "import_names": [], "rhs_call_name": "PointHeadGoal", "annotation": ""}, "snippet": " goal = PointHeadGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1349_C4", "label": "goal.target = create_point_stamped()", "type": "assigned_variable", "loc": [1349, 1349], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1345_C0", "vector": [14, 1, 0.77, 0.0006, 1, 0.08, 0.3, 730, 3, 2, 0, 0, 184, 10, 1], "semantic": {"name": "goal.target", "arg_names": [], "import_names": [], "rhs_call_name": "create_point_stamped", "annotation": ""}, "snippet": " goal.target = cf.create_point_stamped(point, frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1350_C4", "label": "goal.pointing_frame =", "type": "assigned_variable", "loc": [1350, 1350], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1345_C0", "vector": [14, 1, 0.7705, 0.0006, 1, 0.08, 0.4, 177, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "goal.pointing_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.pointing_frame = \"/narrow_stereo_optical_frame\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1351_C4", "label": "goal.max_velocity =", "type": "assigned_variable", "loc": [1351, 1351], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1345_C0", "vector": [14, 1, 0.7711, 0.0006, 1, 0.08, 0.5, 950, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.max_velocity", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.max_velocity = velocity"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1353_C4", "label": "send_goal()", "type": "expression", "loc": [1353, 1353], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1345_C0", "vector": [8, 1, 0.7723, 0.0006, 1, 0.08, 0.6, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " head_action_client.send_goal(goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1355_C4", "label": "if", "type": "if", "loc": [1355, 1356], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1345_C0", "vector": [4, 1, 0.7737, 0.0011, 1, 0.08, 0.7, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not block:\n return 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1356_C8", "label": "return", "type": "return", "loc": [1356, 1356], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1355_C4", "vector": [13, 2, 0.774, 0.0006, 2, 0.61, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1358_C4", "label": "finished_within_time = wait_for_result()", "type": "assigned_variable", "loc": [1358, 1358], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1345_C0", "vector": [14, 1, 0.7751, 0.0006, 1, 0.08, 0.8, 778, 3, 1, 0, 0, 328, 10, 2], "semantic": {"name": "finished_within_time", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_result", "annotation": ""}, "snippet": " finished_within_time = head_action_client.wait_for_result(rospy.Duration(20))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1359_C4", "label": "if", "type": "if", "loc": [1359, 1362], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1345_C0", "vector": [4, 1, 0.7765, 0.0023, 1, 0.08, 0.9, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not finished_within_time:\n head_action_client.cancel_goal()\n rospy.logerr(\"timed out when asking the head to point to a new goal\")\n return 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1360_C8", "label": "cancel_goal()", "type": "expression", "loc": [1360, 1360], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1359_C4", "vector": [8, 2, 0.7763, 0.0006, 2, 0.15, 0.0, 349, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel_goal", "arg_names": [], "import_names": [], "rhs_call_name": "cancel_goal", "annotation": ""}, "snippet": " head_action_client.cancel_goal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1361_C8", "label": "logerr()", "type": "expression", "loc": [1361, 1361], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1359_C4", "vector": [8, 2, 0.7768, 0.0006, 2, 0.15, 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(\"timed out when asking the head to point to a new goal\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1362_C8", "label": "return", "type": "return", "loc": [1362, 1362], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1359_C4", "vector": [13, 2, 0.7774, 0.0006, 2, 0.15, 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_99294:Return_L1364_C4", "label": "return", "type": "return", "loc": [1364, 1364], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1345_C0", "vector": [13, 1, 0.7785, 0.0006, 1, 0.08, 1.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1366_C0", "label": "hand_over_object", "type": "function", "loc": [1366, 1388], "level": 0, "parent": null, "vector": [2, 0, 0.786, 0.0131, 0, 0.66, 0.9538, 489, 0, 7, 0, 0, 0, 0, 12], "semantic": {"name": "hand_over_object", "arg_names": ["x", "y", "z", "cm", "apm", "offset", "blocking"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def hand_over_object(x, y, z, cm, apm, offset = 0.2, blocking = True):\n pt = np.array([x,y,z])\n quat = quaternion_about_axis(0.9, (0, 0, 1))\n dist = np.linalg.norm(pt)\n start_angles = cm.get_current_arm_angles()\n print(start_angles)\n ptnorm = pt / dist\n dist -= offset"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1367_C4", "label": "pt = array()", "type": "assigned_variable", "loc": [1367, 1367], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1366_C0", "vector": [14, 1, 0.7803, 0.0006, 1, 0.13, 0.0, 989, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " pt = np.array([x,y,z])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1368_C4", "label": "quat = quaternion_about_axis()", "type": "assigned_variable", "loc": [1368, 1368], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1366_C0", "vector": [14, 1, 0.7808, 0.0006, 1, 0.13, 0.125, 367, 3, 2, 0, 0, 932, 10, 1], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_about_axis", "annotation": ""}, "snippet": " quat = quaternion_about_axis(0.9, (0, 0, 1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1369_C4", "label": "dist = norm()", "type": "assigned_variable", "loc": [1369, 1369], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1366_C0", "vector": [14, 1, 0.7814, 0.0006, 1, 0.13, 0.25, 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(pt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1370_C4", "label": "start_angles = get_current_arm_angles()", "type": "assigned_variable", "loc": [1370, 1370], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1366_C0", "vector": [14, 1, 0.782, 0.0006, 1, 0.13, 0.375, 267, 3, 0, 0, 0, 377, 10, 1], "semantic": {"name": "start_angles", "arg_names": [], "import_names": [], "rhs_call_name": "get_current_arm_angles", "annotation": ""}, "snippet": " start_angles = cm.get_current_arm_angles()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1371_C4", "label": "print()", "type": "expression", "loc": [1371, 1371], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1366_C0", "vector": [8, 1, 0.7825, 0.0006, 1, 0.13, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(start_angles)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1372_C4", "label": "ptnorm =", "type": "assigned_variable", "loc": [1372, 1372], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1366_C0", "vector": [14, 1, 0.7831, 0.0006, 1, 0.13, 0.625, 266, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ptnorm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ptnorm = pt / dist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1374_C4", "label": "joints =", "type": "assigned_variable", "loc": [1374, 1374], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1366_C0", "vector": [14, 1, 0.7842, 0.0006, 1, 0.13, 0.75, 846, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "joints", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joints = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1375_C4", "label": "while", "type": "while", "loc": [1375, 1386], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1366_C0", "vector": [5, 1, 0.788, 0.0068, 1, 0.13, 0.875, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown() and pt[0] > 0.2:\n pt = dist * ptnorm\n print(\"dist\", dist)\n pose = create_gripper_pose(pt[0], pt[1], pt[2], quat.tolist())\n print(pose)\n\n \n HANDOFF_BIAS = [0., -.25, -100., 200., 0.0, 200.0, 0.]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1376_C8", "label": "pt =", "type": "assigned_variable", "loc": [1376, 1376], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1375_C4", "vector": [14, 2, 0.7854, 0.0006, 2, 0.76, 0.0, 989, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = dist * ptnorm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1377_C8", "label": "print()", "type": "expression", "loc": [1377, 1377], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1375_C4", "vector": [8, 2, 0.786, 0.0006, 2, 0.76, 0.1667, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"dist\", dist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1378_C8", "label": "pose = create_gripper_pose()", "type": "assigned_variable", "loc": [1378, 1378], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1375_C4", "vector": [14, 2, 0.7865, 0.0006, 2, 0.76, 0.3333, 767, 3, 4, 0, 0, 516, 10, 2], "semantic": {"name": "pose", "arg_names": [], "import_names": [], "rhs_call_name": "create_gripper_pose", "annotation": ""}, "snippet": " pose = create_gripper_pose(pt[0], pt[1], pt[2], quat.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1379_C8", "label": "print()", "type": "expression", "loc": [1379, 1379], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1375_C4", "vector": [8, 2, 0.7871, 0.0006, 2, 0.76, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(pose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1382_C8", "label": "HANDOFF_BIAS =", "type": "assigned_variable", "loc": [1382, 1382], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1375_C4", "vector": [14, 2, 0.7888, 0.0006, 2, 0.76, 0.6667, 441, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "HANDOFF_BIAS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " HANDOFF_BIAS = [0., -.25, -100., 200., 0.0, 200.0, 0.]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1383_C8", "label": "joints = run_biased_ik()", "type": "assigned_variable", "loc": [1383, 1383], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1375_C4", "vector": [14, 2, 0.7894, 0.0006, 2, 0.76, 0.8333, 846, 3, 3, 0, 0, 438, 10, 1], "semantic": {"name": "joints", "arg_names": [], "import_names": [], "rhs_call_name": "run_biased_ik", "annotation": ""}, "snippet": " joints = cm.ik_utilities.run_biased_ik(pose, HANDOFF_BIAS, num_iters=30)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1384_C8", "label": "if", "type": "if", "loc": [1384, 1385], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1375_C4", "vector": [4, 2, 0.7902, 0.0011, 2, 0.76, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if joints is not None:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1388_C4", "label": "command_joint_trajectory()", "type": "expression", "loc": [1388, 1388], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1366_C0", "vector": [8, 1, 0.7922, 0.0006, 1, 0.13, 1.0, 553, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "command_joint_trajectory", "arg_names": [], "import_names": [], "rhs_call_name": "command_joint_trajectory", "annotation": ""}, "snippet": " cm.command_joint_trajectory([joints], 0.27, blocking = blocking)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1391_C0", "label": "change_projector_mode", "type": "function", "loc": [1391, 1399], "level": 0, "parent": null, "vector": [2, 0, 0.7962, 0.0051, 0, 0.66, 0.9615, 446, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "change_projector_mode", "arg_names": ["on"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def change_projector_mode(on):\n client = dynamic_reconfigure.client.Client(\"camera_synchronizer_node\")\n node_config = client.get_configuration()\n node_config[\"projector_mode\"] = 2\n if on:\n node_config[\"narrow_stereo_trig_mode\"] = 3\n else:\n node_config[\"narrow_stereo_trig_mode\"] = 4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1392_C4", "label": "client = Client()", "type": "assigned_variable", "loc": [1392, 1392], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1391_C0", "vector": [14, 1, 0.7945, 0.0006, 1, 0.9, 0.0, 608, 3, 1, 0, 0, 412, 10, 1], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "Client", "annotation": ""}, "snippet": " client = dynamic_reconfigure.client.Client(\"camera_synchronizer_node\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1393_C4", "label": "node_config = get_configuration()", "type": "assigned_variable", "loc": [1393, 1393], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1391_C0", "vector": [14, 1, 0.7951, 0.0006, 1, 0.9, 0.25, 333, 3, 0, 0, 0, 942, 10, 1], "semantic": {"name": "node_config", "arg_names": [], "import_names": [], "rhs_call_name": "get_configuration", "annotation": ""}, "snippet": " node_config = client.get_configuration()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1394_C4", "label": "assign", "type": "assigned_variable", "loc": [1394, 1394], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1391_C0", "vector": [14, 1, 0.7957, 0.0006, 1, 0.9, 0.5, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " node_config[\"projector_mode\"] = 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1395_C4", "label": "if", "type": "if", "loc": [1395, 1398], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1391_C0", "vector": [4, 1, 0.7971, 0.0023, 1, 0.9, 0.75, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if on:\n node_config[\"narrow_stereo_trig_mode\"] = 3\n else:\n node_config[\"narrow_stereo_trig_mode\"] = 4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1396_C8", "label": "assign", "type": "assigned_variable", "loc": [1396, 1396], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1395_C4", "vector": [14, 2, 0.7968, 0.0006, 2, 0.48, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " node_config[\"narrow_stereo_trig_mode\"] = 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1398_C8", "label": "assign", "type": "assigned_variable", "loc": [1398, 1398], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1395_C4", "vector": [14, 2, 0.7979, 0.0006, 2, 0.48, 1.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " node_config[\"narrow_stereo_trig_mode\"] = 4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1399_C4", "label": "update_configuration()", "type": "expression", "loc": [1399, 1399], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1391_C0", "vector": [8, 1, 0.7985, 0.0006, 1, 0.9, 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": " client.update_configuration(node_config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1401_C0", "label": "move_to_setup", "type": "function", "loc": [1401, 1403], "level": 0, "parent": null, "vector": [2, 0, 0.8002, 0.0017, 0, 0.66, 0.9692, 739, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "move_to_setup", "arg_names": ["cm", "blocking"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def move_to_setup(cm, blocking = True):\n joints = [-0.62734204881265387, -0.34601608409943324, -1.4620635485239604, -1.2729772622637399, -7.5123303230158518, -1.5570651396529178, -5.5929916630672727] \n cm.command_joint_trajectory([joints], 0.62, blocking = blocking)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1402_C4", "label": "joints =", "type": "assigned_variable", "loc": [1402, 1402], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1401_C0", "vector": [14, 1, 0.8002, 0.0006, 1, 0.31, 0.0, 846, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "joints", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joints = [-0.62734204881265387, -0.34601608409943324, -1.4620635485239604, -1.2729772622637399, -7.5123303230158518, -1.5570651396529178, -5.5929916630672727] "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1403_C4", "label": "command_joint_trajectory()", "type": "expression", "loc": [1403, 1403], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1401_C0", "vector": [8, 1, 0.8008, 0.0006, 1, 0.31, 1.0, 553, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "command_joint_trajectory", "arg_names": [], "import_names": [], "rhs_call_name": "command_joint_trajectory", "annotation": ""}, "snippet": " cm.command_joint_trajectory([joints], 0.62, blocking = blocking)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1406_C0", "label": "laser_interface_demo", "type": "function", "loc": [1406, 1421], "level": 0, "parent": null, "vector": [2, 0, 0.8068, 0.0091, 0, 0.66, 0.9769, 293, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "laser_interface_demo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def laser_interface_demo():\n cm = ControllerManager(armc)\n apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_GRASP_LIST)\n\n move_to_setup(cm)\n\n x, y, z = get_laser_dclick(cm.tf_listener)\n# x, y, z = 0.7, 0.0, -0.3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1407_C4", "label": "cm = ControllerManager()", "type": "assigned_variable", "loc": [1407, 1407], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1406_C0", "vector": [14, 1, 0.8031, 0.0006, 1, 0.35, 0.0, 675, 3, 1, 0, 0, 16, 10, 1], "semantic": {"name": "cm", "arg_names": [], "import_names": [], "rhs_call_name": "ControllerManager", "annotation": ""}, "snippet": " cm = ControllerManager(armc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1408_C4", "label": "apm = ArmPerceptionMonitor()", "type": "assigned_variable", "loc": [1408, 1408], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1406_C0", "vector": [14, 1, 0.8037, 0.0006, 1, 0.35, 0.125, 21, 3, 2, 0, 0, 815, 10, 1], "semantic": {"name": "apm", "arg_names": [], "import_names": [], "rhs_call_name": "ArmPerceptionMonitor", "annotation": ""}, "snippet": " apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_GRASP_LIST)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1410_C4", "label": "move_to_setup()", "type": "expression", "loc": [1410, 1410], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1406_C0", "vector": [8, 1, 0.8048, 0.0006, 1, 0.35, 0.25, 739, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "move_to_setup", "arg_names": [], "import_names": [], "rhs_call_name": "move_to_setup", "annotation": ""}, "snippet": " move_to_setup(cm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1412_C4", "label": "x, y, z = get_laser_dclick()", "type": "assigned_variable", "loc": [1412, 1412], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1406_C0", "vector": [14, 1, 0.8059, 0.0006, 1, 0.35, 0.375, 971, 3, 1, 0, 0, 909, 10, 1], "semantic": {"name": "x, y, z", "arg_names": [], "import_names": [], "rhs_call_name": "get_laser_dclick", "annotation": ""}, "snippet": " x, y, z = get_laser_dclick(cm.tf_listener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1414_C4", "label": "point_head()", "type": "expression", "loc": [1414, 1414], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1406_C0", "vector": [8, 1, 0.8071, 0.0006, 1, 0.35, 0.5, 553, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "point_head", "arg_names": [], "import_names": [], "rhs_call_name": "point_head", "annotation": ""}, "snippet": " point_head([x,y,z], block = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1416_C4", "label": "grasp_closest_object()", "type": "expression", "loc": [1416, 1416], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1406_C0", "vector": [8, 1, 0.8082, 0.0006, 1, 0.35, 0.625, 670, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "grasp_closest_object", "arg_names": [], "import_names": [], "rhs_call_name": "grasp_closest_object", "annotation": ""}, "snippet": " grasp_closest_object(x, y, cm=cm, apm=apm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1417_C4", "label": "change_projector_mode()", "type": "expression", "loc": [1417, 1417], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1406_C0", "vector": [8, 1, 0.8088, 0.0006, 1, 0.35, 0.75, 446, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "change_projector_mode", "arg_names": [], "import_names": [], "rhs_call_name": "change_projector_mode", "annotation": ""}, "snippet": " change_projector_mode(on=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1419_C4", "label": "x, y, z = get_laser_dclick()", "type": "assigned_variable", "loc": [1419, 1419], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1406_C0", "vector": [14, 1, 0.8099, 0.0006, 1, 0.35, 0.875, 971, 3, 1, 0, 0, 909, 10, 1], "semantic": {"name": "x, y, z", "arg_names": [], "import_names": [], "rhs_call_name": "get_laser_dclick", "annotation": ""}, "snippet": " x, y, z = get_laser_dclick(cm.tf_listener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1421_C4", "label": "point_head()", "type": "expression", "loc": [1421, 1421], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1406_C0", "vector": [8, 1, 0.8111, 0.0006, 1, 0.35, 1.0, 553, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "point_head", "arg_names": [], "import_names": [], "rhs_call_name": "point_head", "annotation": ""}, "snippet": " point_head([x,y,z+0.2], block = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1424_C0", "label": "monitor_pressure", "type": "function", "loc": [1424, 1443], "level": 0, "parent": null, "vector": [2, 0, 0.8182, 0.0114, 0, 0.66, 0.9846, 718, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "monitor_pressure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def monitor_pressure():\n apm = ArmPerceptionMonitor(ARM, percept_mon_list=PRESSURE_LIST)\n rospy.sleep(1.0)\n\n models = {}\n for k in PRESSURE_LIST:\n if \"periph\" in k:\n models[k] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1425_C4", "label": "apm = ArmPerceptionMonitor()", "type": "assigned_variable", "loc": [1425, 1425], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1424_C0", "vector": [14, 1, 0.8134, 0.0006, 1, 0.4, 0.0, 21, 3, 2, 0, 0, 815, 10, 1], "semantic": {"name": "apm", "arg_names": [], "import_names": [], "rhs_call_name": "ArmPerceptionMonitor", "annotation": ""}, "snippet": " apm = ArmPerceptionMonitor(ARM, percept_mon_list=PRESSURE_LIST)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1426_C4", "label": "sleep()", "type": "expression", "loc": [1426, 1426], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1424_C0", "vector": [8, 1, 0.8139, 0.0006, 1, 0.4, 0.1429, 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_99294:Assign_L1428_C4", "label": "models =", "type": "assigned_variable", "loc": [1428, 1428], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1424_C0", "vector": [14, 1, 0.8151, 0.0006, 1, 0.4, 0.2857, 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_99294:For_L1429_C4", "label": "for k", "type": "for", "loc": [1429, 1437], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1424_C0", "vector": [6, 1, 0.8179, 0.0051, 1, 0.4, 0.4286, 954, 2, 0, 0, 0, 0, 0, 8], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in PRESSURE_LIST:\n if \"periph\" in k:\n models[k] = {}\n models[k][\"mean\"] = np.array([np.array([0.]*6)])\n models[k][\"variance\"] = np.array([np.array([40.]*6)])\n if \"pad\" in k:\n models[k] = {}\n models[k][\"mean\"] = np.array([np.array([0.]*15)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1430_C8", "label": "if", "type": "if", "loc": [1430, 1433], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1429_C4", "vector": [4, 2, 0.8171, 0.0023, 2, 0.1, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if \"periph\" in k:\n models[k] = {}\n models[k][\"mean\"] = np.array([np.array([0.]*6)])\n models[k][\"variance\"] = np.array([np.array([40.]*6)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1431_C12", "label": "assign", "type": "assigned_variable", "loc": [1431, 1431], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1430_C8", "vector": [14, 3, 0.8168, 0.0006, 3, 0.46, 0.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " models[k] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1432_C12", "label": " = array()", "type": "assigned_variable", "loc": [1432, 1432], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1430_C8", "vector": [14, 3, 0.8174, 0.0006, 3, 0.46, 0.5, 0, 3, 1, 0, 0, 80, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " models[k][\"mean\"] = np.array([np.array([0.]*6)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1433_C12", "label": " = array()", "type": "assigned_variable", "loc": [1433, 1433], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1430_C8", "vector": [14, 3, 0.8179, 0.0006, 3, 0.46, 1.0, 0, 3, 1, 0, 0, 80, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " models[k][\"variance\"] = np.array([np.array([40.]*6)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1434_C8", "label": "if", "type": "if", "loc": [1434, 1437], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1429_C4", "vector": [4, 2, 0.8193, 0.0023, 2, 0.1, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if \"pad\" in k:\n models[k] = {}\n models[k][\"mean\"] = np.array([np.array([0.]*15)])\n models[k][\"variance\"] = np.array([np.array([40.]*15)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1435_C12", "label": "assign", "type": "assigned_variable", "loc": [1435, 1435], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1434_C8", "vector": [14, 3, 0.8191, 0.0006, 3, 0.59, 0.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " models[k] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1436_C12", "label": " = array()", "type": "assigned_variable", "loc": [1436, 1436], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1434_C8", "vector": [14, 3, 0.8196, 0.0006, 3, 0.59, 0.5, 0, 3, 1, 0, 0, 80, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " models[k][\"mean\"] = np.array([np.array([0.]*15)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1437_C12", "label": " = array()", "type": "assigned_variable", "loc": [1437, 1437], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1434_C8", "vector": [14, 3, 0.8202, 0.0006, 3, 0.59, 1.0, 0, 3, 1, 0, 0, 80, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " models[k][\"variance\"] = np.array([np.array([40.]*15)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1439_C4", "label": "begin_monitoring()", "type": "expression", "loc": [1439, 1439], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1424_C0", "vector": [8, 1, 0.8213, 0.0006, 1, 0.4, 0.5714, 794, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "begin_monitoring", "arg_names": [], "import_names": [], "rhs_call_name": "begin_monitoring", "annotation": ""}, "snippet": " apm.begin_monitoring(models, only_pressure=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1440_C4", "label": "print()", "type": "expression", "loc": [1440, 1440], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1424_C0", "vector": [8, 1, 0.8219, 0.0006, 1, 0.4, 0.7143, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Monitoring pressure...\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1441_C4", "label": "while", "type": "while", "loc": [1441, 1442], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1424_C0", "vector": [5, 1, 0.8228, 0.0011, 1, 0.4, 0.8571, 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 apm.failure:\n rospy.sleep(0.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1442_C8", "label": "sleep()", "type": "expression", "loc": [1442, 1442], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1441_C4", "vector": [8, 2, 0.8231, 0.0006, 2, 0.07, 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.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1443_C4", "label": "print()", "type": "expression", "loc": [1443, 1443], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1424_C0", "vector": [8, 1, 0.8236, 0.0006, 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(\"Pressure triggered\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "label": "main", "type": "function", "loc": [1482, 1748], "level": 0, "parent": null, "vector": [2, 0, 0.9218, 0.1524, 0, 0.66, 0.9923, 624, 0, 0, 1, 0, 0, 0, 42], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n rospy.init_node(node_name)\n # rospy.on_shutdown(die)\n setup_package_loc()\n ki = KeyboardInput()\n\n #x, y, z = get_laser_dclick()\n #laser_interface_demo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1483_C4", "label": "init_node()", "type": "expression", "loc": [1483, 1483], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [8, 1, 0.8465, 0.0006, 1, 0.05, 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(node_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1485_C4", "label": "setup_package_loc()", "type": "expression", "loc": [1485, 1485], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [8, 1, 0.8476, 0.0006, 1, 0.05, 0.04, 396, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "setup_package_loc", "arg_names": [], "import_names": [], "rhs_call_name": "setup_package_loc", "annotation": ""}, "snippet": " setup_package_loc()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1486_C4", "label": "ki = KeyboardInput()", "type": "assigned_variable", "loc": [1486, 1486], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [14, 1, 0.8482, 0.0006, 1, 0.05, 0.08, 785, 3, 0, 0, 0, 67, 10, 1], "semantic": {"name": "ki", "arg_names": [], "import_names": [], "rhs_call_name": "KeyboardInput", "annotation": ""}, "snippet": " ki = KeyboardInput()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1492_C4", "label": "generate_space_models()", "type": "expression", "loc": [1492, 1492], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [8, 1, 0.8516, 0.0006, 1, 0.05, 0.12, 753, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "generate_space_models", "arg_names": [], "import_names": [], "rhs_call_name": "generate_space_models", "annotation": ""}, "snippet": " generate_space_models()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1493_C4", "label": "return", "type": "return", "loc": [1493, 1493], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [13, 1, 0.8522, 0.0006, 1, 0.05, 0.16, 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_99294:Assign_L1573_C4", "label": "cm = ControllerManager()", "type": "assigned_variable", "loc": [1573, 1573], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [14, 1, 0.8978, 0.0006, 1, 0.05, 0.2, 675, 3, 1, 0, 0, 16, 10, 1], "semantic": {"name": "cm", "arg_names": [], "import_names": [], "rhs_call_name": "ControllerManager", "annotation": ""}, "snippet": " cm = ControllerManager(armc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1574_C4", "label": "apm = ArmPerceptionMonitor()", "type": "assigned_variable", "loc": [1574, 1574], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [14, 1, 0.8984, 0.0006, 1, 0.05, 0.24, 21, 3, 2, 0, 0, 815, 10, 1], "semantic": {"name": "apm", "arg_names": [], "import_names": [], "rhs_call_name": "ArmPerceptionMonitor", "annotation": ""}, "snippet": " apm = ArmPerceptionMonitor(ARM, percept_mon_list=PERCEPT_GRASP_LIST) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1624_C4", "label": "open_gripper()", "type": "expression", "loc": [1624, 1624], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [8, 1, 0.9269, 0.0006, 1, 0.05, 0.28, 833, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "open_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "open_gripper", "annotation": ""}, "snippet": " open_gripper(cm = cm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1626_C4", "label": "monitor_data =", "type": "assigned_variable", "loc": [1626, 1626], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [14, 1, 0.9281, 0.0006, 1, 0.05, 0.32, 156, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "monitor_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " monitor_data = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1627_C4", "label": "monitor_zeros =", "type": "assigned_variable", "loc": [1627, 1627], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [14, 1, 0.9287, 0.0006, 1, 0.05, 0.36, 210, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "monitor_zeros", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " monitor_zeros = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1628_C4", "label": "grasps =", "type": "assigned_variable", "loc": [1628, 1628], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [14, 1, 0.9292, 0.0006, 1, 0.05, 0.4, 384, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "grasps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasps = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1629_C4", "label": "collided_list =", "type": "assigned_variable", "loc": [1629, 1629], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [14, 1, 0.9298, 0.0006, 1, 0.05, 0.44, 816, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "collided_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " collided_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1630_C4", "label": "num_grasps =", "type": "assigned_variable", "loc": [1630, 1630], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [14, 1, 0.9304, 0.0006, 1, 0.05, 0.48, 492, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "num_grasps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " num_grasps = 100"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1631_C4", "label": "num_collided =", "type": "assigned_variable", "loc": [1631, 1631], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [14, 1, 0.9309, 0.0006, 1, 0.05, 0.52, 539, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "num_collided", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " num_collided = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1632_C4", "label": "zeros =", "type": "assigned_variable", "loc": [1632, 1632], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [14, 1, 0.9315, 0.0006, 1, 0.05, 0.56, 213, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "zeros", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " zeros = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1634_C4", "label": "z_sum =", "type": "assigned_variable", "loc": [1634, 1634], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [14, 1, 0.9326, 0.0006, 1, 0.05, 0.6, 517, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "z_sum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_sum = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1636_C4", "label": "for i", "type": "for", "loc": [1636, 1699], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [6, 1, 0.9518, 0.0365, 1, 0.05, 0.64, 826, 3, 0, 0, 0, 0, 0, 28], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(num_grasps):\n point_head([0.5, 0.0, -0.2], block=False)\n #move_to_setup(cm)\n if rospy.is_shutdown():\n break\n #x, y, rot = random.uniform(.45, .65), random.uniform(-.2, .2), random.uniform(0., 3.14)\n\n if False:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1637_C8", "label": "point_head()", "type": "expression", "loc": [1637, 1637], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1636_C4", "vector": [8, 2, 0.9344, 0.0006, 2, 0.72, 0.0, 553, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "point_head", "arg_names": [], "import_names": [], "rhs_call_name": "point_head", "annotation": ""}, "snippet": " point_head([0.5, 0.0, -0.2], block=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1639_C8", "label": "if", "type": "if", "loc": [1639, 1640], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1636_C4", "vector": [4, 2, 0.9358, 0.0011, 2, 0.72, 0.2, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rospy.is_shutdown():\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1643_C8", "label": "if", "type": "if", "loc": [1643, 1679], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1636_C4", "vector": [4, 2, 0.9481, 0.0211, 2, 0.72, 0.4, 0, 1, 0, 0, 0, 0, 0, 19], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n #rot = 0.\n #global STD_DEV_DICT\n #STD_DEV_DICT = None\n if False:\n x, y, rot = random_grasp()\n else:\n x, y, rot = random_known_grasp()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1647_C12", "label": "if", "type": "if", "loc": [1647, 1650], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1643_C8", "vector": [4, 3, 0.9409, 0.0023, 3, 0.79, 0.0, 0, 1, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n x, y, rot = random_grasp()\n else:\n x, y, rot = random_known_grasp()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1648_C16", "label": "x, y, rot = random_grasp()", "type": "assigned_variable", "loc": [1648, 1648], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1647_C12", "vector": [14, 4, 0.9406, 0.0006, 4, 0.58, 0.0, 540, 3, 0, 0, 0, 371, 10, 1], "semantic": {"name": "x, y, rot", "arg_names": [], "import_names": [], "rhs_call_name": "random_grasp", "annotation": ""}, "snippet": " x, y, rot = random_grasp()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1650_C16", "label": "x, y, rot = random_known_grasp()", "type": "assigned_variable", "loc": [1650, 1650], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1647_C12", "vector": [14, 4, 0.9418, 0.0006, 4, 0.58, 1.0, 540, 3, 0, 0, 0, 288, 10, 1], "semantic": {"name": "x, y, rot", "arg_names": [], "import_names": [], "rhs_call_name": "random_known_grasp", "annotation": ""}, "snippet": " x, y, rot = random_known_grasp()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1651_C12", "label": "grasp, monitor, collided, zeros = perform_grasp()", "type": "assigned_variable", "loc": [1651, 1654], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1643_C8", "vector": [14, 3, 0.9432, 0.0023, 3, 0.79, 0.5, 868, 3, 8, 0, 0, 121, 10, 1], "semantic": {"name": "grasp, monitor, collided, zeros", "arg_names": [], "import_names": [], "rhs_call_name": "perform_grasp", "annotation": ""}, "snippet": " (grasp, monitor, collided, zeros) = perform_grasp(x, y, gripper_rot = rot, \n collide=True, is_grasp = False, \n #grasp_data = grasp_data,\n zeros=zeros, cm=cm, apm=apm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1655_C8", "label": "if", "type": "if", "loc": [1655, 1679], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1643_C8", "vector": [4, 3, 0.9515, 0.0143, 3, 0.79, 1.0, 0, 1, 0, 0, 0, 0, 0, 16], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif False: \n x, y = 0.5, 0.0\n (obj, grasp, monitor, collided, zeros) = grasp_closest_object(x, y, collide=True, zeros=zeros, cm=cm, apm=apm)\n rospy.sleep(0.3)\n if is_obj_in_gripper(cm):\n x, y, rot = random_grasp()\n perform_grasp(x, y, gripper_rot=rot, zeros = zeros, collide=True, is_place=True,\n cm=cm, apm=apm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1656_C12", "label": "x, y =", "type": "assigned_variable", "loc": [1656, 1656], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1655_C8", "vector": [14, 4, 0.9452, 0.0006, 4, 0.2, 0.0, 855, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "x, y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x, y = 0.5, 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1657_C12", "label": "obj, grasp, monitor, collided, zeros = grasp_closest_object()", "type": "assigned_variable", "loc": [1657, 1657], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1655_C8", "vector": [14, 4, 0.9458, 0.0006, 4, 0.2, 0.1, 643, 3, 6, 0, 0, 670, 10, 1], "semantic": {"name": "obj, grasp, monitor, collided, zeros", "arg_names": [], "import_names": [], "rhs_call_name": "grasp_closest_object", "annotation": ""}, "snippet": " (obj, grasp, monitor, collided, zeros) = grasp_closest_object(x, y, collide=True, zeros=zeros, cm=cm, apm=apm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1658_C12", "label": "sleep()", "type": "expression", "loc": [1658, 1658], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1655_C8", "vector": [8, 4, 0.9463, 0.0006, 4, 0.2, 0.2, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(0.3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1659_C12", "label": "if", "type": "if", "loc": [1659, 1662], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1655_C8", "vector": [4, 4, 0.9478, 0.0023, 4, 0.2, 0.3, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if is_obj_in_gripper(cm):\n x, y, rot = random_grasp()\n perform_grasp(x, y, gripper_rot=rot, zeros = zeros, collide=True, is_place=True,\n cm=cm, apm=apm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1660_C16", "label": "x, y, rot = random_grasp()", "type": "assigned_variable", "loc": [1660, 1660], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1659_C12", "vector": [14, 5, 0.9475, 0.0006, 5, 0.07, 0.0, 540, 3, 0, 0, 0, 371, 10, 1], "semantic": {"name": "x, y, rot", "arg_names": [], "import_names": [], "rhs_call_name": "random_grasp", "annotation": ""}, "snippet": " x, y, rot = random_grasp()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1661_C16", "label": "perform_grasp()", "type": "expression", "loc": [1661, 1662], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1659_C12", "vector": [8, 5, 0.9483, 0.0011, 5, 0.07, 1.0, 121, 3, 8, 0, 0, 0, 0, 1], "semantic": {"name": "perform_grasp", "arg_names": [], "import_names": [], "rhs_call_name": "perform_grasp", "annotation": ""}, "snippet": " perform_grasp(x, y, gripper_rot=rot, zeros = zeros, collide=True, is_place=True,\n cm=cm, apm=apm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1664_C12", "label": "obj =", "type": "assigned_variable", "loc": [1664, 1664], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1655_C8", "vector": [14, 4, 0.9498, 0.0006, 4, 0.2, 0.4, 505, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " obj = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1665_C12", "label": "while", "type": "while", "loc": [1665, 1667], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1655_C8", "vector": [5, 4, 0.9509, 0.0017, 4, 0.2, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while obj is None:\n x, y, z = get_laser_dclick(cm.tf_listener)\n (obj, grasp, monitor, collided, zeros) = grasp_closest_object(x, y, collide=True, zeros=zeros, cm=cm, apm=apm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1666_C16", "label": "x, y, z = get_laser_dclick()", "type": "assigned_variable", "loc": [1666, 1666], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1665_C12", "vector": [14, 5, 0.9509, 0.0006, 5, 0.77, 0.0, 971, 3, 1, 0, 0, 909, 10, 1], "semantic": {"name": "x, y, z", "arg_names": [], "import_names": [], "rhs_call_name": "get_laser_dclick", "annotation": ""}, "snippet": " x, y, z = get_laser_dclick(cm.tf_listener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1667_C16", "label": "obj, grasp, monitor, collided, zeros = grasp_closest_object()", "type": "assigned_variable", "loc": [1667, 1667], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1665_C12", "vector": [14, 5, 0.9515, 0.0006, 5, 0.77, 1.0, 643, 3, 6, 0, 0, 670, 10, 1], "semantic": {"name": "obj, grasp, monitor, collided, zeros", "arg_names": [], "import_names": [], "rhs_call_name": "grasp_closest_object", "annotation": ""}, "snippet": " (obj, grasp, monitor, collided, zeros) = grasp_closest_object(x, y, collide=True, zeros=zeros, cm=cm, apm=apm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1668_C12", "label": "x, y, z = get_laser_dclick()", "type": "assigned_variable", "loc": [1668, 1668], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1655_C8", "vector": [14, 4, 0.9521, 0.0006, 4, 0.2, 0.6, 971, 3, 1, 0, 0, 909, 10, 1], "semantic": {"name": "x, y, z", "arg_names": [], "import_names": [], "rhs_call_name": "get_laser_dclick", "annotation": ""}, "snippet": " x, y, z = get_laser_dclick(cm.tf_listener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1669_C12", "label": "print()", "type": "expression", "loc": [1669, 1669], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1655_C8", "vector": [8, 4, 0.9526, 0.0006, 4, 0.2, 0.7, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\" X Y Z\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1670_C12", "label": "print()", "type": "expression", "loc": [1670, 1670], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1655_C8", "vector": [8, 4, 0.9532, 0.0006, 4, 0.2, 0.8, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(x, y, z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1671_C12", "label": "if", "type": "if", "loc": [1671, 1678], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1655_C8", "vector": [4, 4, 0.9558, 0.0046, 4, 0.2, 0.9, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if x > 0.92 and z > 0.04:\n point_head([x, y, z], block = False)\n hand_over_object(x, y, z + 0.1, cm, apm)\n monitor_pressure()\n open_gripper(cm=cm)\n else:\n perform_grasp(x, y, gripper_rot=obj[1], zeros = zeros, collide=True, is_place=True,\n cm=cm, apm=apm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1672_C16", "label": "point_head()", "type": "expression", "loc": [1672, 1672], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1671_C12", "vector": [8, 5, 0.9543, 0.0006, 5, 0.34, 0.0, 553, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "point_head", "arg_names": [], "import_names": [], "rhs_call_name": "point_head", "annotation": ""}, "snippet": " point_head([x, y, z], block = False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1673_C16", "label": "hand_over_object()", "type": "expression", "loc": [1673, 1673], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1671_C12", "vector": [8, 5, 0.9549, 0.0006, 5, 0.34, 0.25, 489, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "hand_over_object", "arg_names": [], "import_names": [], "rhs_call_name": "hand_over_object", "annotation": ""}, "snippet": " hand_over_object(x, y, z + 0.1, cm, apm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1674_C16", "label": "monitor_pressure()", "type": "expression", "loc": [1674, 1674], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1671_C12", "vector": [8, 5, 0.9555, 0.0006, 5, 0.34, 0.5, 718, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "monitor_pressure", "arg_names": [], "import_names": [], "rhs_call_name": "monitor_pressure", "annotation": ""}, "snippet": " monitor_pressure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1675_C16", "label": "open_gripper()", "type": "expression", "loc": [1675, 1675], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1671_C12", "vector": [8, 5, 0.9561, 0.0006, 5, 0.34, 0.75, 833, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "open_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "open_gripper", "annotation": ""}, "snippet": " open_gripper(cm=cm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1677_C16", "label": "perform_grasp()", "type": "expression", "loc": [1677, 1678], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1671_C12", "vector": [8, 5, 0.9575, 0.0011, 5, 0.34, 1.0, 121, 3, 8, 0, 0, 0, 0, 1], "semantic": {"name": "perform_grasp", "arg_names": [], "import_names": [], "rhs_call_name": "perform_grasp", "annotation": ""}, "snippet": " perform_grasp(x, y, gripper_rot=obj[1], zeros = zeros, collide=True, is_place=True,\n cm=cm, apm=apm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1679_C12", "label": "move_to_setup()", "type": "expression", "loc": [1679, 1679], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1655_C8", "vector": [8, 4, 0.9583, 0.0006, 4, 0.2, 1.0, 739, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "move_to_setup", "arg_names": [], "import_names": [], "rhs_call_name": "move_to_setup", "annotation": ""}, "snippet": " move_to_setup(cm, blocking = False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1685_C8", "label": "if", "type": "if", "loc": [1685, 1689], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1636_C4", "vector": [4, 2, 0.9629, 0.0029, 2, 0.72, 0.6, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if collided:\n print(\"COLLIDED\")\n print(\"COLLIDED\")\n print(\"COLLIDED\")\n num_collided += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1686_C12", "label": "print()", "type": "expression", "loc": [1686, 1686], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1685_C8", "vector": [8, 3, 0.9623, 0.0006, 3, 0.79, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"COLLIDED\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1687_C12", "label": "print()", "type": "expression", "loc": [1687, 1687], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1685_C8", "vector": [8, 3, 0.9629, 0.0006, 3, 0.79, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"COLLIDED\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1688_C12", "label": "print()", "type": "expression", "loc": [1688, 1688], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1685_C8", "vector": [8, 3, 0.9635, 0.0006, 3, 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(\"COLLIDED\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1691_C8", "label": "sleep()", "type": "expression", "loc": [1691, 1691], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1636_C4", "vector": [8, 2, 0.9652, 0.0006, 2, 0.72, 0.8, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(2.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1692_C8", "label": "if", "type": "if", "loc": [1692, 1699], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1636_C4", "vector": [4, 2, 0.9678, 0.0046, 2, 0.72, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ki.kbhit():\n if PERCEPT_GRASP_LIST is None:\n percept = \"joint_efforts\"\n else:\n percept = PERCEPT_GRASP_LIST[0]\n display_grasp_data(grasps[-3:], percept, monitor_data=monitor_data[-3:], monitor_zeros=monitor_zeros[-3:])\n # print monitor_data[-3:]\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1693_C12", "label": "if", "type": "if", "loc": [1693, 1696], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1692_C8", "vector": [4, 3, 0.9672, 0.0023, 3, 0.11, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if PERCEPT_GRASP_LIST is None:\n percept = \"joint_efforts\"\n else:\n percept = PERCEPT_GRASP_LIST[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1694_C16", "label": "percept =", "type": "assigned_variable", "loc": [1694, 1694], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1693_C12", "vector": [14, 4, 0.9669, 0.0006, 4, 0.46, 0.0, 961, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "percept", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " percept = \"joint_efforts\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1696_C16", "label": "percept =", "type": "assigned_variable", "loc": [1696, 1696], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1693_C12", "vector": [14, 4, 0.968, 0.0006, 4, 0.46, 1.0, 961, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "percept", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " percept = PERCEPT_GRASP_LIST[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1697_C12", "label": "display_grasp_data()", "type": "expression", "loc": [1697, 1697], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1692_C8", "vector": [8, 3, 0.9686, 0.0006, 3, 0.11, 1.0, 150, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "display_grasp_data", "arg_names": [], "import_names": [], "rhs_call_name": "display_grasp_data", "annotation": ""}, "snippet": " display_grasp_data(grasps[-3:], percept, monitor_data=monitor_data[-3:], monitor_zeros=monitor_zeros[-3:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1701_C4", "label": "print()", "type": "expression", "loc": [1701, 1701], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [8, 1, 0.9709, 0.0006, 1, 0.05, 0.68, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Accuracy: %d collisions out of %d grasps (%1.2f)\" % (num_collided, num_grasps, 1. - float(num_collided) / num_grasps))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1702_C4", "label": "test_data =", "type": "assigned_variable", "loc": [1702, 1702], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [14, 1, 0.9715, 0.0006, 1, 0.05, 0.72, 415, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "test_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_data = [grasps, monitor_data, collided_list]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1703_C4", "label": "for k", "type": "for", "loc": [1703, 1704], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [6, 1, 0.9723, 0.0011, 1, 0.05, 0.76, 954, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in z_sum:\n print(z_sum[k] / num_grasps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1704_C8", "label": "print()", "type": "expression", "loc": [1704, 1704], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1703_C4", "vector": [8, 2, 0.9726, 0.0006, 2, 0.6, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(z_sum[k] / num_grasps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1705_C4", "label": "return", "type": "return", "loc": [1705, 1705], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [13, 1, 0.9732, 0.0006, 1, 0.05, 0.8, 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_99294:Expr_L1706_C4", "label": "save_pickle()", "type": "expression", "loc": [1706, 1706], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [8, 1, 0.9737, 0.0006, 1, 0.05, 0.84, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " save_pickle(test_data, \"test_runs.pickle\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1744_C4", "label": "display_grasp_data()", "type": "expression", "loc": [1744, 1744], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [8, 1, 0.9954, 0.0006, 1, 0.05, 0.88, 150, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "display_grasp_data", "arg_names": [], "import_names": [], "rhs_call_name": "display_grasp_data", "annotation": ""}, "snippet": " display_grasp_data(grasps, \"accelerometer\", monitor_data=monitor_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1745_C4", "label": "raw_input()", "type": "expression", "loc": [1745, 1745], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [8, 1, 0.996, 0.0006, 1, 0.05, 0.92, 821, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1746_C4", "label": "open_gripper()", "type": "expression", "loc": [1746, 1746], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [8, 1, 0.9966, 0.0006, 1, 0.05, 0.96, 833, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "open_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "open_gripper", "annotation": ""}, "snippet": " open_gripper(cm=cm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1748_C4", "label": "return", "type": "return", "loc": [1748, 1748], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "vector": [13, 1, 0.9977, 0.0006, 1, 0.05, 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_99294:If_L1750_C0", "label": "if", "type": "if", "loc": [1750, 1751], "level": 0, "parent": null, "vector": [4, 0, 0.9991, 0.0011, 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 sys.exit(main())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1751_C4", "label": "exit()", "type": "expression", "loc": [1751, 1751], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1750_C0", "vector": [8, 1, 0.9994, 0.0006, 1, 0.62, 0.0, 436, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit(main())"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L113_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L117_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L121_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Import_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L176_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L177_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L176_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L176_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L176_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L176_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L189_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L190_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L189_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L191_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L192_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L193_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L189_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L195_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L200_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L201_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L202_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L203_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L204_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L206_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L207_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L206_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L208_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L206_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L206_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L206_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L211_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L213_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L214_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L213_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L213_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L216_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L213_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L217_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L213_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L218_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L213_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L219_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L221_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L222_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L221_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L223_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L228_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L229_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L228_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L230_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L236_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L236_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L238_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L245_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L246_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L245_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L248_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L245_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L249_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L245_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L250_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L245_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L252_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L261_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L262_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L261_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L263_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L261_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L264_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L261_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L265_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L261_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L266_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L261_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L268_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L261_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L270_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L245_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L273_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L245_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L274_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L245_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L275_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L277_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L278_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L279_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L279_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L280_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L279_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L282_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L284_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L285_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L284_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L286_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L284_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L287_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L284_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L288_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L288_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L289_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L284_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L291_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L284_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L292_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L294_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L295_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L296_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L297_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L297_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L298_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L297_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L299_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L299_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L300_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L299_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L301_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L297_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L302_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L304_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L305_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L304_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L306_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L304_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L307_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L307_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L308_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L307_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L309_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L309_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L310_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L304_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L311_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L314_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L315_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L323_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L324_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L325_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L327_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L328_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L329_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L331_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L331_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L334_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L334_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L335_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L331_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L336_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L331_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L337_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L331_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L338_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L331_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L340_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L340_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L341_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L340_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L344_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L340_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L345_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L340_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L346_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L340_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L348_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L340_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L349_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L340_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L352_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L352_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L354_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L352_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L355_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L357_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L360_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L362_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L363_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L364_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L365_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L366_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L367_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L368_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L369_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L370_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L371_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L351_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L372_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L331_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L377_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L331_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L380_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L331_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L381_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L381_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L382_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L381_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L384_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L331_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L385_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L385_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L387_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L385_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L389_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L331_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L390_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L331_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L391_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L393_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L395_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L396_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L313_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L397_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L399_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L400_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L399_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L401_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L399_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L402_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L403_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L404_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L405_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L408_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L399_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L410_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L412_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L413_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L412_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L414_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L412_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L415_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L412_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L416_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L416_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L417_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L412_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L419_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L419_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L420_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L412_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L422_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L412_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L423_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L412_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L424_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L412_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L425_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L412_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L426_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L412_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L427_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L427_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L428_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L428_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L429_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L429_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L430_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L429_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L432_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L429_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L433_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L429_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L434_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L434_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L435_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L429_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L436_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L436_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L437_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L437_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L439_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L437_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L441_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L429_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L442_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L442_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L443_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L429_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L446_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L429_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L450_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L429_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L451_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L451_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L452_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L451_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L453_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L451_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L454_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L451_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L455_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L451_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L456_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L456_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L457_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L456_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L458_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L456_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L459_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L459_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L460_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L459_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L461_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L461_C28", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L462_C32"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L456_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L469_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L456_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L470_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L456_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L471_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L451_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L473_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L451_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L474_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L451_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L475_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L429_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L477_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L429_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L478_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L496_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L497_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L496_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L498_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L496_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L499_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L496_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L500_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L502_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L503_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L505_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L506_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L506_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L507_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L505_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L508_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L510_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L511_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L511_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L512_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L510_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L513_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L510_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L514_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L514_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L515_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L520_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L521_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L523_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L523_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L524_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L525_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L525_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L526_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L528_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L528_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L529_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L536_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L538_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L539_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L542_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L546_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L547_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L548_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L548_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L550_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L548_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L551_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L548_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L552_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L553_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L554_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L560_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:ClassDef_L562_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:ClassDef_L562_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L563_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L563_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L564_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:ClassDef_L562_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L566_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L566_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L567_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L566_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L568_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L566_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L569_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L569_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L570_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L569_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L571_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L569_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L572_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L572_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L573_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L574_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L575_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L575_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L576_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L575_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L578_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L575_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L579_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L575_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L580_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L575_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L582_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L584_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L586_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L586_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L587_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L589_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L598_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L599_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L600_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L601_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L540_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L602_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L602_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L604_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L602_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L605_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L602_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L606_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L602_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L611_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L611_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L612_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L611_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L613_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L619_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L619_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L620_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L620_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L621_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L621_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L622_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L620_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L623_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L620_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L624_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L624_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L625_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L619_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L627_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L627_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L628_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L628_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L629_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L627_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L630_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L627_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L631_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L627_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L632_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L627_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L633_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L627_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L635_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L635_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L636_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L635_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L637_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L635_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L638_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L638_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L639_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L638_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L640_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L627_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L642_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L627_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L643_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L643_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L644_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L646_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L647_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L648_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L650_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L651_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L653_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L653_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L654_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L654_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L655_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L659_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L659_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L660_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L659_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L661_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L659_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L662_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L659_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L663_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L663_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L664_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L663_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L665_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L663_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L666_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L668_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L668_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L669_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L668_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L670_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L672_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L517_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L674_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L708_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Import_L714_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L708_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L715_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L715_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L716_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L708_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L717_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L708_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L718_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L708_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L719_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L708_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L721_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L722_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L723_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L724_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L725_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L726_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L726_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L727_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L726_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L728_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L726_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L730_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L726_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L731_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L732_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L732_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L733_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L732_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L734_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L732_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L736_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L732_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L737_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L738_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L740_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L741_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L742_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L743_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L745_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L746_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L748_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L749_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L749_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L753_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L753_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L754_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L749_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L755_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L755_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L756_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L755_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L758_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L749_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L760_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L760_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L761_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L760_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L763_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L720_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L771_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L771_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L772_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L771_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L773_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L771_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L774_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L774_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L775_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L775_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L778_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L771_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L781_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L781_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L782_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L782_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L783_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L771_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L784_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L784_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L785_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L784_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L786_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L784_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L787_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L784_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L789_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L784_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L790_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L784_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L792_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L771_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L793_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L771_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L794_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L771_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L795_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L771_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L798_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L708_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L801_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L803_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L804_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L806_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L813_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L806_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L814_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L806_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L815_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L815_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L816_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L815_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L817_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L815_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L818_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L815_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L819_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L815_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L820_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L815_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L821_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L821_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L822_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L821_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L824_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L815_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L825_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L827_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L828_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L827_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L829_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L827_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L830_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L827_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L831_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L827_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L832_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L832_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L833_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L832_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L834_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L827_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L835_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L827_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L836_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L827_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L837_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L837_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L838_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L837_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L844_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L837_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L845_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L837_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L846_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L837_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L848_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L837_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L849_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L837_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L850_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L827_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L852_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L854_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L855_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L855_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L856_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L855_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L859_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L862_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L863_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L863_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L864_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L862_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L866_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L862_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L867_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L862_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L869_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L862_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L871_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L871_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L872_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L871_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L873_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L871_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L874_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L871_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L875_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L871_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L876_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L871_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L877_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L877_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L878_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L877_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L879_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L877_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L881_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L881_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L882_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L881_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L883_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L871_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L884_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L871_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L885_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L885_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L886_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L885_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L889_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L889_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L890_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L889_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L891_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L889_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L892_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L889_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L893_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L889_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L894_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L889_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L895_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L885_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L897_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L885_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L898_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L885_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L900_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L885_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L901_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L885_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L902_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L885_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L905_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L905_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L906_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L905_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L907_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L905_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L909_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L905_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L910_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L885_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L912_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L885_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L913_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L916_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L917_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L918_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L919_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L922_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L923_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L926_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L929_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L932_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L935_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L938_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L915_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L939_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L942_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L942_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L943_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L944_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L945_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L947_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L948_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L950_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L951_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L950_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L952_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L950_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L953_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L955_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L956_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L956_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L957_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L955_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L958_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L955_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L959_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L955_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L960_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L960_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L961_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L960_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L963_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L955_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L965_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L967_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L968_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L968_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L969_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L967_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L970_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L967_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L971_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L971_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L972_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L971_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L973_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L967_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L974_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L976_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L977_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L976_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L979_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L976_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L981_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L983_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:ClassDef_L984_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:ClassDef_L984_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L985_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L985_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L986_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L985_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L987_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:ClassDef_L984_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L989_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L989_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L990_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L989_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L991_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L991_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L992_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L983_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L994_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L983_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L995_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L983_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L996_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L998_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L999_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1001_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1002_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1001_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1003_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1003_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1004_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1004_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1005_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1003_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1007_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1001_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1008_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1008_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1009_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1009_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1010_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1010_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1012_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1010_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1014_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1009_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1015_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1008_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1016_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1008_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1017_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1008_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1018_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1018_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1019_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1019_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1020_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1018_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1022_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1018_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1024_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1008_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1026_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1008_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1027_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1029_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1030_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1030_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1031_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1029_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1032_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1032_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1033_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1033_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1034_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1029_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1035_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1037_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1038_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1037_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1039_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1039_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1040_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1037_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1041_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1041_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1042_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1041_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1043_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1041_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1044_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1041_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1045_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1041_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1046_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1046_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1047_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1041_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1048_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1041_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1049_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1041_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1052_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1037_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1053_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1037_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1054_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1054_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1055_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1054_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1056_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1056_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1058_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1058_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1059_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1058_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1060_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1058_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1061_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1058_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1066_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1067_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1068_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1069_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1072_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1073_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1076_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1077_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1080_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1081_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1084_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1062_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1085_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1054_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1089_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1054_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1091_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1054_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1092_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1094_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1096_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1094_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1097_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1094_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1098_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1094_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1099_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1094_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1101_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1102_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1103_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1094_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Import_L1104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1094_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1094_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1094_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1094_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1112_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1134_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1134_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1136_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1134_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1138_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1144_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1145_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1157_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1162_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1163_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1164_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1165_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1165_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1167_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1170_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1171_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1182_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1182_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1182_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1182_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1186_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1182_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1182_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1190_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1191_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1190_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1192_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1190_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1193_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1196_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1197_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1198_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1200_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1201_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1202_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1203_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1204_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1206_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1220_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1221_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1224_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1195_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1228_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1228_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1229_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1230_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1230_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1232_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1233_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1234_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1234_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1234_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1234_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1244_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1246_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1244_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1247_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1247_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1248_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1250_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1251_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1252_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1302_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1303_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1304_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1305_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1306_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1306_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1307_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1306_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1308_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1306_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1309_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1306_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1310_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1306_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1311_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1312_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1313_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1314_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1315_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1316_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1317_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1318_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1319_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1322_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1323_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1324_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1325_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1325_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1326_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1326_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1327_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1326_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1328_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1326_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1329_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1326_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1330_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1330_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1331_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1331_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1332_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1331_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1333_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1331_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1335_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1331_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1337_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1331_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1340_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1331_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1341_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1325_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1342_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1343_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1345_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1346_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1345_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1347_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1345_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1348_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1345_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1349_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1345_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1350_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1345_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1351_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1345_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1353_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1345_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1355_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1355_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1356_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1345_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1358_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1345_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1359_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1359_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1360_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1359_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1361_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1359_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1362_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1345_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1364_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1366_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1367_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1366_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1368_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1366_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1369_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1366_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1370_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1366_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1371_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1366_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1372_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1366_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1374_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1366_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1375_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1375_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1376_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1375_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1377_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1375_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1378_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1375_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1379_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1375_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1382_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1375_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1383_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1375_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1384_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1366_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1388_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1392_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1393_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1394_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1395_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1395_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1396_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1395_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1398_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1399_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1401_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1402_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1401_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1403_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1406_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1407_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1406_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1408_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1406_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1410_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1406_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1412_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1406_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1414_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1406_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1416_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1406_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1417_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1406_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1419_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1406_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1421_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1424_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1425_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1424_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1426_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1424_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1428_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1424_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1429_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1429_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1430_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1430_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1431_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1430_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1432_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1430_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1433_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1429_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1434_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1434_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1435_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1434_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1436_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1434_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1437_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1424_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1439_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1424_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1440_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1424_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1441_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1441_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1442_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1424_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1443_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1483_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1485_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1486_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1492_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1493_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1573_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1574_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1624_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1626_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1627_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1628_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1629_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1630_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1631_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1632_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1634_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1636_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1636_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1637_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1636_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1639_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1636_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1643_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1643_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1647_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1647_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1648_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1647_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1650_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1643_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1651_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1643_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1655_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1655_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1656_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1655_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1657_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1655_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1658_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1655_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1659_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1659_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1660_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1659_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1661_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1655_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1664_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1655_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1665_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1665_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1666_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:While_L1665_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1667_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1655_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1668_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1655_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1669_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1655_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1670_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1655_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1671_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1671_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1672_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1671_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1673_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1671_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1674_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1671_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1675_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1671_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1677_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1655_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1679_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1636_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1685_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1685_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1686_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1685_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1687_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1685_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1688_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1636_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1691_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1636_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1692_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1692_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1693_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1693_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1694_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1693_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1696_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1692_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1697_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1701_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Assign_L1702_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1703_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:For_L1703_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1704_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1705_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1706_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1744_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1745_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1746_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:FunctionDef_L1482_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Return_L1748_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99294:If_L1750_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99294:Expr_L1751_C4"}]
#! /usr/bin/python import numpy as np, math import scipy.stats as stats from threading import RLock import roslib; roslib.load_manifest('hrl_pr2_lib') import rospy from hrl_lib.util import save_pickle, load_pickle from hrl_lib.msg import FloatArray from hrl_lib.rutils import GenericListener, ros_to_dict, RateCaller from hrl_lib.data_process import signal_smooth, signal_variance, signal_list_variance from tf.transformations import * from std_msgs.msg import Float64MultiArray from pr2_msgs.msg import AccelerometerState, PressureState from sensor_msgs.msg import JointState import threading import functools as ft import Queue import time, string node_name = "arm_perception_monitor" def log(str): rospy.loginfo(node_name + ": " + str) ## # Processes the AccelerometerState message, returning an average of the # sample values and the timestamp in nanoseconds # # @param msg AccelometerState message # @return (t, (x, y, z)) def accel_state_processor(msg): xyz = np.array([0.]*3) if msg.samples is None or len(msg.samples) == 0: return None for samp in msg.samples: xyz[0] += samp.x xyz[1] += samp.y xyz[2] += samp.z xyz[0] /= len(msg.samples) xyz[1] /= len(msg.samples) xyz[2] /= len(msg.samples) return (msg.header.stamp.to_nsec(), xyz) r_jt_idx_list = [17, 18, 16, 20, 19, 21, 22] l_jt_idx_list = [31, 32, 30, 34, 33, 35, 36] joint_nm_list = ['shoulder_pan', 'shoulder_lift', 'upper_arm_roll', 'elbow_flex', 'forearm_roll', 'wrist_flex', 'wrist_roll'] ## # 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 joints_state_processor(msg, right_arm=True, angles_velocities_efforts=0): ret = np.array([0.] * 7) for i,nm in enumerate(joint_nm_list): if right_arm: idx = r_jt_idx_list[i] if msg.name[idx] != 'r_'+nm+'_joint': raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', msg.name[idx], i)) if angles_velocities_efforts == 1: ret[i] = msg.velocity[idx] elif angles_velocities_efforts == 2: ret[i] = msg.effort[idx] else: ret[i] = msg.position[idx] else: idx = l_jt_idx_list[i] if msg.name[idx] != 'l_'+nm+'_joint': raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', msg.name[idx], i)) if angles_velocities_efforts == 1: ret[i] = msg.velocity[idx] elif angles_velocities_efforts == 2: ret[i] = msg.effort[idx] else: ret[i] = msg.position[idx] return (msg.header.stamp.to_nsec(), ret) def pressure_state_processor(msg, right_finger_tip=True, indicies=None): ret = np.array([0.] * len(indicies)) if indicies is None: indicies = range(len(msg.r_finger_tip)) for i, ind in enumerate(indicies): if right_finger_tip: ret[i] = msg.r_finger_tip[ind] else: ret[i] = msg.l_finger_tip[ind] return (msg.header.stamp.to_nsec(), ret) ## # Periodically logs the output of a callback function by calling it at a certain # rate and gathering up the results into a list class PeriodicLogger(): ## # initializes the logger but doesn't start it # # @param callback the function to be called each time # @param rate the rate in seconds at which to call the callback # @param args the function arguments to pass into the callback def __init__(self, callback, rate=0.01, args=None): self.ret = [] self.cb = callback self.rate = rate self.args = args self.is_running = False self.max_calls = None self.num_calls = 0 self.beg_time = 0. self.thread = None ## # begins the logger # @param max_calls the maximum number of times to call the callback def start(self, max_calls=None): if self.is_running: return self.max_calls = max_calls self.is_running = True self.num_calls = 0 self.beg_time = rospy.Time.now().to_sec() self.thread = threading.Timer(self.rate, self._run) self.thread.start() def _run(self): if not self.is_running: return act_time = self.beg_time + self.rate * (self.num_calls + 2) interval = act_time - rospy.Time.now().to_sec() self.thread = threading.Timer(interval, self._run) self.thread.start() if self.args is None: retval = self.cb() else: retval = self.cb(*self.args) self.ret += [retval] self.num_calls += 1 # break if we have called the sufficent number of times if self.max_calls is not None: if self.num_calls == self.max_calls: self.is_running = False return ## # stops the monitor # @return the result of the monitor def stop(self): self.thread.cancel() if not self.is_running: return None self.is_running = False return self.ret ## # If max_calls sets to automatically terminate, return the ret vals def get_ret_vals(self): if self.is_running: return None return self.ret ## # Periodically monitors the output of a callback function by calling it at a certain # rate and compares it with a provided model to insure the value doesn't vary greatly # within a degree of tolerance provided by the variance function class PeriodicMonitor(): ## # initializes the monitor but doesn't start it # # @param callback the function to be called each time # @param rate the rate in seconds at which to call the callback # @param args the function arguments to pass into the callback def __init__(self, callback, rate=0.01, args=None): self.ret = [] self.cb = callback self.rate = rate self.args = args self.is_running = False self.num_calls = 0 self.beg_time = 0. self.thread = None self.mean_model = None self.variance_model = None self.std_devs = 0. self.failure = False ## # begins the monitor # TODO DOCS # @param max_calls the maximum number of times to call the callback def start(self, mean_model, variance_model, std_devs=2.5, max_calls=None, contingency=None, contingency_args=None): if len(mean_model) != len(variance_model): log("Models must be of same length") return if self.is_running: return self.is_running = True self.mean_model = mean_model self.variance_model = variance_model self.std_devs = std_devs self.max_calls = max_calls self.contingency = contingency self.contincency_args = contingency_args self.model_index = 0 self.failure = False self.num_calls = 0 self.beg_time = rospy.Time.now().to_sec() self.thread = threading.Timer(self.rate, self._run) self.thread.start() def _run(self): if not self.is_running: return act_time = self.beg_time + self.rate * (self.num_calls + 2) interval = act_time - rospy.Time.now().to_sec() self.thread = threading.Timer(interval, self._run) self.thread.start() if self.args is None: retval = self.cb() else: retval = self.cb(*self.args) # go through each coordinate in the vector for coord_i in len(retval[1]): diff = abs(retval[1][coord_i] - self.mean_model[self.model_index][coord_i]) deviation = np.sqrt(self.variance_model[self.model_index][coord_i]) if diff > self.std_devs * deviation: # signal is outside allowable range self.failure = True self.is_running = False # call contingency function if contingency_args is None: self.contingency() else: self.contingency(*contingency_args) return self.ret += [retval] self.model_index += 1 if self.model_index == len(self.mean_model): self.is_running = False return # break if we have called the sufficent number of times if not self.max_calls is None: self.max_calls -= 1 if self.max_calls == 0: self.is_running = False return ## # stops the monitor # @return the result of the monitor def stop(self): self.thread.cancel() if not self.is_running: return None self.is_running = False return self.ret ## # If max_calls sets to automatically terminate, return the ret vals def get_ret_vals(self): if self.is_running: return None return self.ret # TODO DOCS def has_failed(): return self.failure # TODO DOCS def wait_for_completion(rate=0.01): while self.is_running and not rospy.is_shutdown(): rospy.sleep(rate) return not self.failure ## # Monitors perception channels on the robot arms. Important: rate must be the same for both # training and monitoring. Values are gathered timestep by timestep. # # Usecase: # apm = ArmPerceptionMonitor(0) # for trajectory in trajectories: # apm.start_training() # trajectory.run() # trajectory.wait_for_completion() # apm.stop_training() # mean_function, variance_function = apm.generate_model(...) # class ArmPerceptionMonitor( ): ## # Initializes the listeners on the perception topics # # @param arm 0 if right, 1 if left # @param rate the rate at which the perception should capture states # @param percept_mon_list list of perceptions to monitor; if None, do all def __init__(self, arm, tf_listener=None, rate=0.001, percept_mon_list=None, model_zeros=None): log("Initializing arm perception listeners") self.rate = rate if arm == 0: armc = "r" is_right_arm = True else: armc = "l" is_right_arm = False self.model_zeros = model_zeros self.perceptions = {} self.perception_names = [ "accelerometer", "joint_angles", "joint_velocities", "joint_efforts", "r_finger_periph_pressure", "r_finger_pad_pressure", "l_finger_periph_pressure", "l_finger_pad_pressure", "gripper_pose"] if percept_mon_list is None: percept_mon_list = self.perception_names if "accelerometer" in percept_mon_list: accel_listener = GenericListener("accel_mon_node", AccelerometerState, "accelerometer/" + armc + "_gripper_motor", rate, accel_state_processor) self.perceptions["accelerometer"] = accel_listener.read if "joint_angles" in percept_mon_list: joint_angles_processor = ft.partial(joints_state_processor, right_arm=is_right_arm, angles_velocities_efforts=0) joint_angles_listener = GenericListener("joint_angles_mon_node", JointState, "joint_states", rate, joint_angles_processor) self.perceptions["joint_angles"] = joint_angles_listener.read if "joint_velocities" in percept_mon_list: joint_velocities_processor = ft.partial(joints_state_processor, right_arm=is_right_arm, angles_velocities_efforts=1) joint_velocities_listener = GenericListener("joint_efforts_mon_node", JointState, "joint_states", rate, joint_velocities_processor) self.perceptions["joint_velocities"] = joint_velocities_listener.read if "joint_efforts" in percept_mon_list: joint_efforts_processor = ft.partial(joints_state_processor, right_arm=is_right_arm, angles_velocities_efforts=2) joint_efforts_listener = GenericListener("joint_efforts_mon_node", JointState, "joint_states", rate, joint_efforts_processor) self.perceptions["joint_efforts"] = joint_efforts_listener.read if "r_finger_periph_pressure" in percept_mon_list: r_finger_periph_pressure_processor = ft.partial(pressure_state_processor, right_finger_tip=True, indicies=range(1,7)) r_finger_periph_pressure_listener = GenericListener("pressure_mon_node", PressureState, "pressure/" + armc + "_gripper_motor", rate, r_finger_periph_pressure_processor) self.perceptions["r_finger_periph_pressure"] = r_finger_periph_pressure_listener.read if "r_finger_pad_pressure" in percept_mon_list: r_finger_pad_pressure_processor = ft.partial(pressure_state_processor, right_finger_tip=True, indicies=range(7,22)) r_finger_pad_pressure_listener = GenericListener("pressure_mon_node", PressureState, "pressure/" + armc + "_gripper_motor", rate, r_finger_pad_pressure_processor) self.perceptions["r_finger_pad_pressure"] = r_finger_pad_pressure_listener.read if "l_finger_periph_pressure" in percept_mon_list: l_finger_periph_pressure_processor = ft.partial(pressure_state_processor, right_finger_tip=False, indicies=range(1,7)) l_finger_periph_pressure_listener = GenericListener("pressure_mon_node", PressureState, "pressure/" + armc + "_gripper_motor", rate, l_finger_periph_pressure_processor) self.perceptions["l_finger_periph_pressure"] = l_finger_periph_pressure_listener.read if "l_finger_pad_pressure" in percept_mon_list: l_finger_pad_pressure_processor = ft.partial(pressure_state_processor, right_finger_tip=False, indicies=range(7,22)) l_finger_pad_pressure_listener = GenericListener("pressure_mon_node", PressureState, "pressure/" + armc + "_gripper_motor", rate, l_finger_pad_pressure_processor) self.perceptions["l_finger_pad_pressure"] = l_finger_pad_pressure_listener.read for k in self.perceptions: self.perceptions[k] = ft.partial(self.perceptions[k], willing_to_wait=False, quiet=True, warn=False, allow_duplication=True) if "gripper_pose" in percept_mon_list: def gripper_pose_lookup(): lct = tf_listener.getLatestCommonTime("/torso_lift_link", "/" + armc + "_wrist_roll_link") pos, quat = tf_listener.lookupTransform("/torso_lift_link", "/" + armc + "_wrist_roll_link", lct) return (lct.to_nsec(), np.array(pos + quat)) self.perceptions["gripper_pose"] = gripper_pose_lookup # all callbacks should return data in this format: # (t, np.array([x1, x2, ...])) # t is time in nanoseconds self.clear_vars() self.logger = RateCaller(self._gather_perception, self.rate) log("Finished initialization") def _gather_perception(self): t1 = rospy.Time.now().to_sec() for k in self.perceptions: self.datasets[k][-1] += [self.perceptions[k]()] t2 = rospy.Time.now().to_sec() import random if random.randint(0,100)==0: print "Time:", t1-t2 ## # Initialize variables def clear_vars(self): self.datasets = {} self.models = {} for k in self.perceptions: self.datasets[k] = [] self.models[k] = {"mean" : None, "variance" : None} self.active = False ## # Begin capturing peception data for all of the listeners # # @param duration If None, continue capturing until stop is called. # Else, stop capturing after duration seconds have passed. def start_training(self, duration=None): if self.active: log("Perception already active.") return self.active = True for k in self.perceptions: self.datasets[k] += [[]] self.logger.run() if not duration is None: threading.Timer(self.stop_training, duration) ## # Stop capturing perception data. Store output data in datasets list for # later statistics. def stop_training(self): if not self.active: log("Nothing to stop.") return self.logger.stop() self.active = False return len(self.datasets[self.datasets.keys()[0]][-1]) ## # Save training data as a pickle with given filename # # @param filename name of the pickle def save(self, filename): save_pickle((self.datasets, self.models), filename) ## # Load training data as a pickle with given filename # # @param filename name of the pickle def load(self, filename): self.datasets, self.models = load_pickle(filename) ## # Generates model functions of all the perceptions over several # identical trajectories. Each of the parameters is a dictionary # directing perceptions to their parameters. # # @param smooth_wind_dict the window size of the smoothing function # @param var_wind_dict window size of the variance function # @param var_smooth_wind_dict window size of the smoothing function on the variance # @return mean function, variance function # def generate_models(self, smooth_wind_dict=None, var_wind_dict=None): # smooth_wind_default = 234 # var_wind_default = 400 # var_smooth_wind = 143 # for perception in self.perceptions: # data_list = self.datasets[perception] # # if data_list is None: # log("No data to generate model for") # return None # if self.active: # log("Perception already active.") # return None # # get the minimum model length # lens = [len(m) for m in data_list] # max_len = np.max(lens) # # dynamic finding of parameters # if smooth_wind_dict is None or smooth_wind_dict[perception] is None: # smooth_wind = smooth_wind_default # else: # smooth_wind = smooth_wind_dict[perception] # ret_means, ret_vars, ret_mean_models, ret_noise_vars = [], [], [], [] # ret_times, noise_vars = [], [] # # find the number of coordinates from the first element # num_coords = len(data_list[0][0][1]) # for coord in range(num_coords): # mean_models, variance_models = [], [] # times = None # for stream in data_list: # # extract only the data stream for a single coordinate (all x values) # stream_coord = np.array(zip(*zip(*stream)[1])[coord]) # cur_mean_model = signal_smooth(stream_coord, smooth_wind) # mean_models += [cur_mean_model] # # # sum up the squared difference over the whole model # noise_vars += [ ( sum([(x - y) ** 2 for x,y in zip(cur_mean_model,stream_coord)]) / # len(cur_mean_model) ) ] # # find the average case over the several runs # avg_means_model = np.array([0.] * max_len) # for i in range(max_len): # n = 0 # for j in range(len(mean_models)): # if i < len(mean_models[j]): # avg_means_model[i] += mean_models[j][i] # n += 1 # avg_means_model[i] /= n # if var_wind_dict is None or var_wind_dict[perception] is None: # var_wind = var_wind_default # else: # var_wind = var_wind_dict[perception] # # find the variance of the signal but use var_wind points around the centers # # to increase the sample size # vars_model = signal_list_variance(mean_models, avg_means_model, var_wind) # vars_model = signal_smooth(vars_model, var_smooth_wind) # vars_model = signal_smooth(vars_model, var_smooth_wind + 23) # ret_times += [times] # ret_means += [avg_means_model] # ret_vars += [vars_model] # ret_mean_models += [mean_models] # ret_noise_vars += [np.average(noise_vars)] # # TODO deal with timestamp data in some way? # # self.models[perception]["time"] = ret_times # self.models[perception]["mean"] = np.array(zip(*ret_means)) # self.models[perception]["variance"] = np.array(zip(*ret_vars)) # a = ret_mean_models # b = [] # for stream in range(len(a[0])): # t1 = [] # for val in range(len(a[0][0])): # t2 = [] # for coord in range(len(a)): # if val < len(a[coord][stream]): # t2 += [a[coord][stream][val]] # t1 += [np.array(t2)] # b += [t1] # self.models[perception]["smoothed_signals"] = b # self.models[perception]["noise_variance"] = np.array(ret_noise_vars) # return self.models def get_zeros(self, time=4.): self._zeros = {} for k in self.perceptions: self._zeros[k] = None self._n = 0 monitor = RateCaller(self._sum_values, self.rate) monitor.run() rospy.sleep(time) monitor.stop() for k in self.perceptions: self._zeros[k] /= self._n return self._zeros def _sum_values(self): for k in self.perceptions: add_data = np.array(self.perceptions[k]()[1]) if self._zeros[k] is None: self._zeros[k] = np.copy(add_data) else: self._zeros[k] += add_data self._n += 1 ## # Sets up monitoring parameters def setup_monitoring(self, models, std_dev_dict=None, noise_dev_dict=None, duration=None, std_dev_default=2.0, noise_dev_default=0.25, tol_thresh_dict=None, contingency=None, window_size=70, current_zeros=None, sampling_rate = 1, transform_dict=None, verbose=True, collide=True): self.std_dev_default = std_dev_default self.noise_dev_default = noise_dev_default self.models = models self.current_data = {} self.std_dev_dict = std_dev_dict self.noise_dev_dict = {} self.contingency = contingency self.window_size = window_size self.current_zeros = {} self.transform_dict = transform_dict self.tol_thresh_dict = tol_thresh_dict self.sampling_rate = sampling_rate self.verbose = verbose self.collide = collide self.sum_data = {} self.cur_pt = 0 self.failure = False self.dur_timer = None self.avg_list = {} self.cum_avg = {} self.c = {} self.locks = {} for k in self.perceptions: self.current_data[k] = [None] * window_size self.sum_data[k] = None self.avg_list[k] = [] self.c[k] = None self.locks[k] = threading.Lock() self.create_max_min() # Checks percept to see if the model indicates a collision with the current # smoothed perception avg # Returns index of perception and difference if collision, -1, 0 else def create_max_min(self): for k in self.models: deviation = self.models[k]["variance"] # noise_deviation = np.sqrt(self.models[k]["noise_variance"]) if self.std_dev_dict is not None and k in self.std_dev_dict: std_dev = np.array(self.std_dev_dict[k]) else: std_dev = self.std_dev_default # if self.noise_dev_dict is not None and k in self.noise_dev_dict: # noise_dev = np.array(self.noise_dev_dict[k]) # else: # noise_dev = self.noise_dev_default if self.tol_thresh_dict is not None and k in self.tol_thresh_dict: tol_thresh = np.array(self.tol_thresh_dict[k]) else: tol_thresh = 0. self.models[k]["dev"] = (std_dev * deviation + tol_thresh) # self.models[k]["dev"] = (std_dev * deviation + noise_dev * noise_deviation + tol_thresh) # This is the monitoring equation self.models[k]["max"] = self.models[k]["mean"] + self.models[k]["dev"] self.models[k]["min"] = self.models[k]["mean"] - self.models[k]["dev"] ## # Begin monitoring peception data to make sure it doesn't deviate from # the model provided. # # TODO DOCS # @param duration If None, continue capturing until stop is called. # Else, stop capturing after duration seconds have passed. def begin_monitoring(self, models=None, model_zeros=None, std_dev_dict=None, noise_dev_dict=None, duration=None, std_dev_default=2.0, noise_dev_default=0.25, tol_thresh_dict=None, contingency=None, window_size=70, current_zeros=None, sampling_rate = 1, only_pressure=False, transform_dict=None, verbose=True, collide=True): if self.active: log("Perception already active.") return self.active = True self.setup_monitoring(models, std_dev_dict=std_dev_dict, noise_dev_dict=noise_dev_dict, duration=duration, std_dev_default=std_dev_default, noise_dev_default=noise_dev_default, tol_thresh_dict=tol_thresh_dict, contingency=contingency, window_size=window_size, sampling_rate=sampling_rate, current_zeros=current_zeros, transform_dict=transform_dict, verbose=verbose, collide=collide) # if models is not None: # self.models = models if model_zeros is not None: self.model_zeros = model_zeros self.cur_pt = 0 self.collision_times = {} self.collision_sums = {} self.cur_col_time = 0 self.current_zeros = {} self.z_sum = {} self.z_rsum = {} self.z_list = {} self.min_prob = 100000.0 self.cur_mals = {} self.mals = None self.only_pressure = only_pressure self.monitor = RateCaller(self._monitor_data, self.rate * self.sampling_rate) self.monitor.run() # self.sumcalls = {} # self.sumsave = {} if not duration is None: self.dur_timer = threading.Timer(self.end_monitoring, duration) self.dur_timer.start() def _stable_summer(self, percept, data): # kahanSum k = percept # if percept not in self.sumcalls: # self.sumcalls[percept] = 1 # self.sumsave[percept] = [] # else: # self.sumcalls[percept] += 1 if self.c[k] is None: self.c[k] = np.array([0.]*len(data)) if self.sum_data[k] is None: self.sum_data[k] = np.copy(data) else: y = data - self.c[k] t = self.sum_data[k] + y self.c[k] = (t - self.sum_data[k]) - y self.sum_data[k] = t # self.sumsave[percept] += [self.sum_data[k]] def _monitor_data(self): avg_dict = {} sttime = rospy.Time.now().to_sec() for k in self.perceptions: # update the running sum add_data = self.perceptions[k]()[1] # apply necessary transforms # if self.transform_dict is not None: # if k in self.transform_dict: # add_data = self.transform_dict[k](add_data) self._stable_summer(k, add_data) # If we have enough data to monitor, we check to see if the values are in range if self.cur_pt >= self.window_size: #self.current_data[k].full(): # self.prev_sum = copy.deepcopy(self.sum_data) avg_dict[k] = self.sum_data[k] / self.window_size if not k in self.current_zeros: if not self.only_pressure: mean = np.array(self.models[k]["mean"][self.cur_pt * self.sampling_rate]) else: mean = np.array(self.models[k]["mean"][0]) self.current_zeros[k] = mean - avg_dict[k] # self.current_zeros[k] = - avg_dict[k] avg_dict[k] += self.current_zeros[k] self.avg_list[k] += [avg_dict[k]] * self.sampling_rate # if self.cur_pt == self.window_size: # print self.avg_list[k] # self.prev_avg = copy.deepcopy(avg) # offset zeros into original perception frame # if self.current_zeros is not None: # if False and self.model_zeros is not None: # avg_dict[k] += self.model_zeros[k] - self.current_zeros[k] # else: # # this is hacky, need to use zeros during training instead of first pt # # print "NOOOOOOOOOOOO!\n"*10 # avg_dict[k] += np.array(self.models[k]["mean"][self.window_size]) - self.current_zeros[k] # if collision_detected: # log("Value %d of the perception %s failed with difference %f" # % (index, k, diff)) # # if diff > 5. and k == "accelerometer": # # print "avg_list", self.avg_list # # print "avg", avg # # for i in range(self.window_size+1): # # d = self.current_data[k].get() # # print d # # self.current_data[k].put(d) # self.failure = True # self.contingency() # self.monitor.stop() rem_data = self.current_data[k][self.cur_pt % self.window_size] self._stable_summer(k, -rem_data) self.current_data[k][self.cur_pt % self.window_size] = add_data if self.cur_pt >= self.window_size: #self.current_data[k].full(): collision_detected = self.collision_detect(avg_dict) if self.collide and collision_detected: print "collision reported" self.failure = True if not self.contingency is None: self.contingency() self.monitor.stop() return self.cur_pt += 1 if not self.only_pressure: if self.cur_pt * self.sampling_rate >= 1.00 * len(self.models[self.models.keys()[0]]["mean"]): print "ending early:", self.cur_pt * self.sampling_rate self.end_monitoring() endtime = rospy.Time.now().to_sec() # if self.cur_pt % 10 == 0: # print "dur:", sttime - endtime ## # Stop capturing perception data. Store output data in datasets list for # later statistics. # TODO DOCS def end_monitoring(self): if not self.active: log("Nothing to stop.") return self.avg_list print "-------------------------" print "z averages:" self.z_avg = {} for k in self.z_sum: self.z_avg[k] = self.z_sum[k] / self.cur_pt print k, ":", self.z_avg[k] print "-------------------------" print "MINIMUM PROB" print self.min_prob print "-------------------------" # print "Sum calls", self.sumcalls # if self.sumcalls["r_finger_periph_pressure"] == 202: # print self.sumsave self.monitor.stop() if self.dur_timer is not None: self.dur_timer.cancel() self.dur_timer = None self.active = False return self.avg_list # Checks percept to see if the model indicates a collision with the current # smoothed perception avg # Returns index of perception and difference if collision, -1, 0 else def collision_detect(self, avg_dict): # is_outside_range_dict = {} z = {} mal_sum = 0. for k in avg_dict: # This is the monitoring equation # is_outside_range_dict[k] = ((avg_dict[k] > self.models[k]["max"][self.cur_pt * self.sampling_rate]) + # (avg_dict[k] < self.models[k]["min"][self.cur_pt * self.sampling_rate])) # Uses both variance from various grasp tries and general noise variance if not self.only_pressure: mean = self.models[k]["mean"][self.cur_pt * self.sampling_rate] dev = self.models[k]["dev"][self.cur_pt * self.sampling_rate] else: mean = self.models[k]["mean"][0] dev = self.models[k]["dev"][0] cur_mal = ((avg_dict[k] - mean) / dev) ** 2 self.cur_mals[k] = cur_mal mal_sum += np.add.reduce( ( (avg_dict[k] - mean) / dev) ** 2 ) z[k] = np.fabs(avg_dict[k] - mean) / dev if not k in self.z_sum: self.z_sum[k] = np.copy(z[k]) else: self.z_sum[k] += z[k] # print "incoldet" # collision_detected = self.collision_filtering(is_outside_range_dict) # collision_detected = self.collision_filtering_mal(np.sqrt(mal_sum)) # return collision_detected collision_detected = self.collision_filtering(z) # print "coldete", collision_detected return collision_detected def collision_filtering_mal(self, mal): prob = 1. TIME_WINDOW = 4 if self.mals is None: self.mals = np.array([0.] * TIME_WINDOW) self.mals[self.cur_pt % TIME_WINDOW] = mal if self.cur_pt < TIME_WINDOW: return False mal_avg = np.add.reduce(self.mals / TIME_WINDOW) MAL_THRESH = 8.0 if mal_avg > MAL_THRESH: print "Collision with mal dist:", mal_avg for k in self.cur_mals: print k, self.cur_mals[k] return True return False def collision_filtering(self, z): prob = 1. TIME_WINDOW = 4 for k in z: if not k in self.z_rsum: self.z_rsum[k] = np.copy(z[k]) self.z_list[k] = [np.array([0.]*len(z[k]))] * TIME_WINDOW else: self.z_rsum[k] += z[k] self.z_rsum[k] -= self.z_list[k][self.cur_pt % TIME_WINDOW] self.z_list[k][self.cur_pt % TIME_WINDOW] = z[k] # print z[k] prob *= np.multiply.reduce(2 * stats.norm.cdf(-self.z_rsum[k] / TIME_WINDOW)) # print prob if self.cur_pt < TIME_WINDOW: return False if prob < self.min_prob: self.min_prob = prob # CONFIDENCE = 1e-6 if not self.only_pressure: # 4e-7 50/50 CONFIDENCE = 2.0e-6 else: # pressure only confidence CONFIDENCE = 1.e-5 if self.cur_pt % 20 == 0: print "Current pt:", self.cur_pt, ", probability:", prob if prob < CONFIDENCE: print "probability:", prob print "collision returned" return True # print "-------------------------" # print num_percep_col # for k in sig_counts: # if sig_counts[k] >= PERCEPT_SIG_REQ[k]: # print k, ":", sig_counts[k] # print "-------------------------" # return True return False # def collision_filtering(self, is_outside_range_dict): # isord = is_outside_range_dict # TIME_WINDOW = 10 # NUM_PERCEPT_COL_REQ = 2 # PERCEPT_SIG_REQ = { "accelerometer" : 2, # "joint_angles" : 2, # "joint_velocities" : 3, # "joint_efforts" : 2, # "r_finger_periph_pressure" : 2, # "r_finger_pad_pressure" : 5, # "l_finger_periph_pressure" : 2, # "l_finger_pad_pressure" : 5 } # num_percep_col = 0 # sig_counts = {} # num_periph = 0 # for k in isord: # # if any(isord[k]): # # print k, isord # if not k in self.collision_times: # self.collision_times[k] = [np.array([0] * len(isord[k]))] * TIME_WINDOW # self.collision_sums[k] = np.array([0] * len(isord[k])) # # def queue_sum(q): # # sum = None # # for i in range(TIME_WINDOW): # # val = q.get() # # if sum is None: # # sum = np.copy(val) # # sum += val # # q.put(val) # # return sum # # c_sum = queue_sum(self.collision_times[k]) # self.collision_sums[k] -= self.collision_times[k][self.cur_col_time] # self.cur_col_time = (self.cur_col_time + 1) % TIME_WINDOW # self.collision_times[k][self.cur_col_time] = np.int32(np.array(isord[k])) # self.collision_sums[k] += self.collision_times[k][self.cur_col_time] # def g0(x): # if x > 0: # return 1 # return 0 # sig_count = np.sum(map(g0, self.collision_sums[k])) # sig_counts[k] = sig_count # if sig_count >= PERCEPT_SIG_REQ[k]: # # print "cols", k, isord[k] # if k == "r_finger_periph_pressure" or k == "l_finger_periph_pressure": # num_periph += 1 # num_percep_col += 1 # # num_periph != 1 eliminates side object collision possibilities # if num_percep_col >= NUM_PERCEPT_COL_REQ and num_periph != 1: # print "collision returned" # print "-------------------------" # print num_percep_col # for k in sig_counts: # if sig_counts[k] >= PERCEPT_SIG_REQ[k]: # print k, ":", sig_counts[k] # print "-------------------------" # return True # return False # if self.collide and any(is_outside_range): # # sensor has fallen outside acceptable range, trigger # for i, x in enumerate(is_outside_range): # if x: # # print "Average:", avg # # print "Last avg:", self.prev_avg # # print "Prev sum:", self.prev_sum # # print "MOD:", self.model_zeros[k] # # print "MON:", self.current_zeros[k] # return i, diff[i] # return -1, 0. # @TODO add sampling_rate stuff def simulate_monitoring(self, monitor_data, models=None, model_zeros=None, std_dev_dict=None, noise_dev_dict=None, duration=None, std_dev_default=2.0, noise_dev_default=0.25, tol_thresh_dict=None, contingency=None, window_size=70, current_zeros=None, transform_dict=None, verbose=True, collide=True): self.setup_monitoring(std_dev_dict=std_dev_dict, noise_dev_dict=noise_dev_dict, duration=duration, std_dev_default=std_dev_default, tol_thresh_dict=tol_thresh_dict, noise_dev_default=noise_dev_default, contingency=contingency, window_size=window_size, current_zeros=current_zeros, transform_dict=transform_dict, verbose=verbose, collide=collide) if models is not None: self.models = models if model_zeros is not None: self.model_zeros = model_zeros self.cur_pt = self.window_size collision = None # i is the number of samples in the monitor data for i in range(len(monitor_data[monitor_data.keys()[0]])): for k in monitor_data: index, diff = self.collision_detect(k, monitor_data[k][i]) if index != -1: collision = (k, index, diff) self.cur_pt += 1 return collision def resample_and_thin_data(self, monitor_data, sample_rate): ret_data = {} for k in monitor_data: ret_data[k] = {} ret_data[k]["mean"] = monitor_data[k]["mean"][::sample_rate] ret_data[k]["variance"] = monitor_data[k]["variance"][::sample_rate] return ret_data def split_signals(datasets): for perception in datasets: data_list = datasets[perception] # get the minimum model length lens = [len(m) for m in data_list] max_len = np.max(lens) # dynamic finding of parameters if smooth_wind_dict is None or smooth_wind_dict[perception] is None: smooth_wind = smooth_wind_default else: smooth_wind = smooth_wind_dict[perception] ret_means, ret_vars, ret_mean_models, ret_noise_vars = [], [], [], [] ret_times, noise_vars = [], [] # find the number of coordinates from the first element num_coords = len(data_list[0][0][1]) for coord in range(num_coords): mean_models, variance_models = [], [] times = None for stream in data_list: # extract only the data stream for a single coordinate (all x values) stream_coord = np.array(zip(*zip(*stream)[1])[coord]) cur_mean_model = signal_smooth(stream_coord, smooth_wind) mean_models += [cur_mean_model] # sum up the squared difference over the whole model noise_vars += [ ( sum([(x - y) ** 2 for x,y in zip(cur_mean_model,stream_coord)]) / len(cur_mean_model) ) ] # find the average case over the several runs avg_means_model = np.array([0.] * max_len) for i in range(max_len): n = 0 for j in range(len(mean_models)): if i < len(mean_models[j]): avg_means_model[i] += mean_models[j][i] n += 1 avg_means_model[i] /= n if var_wind_dict is None or var_wind_dict[perception] is None: var_wind = var_wind_default else: var_wind = var_wind_dict[perception] # find the variance of the signal but use var_wind points around the centers # to increase the sample size vars_model = signal_list_variance(mean_models, avg_means_model, var_wind) vars_model = signal_smooth(vars_model, var_smooth_wind) vars_model = signal_smooth(vars_model, var_smooth_wind + 23) ret_times += [times] ret_means += [avg_means_model] ret_vars += [vars_model] ret_mean_models += [mean_models] ret_noise_vars += [np.average(noise_vars)] # TODO deal with timestamp data in some way? # self.models[perception]["time"] = ret_times self.models[perception]["mean"] = np.array(zip(*ret_means)) self.models[perception]["variance"] = np.array(zip(*ret_vars)) a = ret_mean_models b = [] for stream in range(len(a[0])): t1 = [] for val in range(len(a[0][0])): t2 = [] for coord in range(len(a)): if val < len(a[coord][stream]): t2 += [a[coord][stream][val]] t1 += [np.array(t2)] b += [t1] self.models[perception]["smoothed_signals"] = b self.models[perception]["noise_variance"] = np.array(ret_noise_vars) return self.models ## # Generates model functions of all the perceptions over several # identical trajectories. Each of the parameters is a dictionary # directing perceptions to their parameters. # # @param smooth_wind_dict the window size of the smoothing function # @param var_wind_dict window size of the variance function # @param var_smooth_wind_dict window size of the smoothing function on the variance # @return mean function, variance function def generate_mean_grasp(datasets): smooth_wind_default = 234 means = {} for perception in datasets: data_list = datasets[perception] # get the minimum model length lens = [len(m) for m in data_list] max_len = np.max(lens) ret_means = [] # find the number of coordinates from the first element num_coords = len(data_list[0][0][1]) for coord in range(num_coords): mean_models, variance_models = [], [] for stream in data_list: # extract only the data stream for a single coordinate (all x values) stream_coord = np.array(zip(*zip(*stream)[1])[coord]) cur_mean_model = signal_smooth(stream_coord, smooth_wind) mean_models += [cur_mean_model] # find the average case over the several runs avg_means_model = np.array([0.] * max_len) for i in range(max_len): n = 0 for j in range(len(mean_models)): if i < len(mean_models[j]): avg_means_model[i] += mean_models[j][i] n += 1 avg_means_model[i] /= n ret_means += [avg_means_model] means[perception] = np.array(zip(*ret_means)) return means if __name__ == '__main__': rospy.init_node(node_name, anonymous=True) apm = ArmPerceptionMonitor(0, 0.001) for x in range(3): raw_input("Begin arm") apm.start_training() rospy.sleep(1.) apm.stop_training() rospy.sleep(0.1) models = apm.generate_models() apm.pickle_datasets("pickles//apmtest.pickle") means = models["accelerometer"]["mean"] vars = models["accelerometer"]["variance"] xm, ym, zm = zip(*means) xv, yv, zv = zip(*vars) xv = map(np.sqrt, xv) yv = map(np.sqrt, yv) zv = map(np.sqrt, zv) std_dev = 2.5 xmmax = [m + np.sqrt(v) * std_dev for m, v in zip(xm, xv)] ymmax = [m + np.sqrt(v) * std_dev for m, v in zip(ym, yv)] zmmax = [m + np.sqrt(v) * std_dev for m, v in zip(zm, zv)] xmmin = [m - np.sqrt(v) * std_dev for m, v in zip(xm, xv)] ymmin = [m - np.sqrt(v) * std_dev for m, v in zip(ym, yv)] zmmin = [m - np.sqrt(v) * std_dev for m, v in zip(zm, zv)] import matplotlib.pyplot as plt plt.subplot(321) plt.plot(xm) plt.plot(xmmax) plt.plot(xmmin) #plt.axis([0, len(xm), 0., 15.]) plt.title("X mean") plt.subplot(323) plt.plot(ym) plt.plot(ymmax) plt.plot(ymmin) plt.title("Y mean") plt.subplot(325) plt.plot(zm) plt.plot(zmmax) plt.plot(zmmin) plt.title("Z mean") plt.subplot(322) plt.plot(xv) plt.title("X variance") plt.subplot(324) plt.plot(yv) plt.title("Y variance") plt.subplot(326) plt.plot(zv) plt.title("Z variance") plt.show()
ajibawa-2023/Python-Code-Large/train/row_99296
599
1,278
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Import_L3_C0", "label": "numpy import np, math", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0023, 0.0008, 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_99296:Import_L4_C0", "label": "scipy.stats import stats", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0031, 0.0008, 0, 0.66, 0.0323, 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_99296:ImportFrom_L5_C0", "label": "from threading import RLock", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0039, 0.0008, 0, 0.66, 0.0645, 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_99296:Import_L7_C0", "label": "roslib import roslib", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0055, 0.0008, 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('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L7_C15", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0055, 0.0008, 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('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Import_L8_C0", "label": "rospy import rospy", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0063, 0.0008, 0, 0.66, 0.1613, 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_99296:ImportFrom_L10_C0", "label": "from hrl_lib.util import save_pickle, load_pickle", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0078, 0.0008, 0, 0.66, 0.1935, 775, 0, 2, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["save_pickle", "load_pickle"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_lib.util import save_pickle, load_pickle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:ImportFrom_L11_C0", "label": "from hrl_lib.msg import FloatArray", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0086, 0.0008, 0, 0.66, 0.2258, 842, 0, 1, 0, 0, 842, 0, 0], "semantic": {"name": "hrl_lib.msg", "arg_names": [], "import_names": ["FloatArray"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_lib.msg import FloatArray"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:ImportFrom_L12_C0", "label": "from hrl_lib.rutils import GenericListener, ros_to_dict, RateCaller", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0094, 0.0008, 0, 0.66, 0.2581, 847, 0, 3, 0, 0, 847, 0, 0], "semantic": {"name": "hrl_lib.rutils", "arg_names": [], "import_names": ["GenericListener", "ros_to_dict", "RateCaller"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_lib.rutils import GenericListener, ros_to_dict, RateCaller"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:ImportFrom_L13_C0", "label": "from hrl_lib.data_process import signal_smooth, signal_variance, signal_list_variance", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0102, 0.0008, 0, 0.66, 0.2903, 424, 0, 3, 0, 0, 424, 0, 0], "semantic": {"name": "hrl_lib.data_process", "arg_names": [], "import_names": ["signal_smooth", "signal_variance", "signal_list_variance"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_lib.data_process import signal_smooth, signal_variance, signal_list_variance"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:ImportFrom_L14_C0", "label": "from tf.transformations import *", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.011, 0.0008, 0, 0.66, 0.3226, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from tf.transformations import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:ImportFrom_L16_C0", "label": "from std_msgs.msg import Float64MultiArray", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0125, 0.0008, 0, 0.66, 0.3548, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Float64MultiArray"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Float64MultiArray"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:ImportFrom_L17_C0", "label": "from pr2_msgs.msg import AccelerometerState, PressureState", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0133, 0.0008, 0, 0.66, 0.3871, 797, 0, 2, 0, 0, 797, 0, 0], "semantic": {"name": "pr2_msgs.msg", "arg_names": [], "import_names": ["AccelerometerState", "PressureState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_msgs.msg import AccelerometerState, PressureState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:ImportFrom_L18_C0", "label": "from sensor_msgs.msg import JointState", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0141, 0.0008, 0, 0.66, 0.4194, 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_99296:Import_L20_C0", "label": "threading import threading", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0156, 0.0008, 0, 0.66, 0.4516, 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_99296:Import_L21_C0", "label": "functools import ft", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0164, 0.0008, 0, 0.66, 0.4839, 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_99296:Import_L22_C0", "label": "Queue import Queue", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0172, 0.0008, 0, 0.66, 0.5161, 952, 0, 1, 0, 0, 952, 0, 0], "semantic": {"name": "Queue", "arg_names": [], "import_names": ["Queue"], "rhs_call_name": "", "annotation": ""}, "snippet": "import Queue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Import_L24_C0", "label": "time import time, string", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0188, 0.0008, 0, 0.66, 0.5484, 654, 0, 2, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time", "string"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time, string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L26_C0", "label": "node_name =", "type": "assigned_variable", "loc": [26, 26], "level": 0, "parent": null, "vector": [14, 0, 0.0203, 0.0008, 0, 0.66, 0.5806, 516, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "node_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "node_name = \"arm_perception_monitor\" "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L28_C0", "label": "log", "type": "function", "loc": [28, 29], "level": 0, "parent": null, "vector": [2, 0, 0.0223, 0.0016, 0, 0.66, 0.6129, 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_99296:Expr_L29_C4", "label": "loginfo()", "type": "expression", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L28_C0", "vector": [8, 1, 0.0227, 0.0008, 1, 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(node_name + \": \" + str)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L37_C0", "label": "accel_state_processor", "type": "function", "loc": [37, 48], "level": 0, "parent": null, "vector": [2, 0, 0.0333, 0.0094, 0, 0.66, 0.6452, 349, 0, 1, 1, 0, 0, 0, 6], "semantic": {"name": "accel_state_processor", "arg_names": ["msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def accel_state_processor(msg):\n xyz = np.array([0.]*3)\n if msg.samples is None or len(msg.samples) == 0:\n return None\n for samp in msg.samples:\n xyz[0] += samp.x\n xyz[1] += samp.y\n xyz[2] += samp.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L38_C4", "label": "xyz = array()", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L37_C0", "vector": [14, 1, 0.0297, 0.0008, 1, 0.5, 0.0, 164, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "xyz", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " xyz = np.array([0.]*3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L39_C4", "label": "if", "type": "if", "loc": [39, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L37_C0", "vector": [4, 1, 0.0309, 0.0016, 1, 0.5, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg.samples is None or len(msg.samples) == 0:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L40_C8", "label": "return", "type": "return", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L39_C4", "vector": [13, 2, 0.0313, 0.0008, 2, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L41_C4", "label": "for samp", "type": "for", "loc": [41, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L37_C0", "vector": [6, 1, 0.0333, 0.0031, 1, 0.5, 0.6667, 965, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "samp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for samp in msg.samples:\n xyz[0] += samp.x\n xyz[1] += samp.y\n xyz[2] += samp.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L48_C4", "label": "return", "type": "return", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L37_C0", "vector": [13, 1, 0.0376, 0.0008, 1, 0.5, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (msg.header.stamp.to_nsec(), xyz)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L50_C0", "label": "r_jt_idx_list =", "type": "assigned_variable", "loc": [50, 50], "level": 0, "parent": null, "vector": [14, 0, 0.0391, 0.0008, 0, 0.66, 0.6774, 924, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "r_jt_idx_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "r_jt_idx_list = [17, 18, 16, 20, 19, 21, 22]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L51_C0", "label": "l_jt_idx_list =", "type": "assigned_variable", "loc": [51, 51], "level": 0, "parent": null, "vector": [14, 0, 0.0399, 0.0008, 0, 0.66, 0.7097, 974, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "l_jt_idx_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "l_jt_idx_list = [31, 32, 30, 34, 33, 35, 36]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L52_C0", "label": "joint_nm_list =", "type": "assigned_variable", "loc": [52, 54], "level": 0, "parent": null, "vector": [14, 0, 0.0415, 0.0023, 0, 0.66, 0.7419, 595, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "joint_nm_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "joint_nm_list = ['shoulder_pan', 'shoulder_lift', 'upper_arm_roll',\n 'elbow_flex', 'forearm_roll', 'wrist_flex',\n 'wrist_roll']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L60_C0", "label": "joints_state_processor", "type": "function", "loc": [60, 84], "level": 0, "parent": null, "vector": [2, 0, 0.0563, 0.0196, 0, 0.66, 0.7742, 763, 0, 3, 1, 0, 0, 0, 5], "semantic": {"name": "joints_state_processor", "arg_names": ["msg", "right_arm", "angles_velocities_efforts"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def joints_state_processor(msg, right_arm=True, angles_velocities_efforts=0):\n ret = np.array([0.] * 7)\n for i,nm in enumerate(joint_nm_list):\n if right_arm:\n idx = r_jt_idx_list[i]\n if msg.name[idx] != 'r_'+nm+'_joint':\n raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', msg.name[idx], i))\n if angles_velocities_efforts == 1:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L61_C4", "label": "ret = array()", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L60_C0", "vector": [14, 1, 0.0477, 0.0008, 1, 0.9, 0.0, 501, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " ret = np.array([0.] * 7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L62_C4", "label": "for i, nm", "type": "for", "loc": [62, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L60_C0", "vector": [6, 1, 0.0567, 0.0172, 1, 0.9, 0.5, 422, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i, nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,nm in enumerate(joint_nm_list):\n if right_arm:\n idx = r_jt_idx_list[i]\n if msg.name[idx] != 'r_'+nm+'_joint':\n raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', msg.name[idx], i))\n if angles_velocities_efforts == 1:\n ret[i] = msg.velocity[idx]\n elif angles_velocities_efforts == 2:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L63_C8", "label": "if", "type": "if", "loc": [63, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L62_C4", "vector": [4, 2, 0.0571, 0.0164, 2, 0.34, 0.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if right_arm:\n idx = r_jt_idx_list[i]\n if msg.name[idx] != 'r_'+nm+'_joint':\n raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', msg.name[idx], i))\n if angles_velocities_efforts == 1:\n ret[i] = msg.velocity[idx]\n elif angles_velocities_efforts == 2:\n ret[i] = msg.effort[idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L64_C12", "label": "idx =", "type": "assigned_variable", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L63_C8", "vector": [14, 3, 0.0501, 0.0008, 3, 0.09, 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_99296:If_L65_C12", "label": "if", "type": "if", "loc": [65, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L63_C8", "vector": [4, 3, 0.0513, 0.0016, 3, 0.09, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg.name[idx] != 'r_'+nm+'_joint':\n raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', msg.name[idx], i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L67_C12", "label": "if", "type": "if", "loc": [67, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L63_C8", "vector": [4, 3, 0.0544, 0.0047, 3, 0.09, 0.4, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if angles_velocities_efforts == 1:\n ret[i] = msg.velocity[idx]\n elif angles_velocities_efforts == 2:\n ret[i] = msg.effort[idx]\n else:\n ret[i] = msg.position[idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L68_C16", "label": "assign", "type": "assigned_variable", "loc": [68, 68], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L67_C12", "vector": [14, 4, 0.0532, 0.0008, 4, 0.43, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret[i] = msg.velocity[idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L69_C12", "label": "if", "type": "if", "loc": [69, 72], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L67_C12", "vector": [4, 4, 0.0552, 0.0031, 4, 0.43, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif angles_velocities_efforts == 2:\n ret[i] = msg.effort[idx]\n else:\n ret[i] = msg.position[idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L70_C16", "label": "assign", "type": "assigned_variable", "loc": [70, 70], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L69_C12", "vector": [14, 5, 0.0548, 0.0008, 5, 0.78, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret[i] = msg.effort[idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L72_C16", "label": "assign", "type": "assigned_variable", "loc": [72, 72], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L69_C12", "vector": [14, 5, 0.0563, 0.0008, 5, 0.78, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret[i] = msg.position[idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L75_C12", "label": "idx =", "type": "assigned_variable", "loc": [75, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L63_C8", "vector": [14, 3, 0.0587, 0.0008, 3, 0.09, 0.6, 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_99296:If_L76_C12", "label": "if", "type": "if", "loc": [76, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L63_C8", "vector": [4, 3, 0.0599, 0.0016, 3, 0.09, 0.8, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg.name[idx] != 'l_'+nm+'_joint':\n raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', msg.name[idx], i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L78_C12", "label": "if", "type": "if", "loc": [78, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L63_C8", "vector": [4, 3, 0.063, 0.0047, 3, 0.09, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if angles_velocities_efforts == 1:\n ret[i] = msg.velocity[idx]\n elif angles_velocities_efforts == 2:\n ret[i] = msg.effort[idx]\n else:\n ret[i] = msg.position[idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L79_C16", "label": "assign", "type": "assigned_variable", "loc": [79, 79], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L78_C12", "vector": [14, 4, 0.0618, 0.0008, 4, 0.25, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret[i] = msg.velocity[idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L80_C12", "label": "if", "type": "if", "loc": [80, 83], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L78_C12", "vector": [4, 4, 0.0638, 0.0031, 4, 0.25, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif angles_velocities_efforts == 2:\n ret[i] = msg.effort[idx]\n else:\n ret[i] = msg.position[idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L81_C16", "label": "assign", "type": "assigned_variable", "loc": [81, 81], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L80_C12", "vector": [14, 5, 0.0634, 0.0008, 5, 0.1, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret[i] = msg.effort[idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L83_C16", "label": "assign", "type": "assigned_variable", "loc": [83, 83], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L80_C12", "vector": [14, 5, 0.0649, 0.0008, 5, 0.1, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret[i] = msg.position[idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L84_C4", "label": "return", "type": "return", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L60_C0", "vector": [13, 1, 0.0657, 0.0008, 1, 0.9, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (msg.header.stamp.to_nsec(), ret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L86_C0", "label": "pressure_state_processor", "type": "function", "loc": [86, 95], "level": 0, "parent": null, "vector": [2, 0, 0.0708, 0.0078, 0, 0.66, 0.8065, 970, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "pressure_state_processor", "arg_names": ["msg", "right_finger_tip", "indicies"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pressure_state_processor(msg, right_finger_tip=True, indicies=None):\n ret = np.array([0.] * len(indicies))\n if indicies is None:\n indicies = range(len(msg.r_finger_tip))\n for i, ind in enumerate(indicies):\n if right_finger_tip:\n ret[i] = msg.r_finger_tip[ind]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L87_C4", "label": "ret = array()", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L86_C0", "vector": [14, 1, 0.0681, 0.0008, 1, 0.59, 0.0, 501, 3, 1, 0, 0, 80, 10, 2], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " ret = np.array([0.] * len(indicies))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L88_C4", "label": "if", "type": "if", "loc": [88, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L86_C0", "vector": [4, 1, 0.0692, 0.0016, 1, 0.59, 0.3333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if indicies is None:\n indicies = range(len(msg.r_finger_tip))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L89_C8", "label": "indicies = range()", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L88_C4", "vector": [14, 2, 0.0696, 0.0008, 2, 0.71, 0.0, 344, 3, 1, 0, 0, 816, 10, 2], "semantic": {"name": "indicies", "arg_names": [], "import_names": [], "rhs_call_name": "range", "annotation": ""}, "snippet": " indicies = range(len(msg.r_finger_tip))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L90_C4", "label": "for i, ind", "type": "for", "loc": [90, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L86_C0", "vector": [6, 1, 0.072, 0.0039, 1, 0.59, 0.6667, 157, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "i, ind", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, ind in enumerate(indicies):\n if right_finger_tip:\n ret[i] = msg.r_finger_tip[ind]\n else:\n ret[i] = msg.l_finger_tip[ind]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L91_C8", "label": "if", "type": "if", "loc": [91, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L90_C4", "vector": [4, 2, 0.0724, 0.0031, 2, 0.79, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if right_finger_tip:\n ret[i] = msg.r_finger_tip[ind]\n else:\n ret[i] = msg.l_finger_tip[ind]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L92_C12", "label": "assign", "type": "assigned_variable", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L91_C8", "vector": [14, 3, 0.072, 0.0008, 3, 0.42, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret[i] = msg.r_finger_tip[ind]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L94_C12", "label": "assign", "type": "assigned_variable", "loc": [94, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L91_C8", "vector": [14, 3, 0.0736, 0.0008, 3, 0.42, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret[i] = msg.l_finger_tip[ind]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L95_C4", "label": "return", "type": "return", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L86_C0", "vector": [13, 1, 0.0743, 0.0008, 1, 0.59, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (msg.header.stamp.to_nsec(), ret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L100_C0", "label": "PeriodicLogger", "type": "class", "loc": [100, 168], "level": 0, "parent": null, "vector": [3, 0, 0.1049, 0.054, 0, 0.66, 0.8387, 422, 0, 5, 0, 0, 0, 0, 11], "semantic": {"name": "PeriodicLogger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PeriodicLogger():\n ##\n # initializes the logger but doesn't start it\n #\n # @param callback the function to be called each time\n # @param rate the rate in seconds at which to call the callback\n # @param args the function arguments to pass into the callback\n def __init__(self, callback, rate=0.01, args=None):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L107_C4", "label": "__init__", "type": "function", "loc": [107, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L100_C0", "vector": [2, 1, 0.0872, 0.0078, 1, 0.7, 0.0, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "callback", "rate", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, callback, rate=0.01, args=None):\n self.ret = []\n self.cb = callback\n self.rate = rate\n self.args = args\n self.is_running = False\n self.max_calls = None\n self.num_calls = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L108_C8", "label": "self.ret =", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L107_C4", "vector": [14, 2, 0.0845, 0.0008, 2, 0.58, 0.0, 172, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ret = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L109_C8", "label": "self.cb =", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L107_C4", "vector": [14, 2, 0.0853, 0.0008, 2, 0.58, 0.125, 336, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cb = callback"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L110_C8", "label": "self.rate =", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L107_C4", "vector": [14, 2, 0.0861, 0.0008, 2, 0.58, 0.25, 6, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rate = rate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L111_C8", "label": "self.args =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L107_C4", "vector": [14, 2, 0.0869, 0.0008, 2, 0.58, 0.375, 640, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.args = args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L112_C8", "label": "self.is_running =", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L107_C4", "vector": [14, 2, 0.0876, 0.0008, 2, 0.58, 0.5, 983, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_running", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_running = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L113_C8", "label": "self.max_calls =", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L107_C4", "vector": [14, 2, 0.0884, 0.0008, 2, 0.58, 0.625, 548, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.max_calls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.max_calls = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L114_C8", "label": "self.num_calls =", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L107_C4", "vector": [14, 2, 0.0892, 0.0008, 2, 0.58, 0.75, 964, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.num_calls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.num_calls = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L115_C8", "label": "self.beg_time =", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L107_C4", "vector": [14, 2, 0.09, 0.0008, 2, 0.58, 0.875, 907, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.beg_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.beg_time = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L116_C8", "label": "self.thread =", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L107_C4", "vector": [14, 2, 0.0908, 0.0008, 2, 0.58, 1.0, 2, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.thread", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.thread = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L121_C4", "label": "start", "type": "function", "loc": [121, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L100_C0", "vector": [2, 1, 0.0978, 0.007, 1, 0.7, 0.25, 511, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "start", "arg_names": ["self", "max_calls"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start(self, max_calls=None):\n if self.is_running:\n return\n self.max_calls = max_calls\n self.is_running = True\n self.num_calls = 0\n self.beg_time = rospy.Time.now().to_sec()\n self.thread = threading.Timer(self.rate, self._run)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L122_C8", "label": "if", "type": "if", "loc": [122, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L121_C4", "vector": [4, 2, 0.0959, 0.0016, 2, 0.56, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.is_running:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L123_C12", "label": "return", "type": "return", "loc": [123, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L122_C8", "vector": [13, 3, 0.0962, 0.0008, 3, 0.45, 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_99296:Assign_L124_C8", "label": "self.max_calls =", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L121_C4", "vector": [14, 2, 0.097, 0.0008, 2, 0.56, 0.1667, 548, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.max_calls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.max_calls = max_calls"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L125_C8", "label": "self.is_running =", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L121_C4", "vector": [14, 2, 0.0978, 0.0008, 2, 0.56, 0.3333, 983, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_running", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_running = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L126_C8", "label": "self.num_calls =", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L121_C4", "vector": [14, 2, 0.0986, 0.0008, 2, 0.56, 0.5, 964, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.num_calls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.num_calls = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L127_C8", "label": "self.beg_time = to_sec()", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L121_C4", "vector": [14, 2, 0.0994, 0.0008, 2, 0.56, 0.6667, 907, 3, 0, 0, 0, 750, 10, 2], "semantic": {"name": "self.beg_time", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " self.beg_time = rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L128_C8", "label": "self.thread = Timer()", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L121_C4", "vector": [14, 2, 0.1002, 0.0008, 2, 0.56, 0.8333, 2, 3, 2, 0, 0, 771, 10, 1], "semantic": {"name": "self.thread", "arg_names": [], "import_names": [], "rhs_call_name": "Timer", "annotation": ""}, "snippet": " self.thread = threading.Timer(self.rate, self._run)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L129_C8", "label": "start()", "type": "expression", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L121_C4", "vector": [8, 2, 0.1009, 0.0008, 2, 0.56, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.thread.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L131_C4", "label": "_run", "type": "function", "loc": [131, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L100_C0", "vector": [2, 1, 0.1103, 0.0164, 1, 0.7, 0.5, 736, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "_run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _run(self):\n if not self.is_running:\n return\n\n act_time = self.beg_time + self.rate * (self.num_calls + 2)\n interval = act_time - rospy.Time.now().to_sec()\n self.thread = threading.Timer(interval, self._run)\n self.thread.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L132_C8", "label": "if", "type": "if", "loc": [132, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L131_C4", "vector": [4, 2, 0.1037, 0.0016, 2, 0.87, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.is_running:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L133_C12", "label": "return", "type": "return", "loc": [133, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L132_C8", "vector": [13, 3, 0.1041, 0.0008, 3, 0.93, 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_99296:Assign_L135_C8", "label": "act_time =", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L131_C4", "vector": [14, 2, 0.1056, 0.0008, 2, 0.87, 0.1667, 352, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "act_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " act_time = self.beg_time + self.rate * (self.num_calls + 2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L136_C8", "label": "interval =", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L131_C4", "vector": [14, 2, 0.1064, 0.0008, 2, 0.87, 0.3333, 628, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "interval", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " interval = act_time - rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L137_C8", "label": "self.thread = Timer()", "type": "assigned_variable", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L131_C4", "vector": [14, 2, 0.1072, 0.0008, 2, 0.87, 0.5, 2, 3, 2, 0, 0, 771, 10, 1], "semantic": {"name": "self.thread", "arg_names": [], "import_names": [], "rhs_call_name": "Timer", "annotation": ""}, "snippet": " self.thread = threading.Timer(interval, self._run)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L138_C8", "label": "start()", "type": "expression", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L131_C4", "vector": [8, 2, 0.108, 0.0008, 2, 0.87, 0.6667, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.thread.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L140_C8", "label": "if", "type": "if", "loc": [140, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L131_C4", "vector": [4, 2, 0.1107, 0.0031, 2, 0.87, 0.8333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.args is None:\n retval = self.cb()\n else:\n retval = self.cb(*self.args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L141_C12", "label": "retval = cb()", "type": "assigned_variable", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L140_C8", "vector": [14, 3, 0.1103, 0.0008, 3, 0.71, 0.0, 991, 3, 0, 0, 0, 540, 10, 1], "semantic": {"name": "retval", "arg_names": [], "import_names": [], "rhs_call_name": "cb", "annotation": ""}, "snippet": " retval = self.cb()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L143_C12", "label": "retval = cb()", "type": "assigned_variable", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L140_C8", "vector": [14, 3, 0.1119, 0.0008, 3, 0.71, 1.0, 991, 3, 1, 0, 0, 540, 10, 1], "semantic": {"name": "retval", "arg_names": [], "import_names": [], "rhs_call_name": "cb", "annotation": ""}, "snippet": " retval = self.cb(*self.args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L148_C8", "label": "if", "type": "if", "loc": [148, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L131_C4", "vector": [4, 2, 0.117, 0.0031, 2, 0.87, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.max_calls is not None:\n if self.num_calls == self.max_calls:\n self.is_running = False\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L149_C12", "label": "if", "type": "if", "loc": [149, 151], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L148_C8", "vector": [4, 3, 0.1174, 0.0023, 3, 0.99, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.num_calls == self.max_calls:\n self.is_running = False\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L150_C16", "label": "self.is_running =", "type": "assigned_variable", "loc": [150, 150], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L149_C12", "vector": [14, 4, 0.1174, 0.0008, 4, 0.45, 0.0, 983, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_running", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_running = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L151_C16", "label": "return", "type": "return", "loc": [151, 151], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L149_C12", "vector": [13, 4, 0.1182, 0.0008, 4, 0.45, 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_99296:FunctionDef_L156_C4", "label": "stop", "type": "function", "loc": [156, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L100_C0", "vector": [2, 1, 0.124, 0.0047, 1, 0.7, 0.75, 343, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop(self):\n self.thread.cancel()\n if not self.is_running:\n return None\n self.is_running = False\n return self.ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L157_C8", "label": "cancel()", "type": "expression", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L156_C4", "vector": [8, 2, 0.1228, 0.0008, 2, 0.18, 0.0, 732, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel", "arg_names": [], "import_names": [], "rhs_call_name": "cancel", "annotation": ""}, "snippet": " self.thread.cancel()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L158_C8", "label": "if", "type": "if", "loc": [158, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L156_C4", "vector": [4, 2, 0.124, 0.0016, 2, 0.18, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.is_running:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L159_C12", "label": "return", "type": "return", "loc": [159, 159], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L158_C8", "vector": [13, 3, 0.1244, 0.0008, 3, 0.78, 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_99296:Assign_L160_C8", "label": "self.is_running =", "type": "assigned_variable", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L156_C4", "vector": [14, 2, 0.1252, 0.0008, 2, 0.18, 0.6667, 983, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_running", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_running = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L161_C8", "label": "return", "type": "return", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L156_C4", "vector": [13, 2, 0.126, 0.0008, 2, 0.18, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L165_C4", "label": "get_ret_vals", "type": "function", "loc": [165, 168], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L100_C0", "vector": [2, 1, 0.1303, 0.0031, 1, 0.7, 1.0, 144, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_ret_vals", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_ret_vals(self):\n if self.is_running:\n return None\n return self.ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L166_C8", "label": "if", "type": "if", "loc": [166, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L165_C4", "vector": [4, 2, 0.1303, 0.0016, 2, 0.41, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.is_running:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L167_C12", "label": "return", "type": "return", "loc": [167, 167], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L166_C8", "vector": [13, 3, 0.1307, 0.0008, 3, 0.49, 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_99296:Return_L168_C8", "label": "return", "type": "return", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L165_C4", "vector": [13, 2, 0.1315, 0.0008, 2, 0.41, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L174_C0", "label": "PeriodicMonitor", "type": "class", "loc": [174, 287], "level": 0, "parent": null, "vector": [3, 0, 0.1804, 0.0892, 0, 0.66, 0.871, 589, 0, 7, 0, 0, 0, 0, 22], "semantic": {"name": "PeriodicMonitor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PeriodicMonitor():\n ##\n # initializes the monitor but doesn't start it\n #\n # @param callback the function to be called each time\n # @param rate the rate in seconds at which to call the callback\n # @param args the function arguments to pass into the callback\n def __init__(self, callback, rate=0.01, args=None):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "label": "__init__", "type": "function", "loc": [181, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L174_C0", "vector": [2, 1, 0.1463, 0.0102, 1, 0.06, 0.0, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "callback", "rate", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, callback, rate=0.01, args=None):\n self.ret = []\n self.cb = callback\n self.rate = rate\n self.args = args\n self.is_running = False\n self.num_calls = 0\n self.beg_time = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L182_C8", "label": "self.ret =", "type": "assigned_variable", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "vector": [14, 2, 0.1424, 0.0008, 2, 0.57, 0.0, 172, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ret = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L183_C8", "label": "self.cb =", "type": "assigned_variable", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "vector": [14, 2, 0.1432, 0.0008, 2, 0.57, 0.0909, 336, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cb = callback"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L184_C8", "label": "self.rate =", "type": "assigned_variable", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "vector": [14, 2, 0.144, 0.0008, 2, 0.57, 0.1818, 6, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rate = rate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L185_C8", "label": "self.args =", "type": "assigned_variable", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "vector": [14, 2, 0.1448, 0.0008, 2, 0.57, 0.2727, 640, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.args = args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L186_C8", "label": "self.is_running =", "type": "assigned_variable", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "vector": [14, 2, 0.1455, 0.0008, 2, 0.57, 0.3636, 983, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_running", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_running = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L187_C8", "label": "self.num_calls =", "type": "assigned_variable", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "vector": [14, 2, 0.1463, 0.0008, 2, 0.57, 0.4545, 964, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.num_calls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.num_calls = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L188_C8", "label": "self.beg_time =", "type": "assigned_variable", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "vector": [14, 2, 0.1471, 0.0008, 2, 0.57, 0.5455, 907, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.beg_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.beg_time = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L189_C8", "label": "self.thread =", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "vector": [14, 2, 0.1479, 0.0008, 2, 0.57, 0.6364, 2, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.thread", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.thread = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L190_C8", "label": "self.mean_model =", "type": "assigned_variable", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "vector": [14, 2, 0.1487, 0.0008, 2, 0.57, 0.7273, 151, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.mean_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mean_model = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L191_C8", "label": "self.variance_model =", "type": "assigned_variable", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "vector": [14, 2, 0.1495, 0.0008, 2, 0.57, 0.8182, 265, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.variance_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.variance_model = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L192_C8", "label": "self.std_devs =", "type": "assigned_variable", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "vector": [14, 2, 0.1502, 0.0008, 2, 0.57, 0.9091, 192, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.std_devs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.std_devs = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L193_C8", "label": "self.failure =", "type": "assigned_variable", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "vector": [14, 2, 0.151, 0.0008, 2, 0.57, 1.0, 81, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.failure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.failure = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "label": "start", "type": "function", "loc": [199, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L174_C0", "vector": [2, 1, 0.1635, 0.0164, 1, 0.06, 0.1667, 511, 0, 7, 0, 0, 0, 0, 7], "semantic": {"name": "start", "arg_names": ["self", "mean_model", "variance_model", "std_devs", "max_calls", "contingency", "contingency_args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start(self, mean_model, variance_model, std_devs=2.5, max_calls=None, \n contingency=None, contingency_args=None):\n if len(mean_model) != len(variance_model):\n log(\"Models must be of same length\")\n return\n if self.is_running:\n return\n self.is_running = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L201_C8", "label": "if", "type": "if", "loc": [201, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "vector": [4, 2, 0.1581, 0.0023, 2, 0.94, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(mean_model) != len(variance_model):\n log(\"Models must be of same length\")\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L202_C12", "label": "log()", "type": "expression", "loc": [202, 202], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L201_C8", "vector": [8, 3, 0.1581, 0.0008, 3, 0.46, 0.0, 432, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": " log(\"Models must be of same length\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L203_C12", "label": "return", "type": "return", "loc": [203, 203], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L201_C8", "vector": [13, 3, 0.1588, 0.0008, 3, 0.46, 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_99296:If_L204_C8", "label": "if", "type": "if", "loc": [204, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "vector": [4, 2, 0.16, 0.0016, 2, 0.94, 0.0714, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.is_running:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L205_C12", "label": "return", "type": "return", "loc": [205, 205], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L204_C8", "vector": [13, 3, 0.1604, 0.0008, 3, 0.36, 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_99296:Assign_L206_C8", "label": "self.is_running =", "type": "assigned_variable", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "vector": [14, 2, 0.1612, 0.0008, 2, 0.94, 0.1429, 983, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_running", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_running = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L207_C8", "label": "self.mean_model =", "type": "assigned_variable", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "vector": [14, 2, 0.162, 0.0008, 2, 0.94, 0.2143, 151, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.mean_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mean_model = mean_model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L208_C8", "label": "self.variance_model =", "type": "assigned_variable", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "vector": [14, 2, 0.1628, 0.0008, 2, 0.94, 0.2857, 265, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.variance_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.variance_model = variance_model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L209_C8", "label": "self.std_devs =", "type": "assigned_variable", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "vector": [14, 2, 0.1635, 0.0008, 2, 0.94, 0.3571, 192, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.std_devs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.std_devs = std_devs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L210_C8", "label": "self.max_calls =", "type": "assigned_variable", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "vector": [14, 2, 0.1643, 0.0008, 2, 0.94, 0.4286, 548, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.max_calls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.max_calls = max_calls"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L211_C8", "label": "self.contingency =", "type": "assigned_variable", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "vector": [14, 2, 0.1651, 0.0008, 2, 0.94, 0.5, 701, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.contingency", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.contingency = contingency"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L212_C8", "label": "self.contincency_args =", "type": "assigned_variable", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "vector": [14, 2, 0.1659, 0.0008, 2, 0.94, 0.5714, 257, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.contincency_args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.contincency_args = contingency_args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L213_C8", "label": "self.model_index =", "type": "assigned_variable", "loc": [213, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "vector": [14, 2, 0.1667, 0.0008, 2, 0.94, 0.6429, 186, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.model_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.model_index = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L214_C8", "label": "self.failure =", "type": "assigned_variable", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "vector": [14, 2, 0.1674, 0.0008, 2, 0.94, 0.7143, 81, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.failure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.failure = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L216_C8", "label": "self.num_calls =", "type": "assigned_variable", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "vector": [14, 2, 0.169, 0.0008, 2, 0.94, 0.7857, 964, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.num_calls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.num_calls = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L217_C8", "label": "self.beg_time = to_sec()", "type": "assigned_variable", "loc": [217, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "vector": [14, 2, 0.1698, 0.0008, 2, 0.94, 0.8571, 907, 3, 0, 0, 0, 750, 10, 2], "semantic": {"name": "self.beg_time", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " self.beg_time = rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L218_C8", "label": "self.thread = Timer()", "type": "assigned_variable", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "vector": [14, 2, 0.1706, 0.0008, 2, 0.94, 0.9286, 2, 3, 2, 0, 0, 771, 10, 1], "semantic": {"name": "self.thread", "arg_names": [], "import_names": [], "rhs_call_name": "Timer", "annotation": ""}, "snippet": " self.thread = threading.Timer(self.rate, self._run)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L219_C8", "label": "start()", "type": "expression", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "vector": [8, 2, 0.1714, 0.0008, 2, 0.94, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.thread.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L221_C4", "label": "_run", "type": "function", "loc": [221, 260], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L174_C0", "vector": [2, 1, 0.1882, 0.0313, 1, 0.06, 0.3333, 736, 0, 1, 0, 0, 0, 0, 12], "semantic": {"name": "_run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _run(self):\n if not self.is_running:\n return\n\n act_time = self.beg_time + self.rate * (self.num_calls + 2)\n interval = act_time - rospy.Time.now().to_sec()\n self.thread = threading.Timer(interval, self._run)\n self.thread.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L222_C8", "label": "if", "type": "if", "loc": [222, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L221_C4", "vector": [4, 2, 0.1741, 0.0016, 2, 0.62, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.is_running:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L223_C12", "label": "return", "type": "return", "loc": [223, 223], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L222_C8", "vector": [13, 3, 0.1745, 0.0008, 3, 0.34, 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_99296:Assign_L225_C8", "label": "act_time =", "type": "assigned_variable", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L221_C4", "vector": [14, 2, 0.1761, 0.0008, 2, 0.62, 0.125, 352, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "act_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " act_time = self.beg_time + self.rate * (self.num_calls + 2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L226_C8", "label": "interval =", "type": "assigned_variable", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L221_C4", "vector": [14, 2, 0.1768, 0.0008, 2, 0.62, 0.25, 628, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "interval", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " interval = act_time - rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L227_C8", "label": "self.thread = Timer()", "type": "assigned_variable", "loc": [227, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L221_C4", "vector": [14, 2, 0.1776, 0.0008, 2, 0.62, 0.375, 2, 3, 2, 0, 0, 771, 10, 1], "semantic": {"name": "self.thread", "arg_names": [], "import_names": [], "rhs_call_name": "Timer", "annotation": ""}, "snippet": " self.thread = threading.Timer(interval, self._run)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L228_C8", "label": "start()", "type": "expression", "loc": [228, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L221_C4", "vector": [8, 2, 0.1784, 0.0008, 2, 0.62, 0.5, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.thread.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L230_C8", "label": "if", "type": "if", "loc": [230, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L221_C4", "vector": [4, 2, 0.1811, 0.0031, 2, 0.62, 0.625, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.args is None:\n retval = self.cb()\n else:\n retval = self.cb(*self.args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L231_C12", "label": "retval = cb()", "type": "assigned_variable", "loc": [231, 231], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L230_C8", "vector": [14, 3, 0.1808, 0.0008, 3, 0.12, 0.0, 991, 3, 0, 0, 0, 540, 10, 1], "semantic": {"name": "retval", "arg_names": [], "import_names": [], "rhs_call_name": "cb", "annotation": ""}, "snippet": " retval = self.cb()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L233_C12", "label": "retval = cb()", "type": "assigned_variable", "loc": [233, 233], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L230_C8", "vector": [14, 3, 0.1823, 0.0008, 3, 0.12, 1.0, 991, 3, 1, 0, 0, 540, 10, 1], "semantic": {"name": "retval", "arg_names": [], "import_names": [], "rhs_call_name": "cb", "annotation": ""}, "snippet": " retval = self.cb(*self.args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L236_C8", "label": "for coord_i", "type": "for", "loc": [236, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L221_C4", "vector": [6, 2, 0.1894, 0.0102, 2, 0.62, 0.75, 534, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "coord_i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for coord_i in len(retval[1]):\n diff = abs(retval[1][coord_i] - self.mean_model[self.model_index][coord_i])\n deviation = np.sqrt(self.variance_model[self.model_index][coord_i])\n if diff > self.std_devs * deviation:\n # signal is outside allowable range\n self.failure = True\n self.is_running = False\n # call contingency function"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L237_C12", "label": "diff = abs()", "type": "assigned_variable", "loc": [237, 237], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L236_C8", "vector": [14, 3, 0.1854, 0.0008, 3, 0.77, 0.0, 833, 3, 1, 0, 0, 799, 10, 1], "semantic": {"name": "diff", "arg_names": [], "import_names": [], "rhs_call_name": "abs", "annotation": ""}, "snippet": " diff = abs(retval[1][coord_i] - self.mean_model[self.model_index][coord_i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L238_C12", "label": "deviation = sqrt()", "type": "assigned_variable", "loc": [238, 238], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L236_C8", "vector": [14, 3, 0.1862, 0.0008, 3, 0.77, 0.5, 872, 3, 1, 0, 0, 259, 10, 1], "semantic": {"name": "deviation", "arg_names": [], "import_names": [], "rhs_call_name": "sqrt", "annotation": ""}, "snippet": " deviation = np.sqrt(self.variance_model[self.model_index][coord_i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L239_C12", "label": "if", "type": "if", "loc": [239, 248], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L236_C8", "vector": [4, 3, 0.1905, 0.0078, 3, 0.77, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if diff > self.std_devs * deviation:\n # signal is outside allowable range\n self.failure = True\n self.is_running = False\n # call contingency function\n if contingency_args is None:\n self.contingency()\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L241_C16", "label": "self.failure =", "type": "assigned_variable", "loc": [241, 241], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L239_C12", "vector": [14, 4, 0.1886, 0.0008, 4, 0.62, 0.0, 81, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.failure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.failure = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L242_C16", "label": "self.is_running =", "type": "assigned_variable", "loc": [242, 242], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L239_C12", "vector": [14, 4, 0.1894, 0.0008, 4, 0.62, 0.3333, 983, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_running", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_running = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L244_C16", "label": "if", "type": "if", "loc": [244, 247], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L239_C12", "vector": [4, 4, 0.1921, 0.0031, 4, 0.62, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if contingency_args is None:\n self.contingency()\n else:\n self.contingency(*contingency_args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L245_C20", "label": "contingency()", "type": "expression", "loc": [245, 245], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L244_C16", "vector": [8, 5, 0.1917, 0.0008, 5, 0.86, 0.0, 16, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "contingency", "arg_names": [], "import_names": [], "rhs_call_name": "contingency", "annotation": ""}, "snippet": " self.contingency()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L247_C20", "label": "contingency()", "type": "expression", "loc": [247, 247], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L244_C16", "vector": [8, 5, 0.1933, 0.0008, 5, 0.86, 1.0, 16, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "contingency", "arg_names": [], "import_names": [], "rhs_call_name": "contingency", "annotation": ""}, "snippet": " self.contingency(*contingency_args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L248_C16", "label": "return", "type": "return", "loc": [248, 248], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L239_C12", "vector": [13, 4, 0.1941, 0.0008, 4, 0.62, 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_99296:If_L251_C8", "label": "if", "type": "if", "loc": [251, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L221_C4", "vector": [4, 2, 0.1972, 0.0023, 2, 0.62, 0.875, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.model_index == len(self.mean_model):\n self.is_running = False\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L252_C12", "label": "self.is_running =", "type": "assigned_variable", "loc": [252, 252], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L251_C8", "vector": [14, 3, 0.1972, 0.0008, 3, 0.71, 0.0, 983, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_running", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_running = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L253_C12", "label": "return", "type": "return", "loc": [253, 253], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L251_C8", "vector": [13, 3, 0.198, 0.0008, 3, 0.71, 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_99296:If_L256_C8", "label": "if", "type": "if", "loc": [256, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L221_C4", "vector": [4, 2, 0.2019, 0.0039, 2, 0.62, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.max_calls is None:\n self.max_calls -= 1\n if self.max_calls == 0:\n self.is_running = False\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L258_C12", "label": "if", "type": "if", "loc": [258, 260], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L256_C8", "vector": [4, 3, 0.2027, 0.0023, 3, 0.61, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.max_calls == 0:\n self.is_running = False\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L259_C16", "label": "self.is_running =", "type": "assigned_variable", "loc": [259, 259], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L258_C12", "vector": [14, 4, 0.2027, 0.0008, 4, 0.47, 0.0, 983, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_running", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_running = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L260_C16", "label": "return", "type": "return", "loc": [260, 260], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L258_C12", "vector": [13, 4, 0.2034, 0.0008, 4, 0.47, 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_99296:FunctionDef_L265_C4", "label": "stop", "type": "function", "loc": [265, 270], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L174_C0", "vector": [2, 1, 0.2093, 0.0047, 1, 0.06, 0.5, 343, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop(self):\n self.thread.cancel()\n if not self.is_running:\n return None\n self.is_running = False\n return self.ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L266_C8", "label": "cancel()", "type": "expression", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L265_C4", "vector": [8, 2, 0.2081, 0.0008, 2, 0.38, 0.0, 732, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel", "arg_names": [], "import_names": [], "rhs_call_name": "cancel", "annotation": ""}, "snippet": " self.thread.cancel()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L267_C8", "label": "if", "type": "if", "loc": [267, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L265_C4", "vector": [4, 2, 0.2093, 0.0016, 2, 0.38, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.is_running:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L268_C12", "label": "return", "type": "return", "loc": [268, 268], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L267_C8", "vector": [13, 3, 0.2097, 0.0008, 3, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L269_C8", "label": "self.is_running =", "type": "assigned_variable", "loc": [269, 269], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L265_C4", "vector": [14, 2, 0.2105, 0.0008, 2, 0.38, 0.6667, 983, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_running", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_running = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L270_C8", "label": "return", "type": "return", "loc": [270, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L265_C4", "vector": [13, 2, 0.2113, 0.0008, 2, 0.38, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L274_C4", "label": "get_ret_vals", "type": "function", "loc": [274, 277], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L174_C0", "vector": [2, 1, 0.2156, 0.0031, 1, 0.06, 0.6667, 144, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_ret_vals", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_ret_vals(self):\n if self.is_running:\n return None\n return self.ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L275_C8", "label": "if", "type": "if", "loc": [275, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L274_C4", "vector": [4, 2, 0.2156, 0.0016, 2, 0.5, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.is_running:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L276_C12", "label": "return", "type": "return", "loc": [276, 276], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L275_C8", "vector": [13, 3, 0.216, 0.0008, 3, 0.23, 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_99296:Return_L277_C8", "label": "return", "type": "return", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L274_C4", "vector": [13, 2, 0.2167, 0.0008, 2, 0.5, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L280_C4", "label": "has_failed", "type": "function", "loc": [280, 281], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L174_C0", "vector": [2, 1, 0.2195, 0.0016, 1, 0.06, 0.8333, 302, 0, 0, 1, 0, 0, 0, 0], "semantic": {"name": "has_failed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def has_failed():\n return self.failure"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L281_C8", "label": "return", "type": "return", "loc": [281, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L280_C4", "vector": [13, 2, 0.2199, 0.0008, 2, 0.58, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.failure"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L284_C4", "label": "wait_for_completion", "type": "function", "loc": [284, 287], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L174_C0", "vector": [2, 1, 0.2234, 0.0031, 1, 0.06, 1.0, 608, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "wait_for_completion", "arg_names": ["rate"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def wait_for_completion(rate=0.01):\n while self.is_running and not rospy.is_shutdown():\n rospy.sleep(rate)\n return not self.failure"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:While_L285_C8", "label": "while", "type": "while", "loc": [285, 286], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L284_C4", "vector": [5, 2, 0.2234, 0.0016, 2, 0.45, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.is_running and not rospy.is_shutdown():\n rospy.sleep(rate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L286_C12", "label": "sleep()", "type": "expression", "loc": [286, 286], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:While_L285_C8", "vector": [8, 3, 0.2238, 0.0008, 3, 0.61, 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(rate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L287_C8", "label": "return", "type": "return", "loc": [287, 287], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L284_C4", "vector": [13, 2, 0.2246, 0.0008, 2, 0.45, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return not self.failure"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "label": "ArmPerceptionMonitor", "type": "class", "loc": [302, 1094], "level": 0, "parent": null, "vector": [3, 0, 0.5462, 0.6205, 0, 0.66, 0.9032, 815, 0, 21, 0, 0, 0, 0, 99], "semantic": {"name": "ArmPerceptionMonitor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ArmPerceptionMonitor( ):\n\n ##\n # Initializes the listeners on the perception topics\n #\n # @param arm 0 if right, 1 if left\n # @param rate the rate at which the perception should capture states\n # @param percept_mon_list list of perceptions to monitor; if None, do all"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "label": "__init__", "type": "function", "loc": [310, 426], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "vector": [2, 1, 0.2879, 0.0915, 1, 0.94, 0.0, 555, 0, 6, 1, 0, 0, 0, 28], "semantic": {"name": "__init__", "arg_names": ["self", "arm", "tf_listener", "rate", "percept_mon_list", "model_zeros"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arm, tf_listener=None, rate=0.001, \n percept_mon_list=None, model_zeros=None):\n log(\"Initializing arm perception listeners\")\n\n self.rate = rate\n\n if arm == 0:\n armc = \"r\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L312_C8", "label": "log()", "type": "expression", "loc": [312, 312], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "vector": [8, 2, 0.2441, 0.0008, 2, 0.83, 0.0, 432, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": " log(\"Initializing arm perception listeners\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L314_C8", "label": "self.rate =", "type": "assigned_variable", "loc": [314, 314], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "vector": [14, 2, 0.2457, 0.0008, 2, 0.83, 0.0526, 6, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rate = rate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L316_C8", "label": "if", "type": "if", "loc": [316, 321], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "vector": [4, 2, 0.2492, 0.0047, 2, 0.83, 0.1053, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n armc = \"r\"\n is_right_arm = True\n else:\n armc = \"l\"\n is_right_arm = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L317_C12", "label": "armc =", "type": "assigned_variable", "loc": [317, 317], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L316_C8", "vector": [14, 3, 0.248, 0.0008, 3, 0.69, 0.0, 243, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "armc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " armc = \"r\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L318_C12", "label": "is_right_arm =", "type": "assigned_variable", "loc": [318, 318], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L316_C8", "vector": [14, 3, 0.2488, 0.0008, 3, 0.69, 0.3333, 64, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "is_right_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_right_arm = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L320_C12", "label": "armc =", "type": "assigned_variable", "loc": [320, 320], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L316_C8", "vector": [14, 3, 0.2504, 0.0008, 3, 0.69, 0.6667, 243, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "armc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " armc = \"l\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L321_C12", "label": "is_right_arm =", "type": "assigned_variable", "loc": [321, 321], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L316_C8", "vector": [14, 3, 0.2512, 0.0008, 3, 0.69, 1.0, 64, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "is_right_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_right_arm = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L323_C8", "label": "self.model_zeros =", "type": "assigned_variable", "loc": [323, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "vector": [14, 2, 0.2527, 0.0008, 2, 0.83, 0.1579, 850, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.model_zeros", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.model_zeros = model_zeros"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L325_C8", "label": "self.perceptions =", "type": "assigned_variable", "loc": [325, 325], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "vector": [14, 2, 0.2543, 0.0008, 2, 0.83, 0.2105, 184, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.perceptions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.perceptions = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L327_C8", "label": "self.perception_names =", "type": "assigned_variable", "loc": [327, 335], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "vector": [14, 2, 0.259, 0.007, 2, 0.83, 0.2632, 559, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.perception_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.perception_names = [ \"accelerometer\",\n \"joint_angles\",\n \"joint_velocities\",\n \"joint_efforts\",\n \"r_finger_periph_pressure\",\n \"r_finger_pad_pressure\", \n \"l_finger_periph_pressure\",\n \"l_finger_pad_pressure\","}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L337_C8", "label": "if", "type": "if", "loc": [337, 338], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "vector": [4, 2, 0.2641, 0.0016, 2, 0.83, 0.3158, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if percept_mon_list is None:\n percept_mon_list = self.perception_names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L338_C12", "label": "percept_mon_list =", "type": "assigned_variable", "loc": [338, 338], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L337_C8", "vector": [14, 3, 0.2645, 0.0008, 3, 0.64, 0.0, 683, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "percept_mon_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " percept_mon_list = self.perception_names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L340_C8", "label": "if", "type": "if", "loc": [340, 344], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "vector": [4, 2, 0.2676, 0.0039, 2, 0.83, 0.3684, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if \"accelerometer\" in percept_mon_list:\n accel_listener = GenericListener(\"accel_mon_node\", AccelerometerState, \n \"accelerometer/\" + armc + \"_gripper_motor\",\n rate, accel_state_processor)\n self.perceptions[\"accelerometer\"] = accel_listener.read"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L341_C12", "label": "accel_listener = GenericListener()", "type": "assigned_variable", "loc": [341, 343], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L340_C8", "vector": [14, 3, 0.2676, 0.0023, 3, 0.46, 0.0, 899, 3, 5, 0, 0, 36, 10, 1], "semantic": {"name": "accel_listener", "arg_names": [], "import_names": [], "rhs_call_name": "GenericListener", "annotation": ""}, "snippet": " accel_listener = GenericListener(\"accel_mon_node\", AccelerometerState, \n \"accelerometer/\" + armc + \"_gripper_motor\",\n rate, accel_state_processor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L344_C12", "label": "assign", "type": "assigned_variable", "loc": [344, 344], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L340_C8", "vector": [14, 3, 0.2692, 0.0008, 3, 0.46, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.perceptions[\"accelerometer\"] = accel_listener.read"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L346_C8", "label": "if", "type": "if", "loc": [346, 352], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "vector": [4, 2, 0.2731, 0.0055, 2, 0.83, 0.4211, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if \"joint_angles\" in percept_mon_list:\n joint_angles_processor = ft.partial(joints_state_processor, \n right_arm=is_right_arm, \n angles_velocities_efforts=0)\n joint_angles_listener = GenericListener(\"joint_angles_mon_node\", JointState, \n \"joint_states\", rate, joint_angles_processor)\n self.perceptions[\"joint_angles\"] = joint_angles_listener.read"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L347_C12", "label": "joint_angles_processor = partial()", "type": "assigned_variable", "loc": [347, 349], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L346_C8", "vector": [14, 3, 0.2723, 0.0023, 3, 0.12, 0.0, 509, 3, 3, 0, 0, 365, 10, 1], "semantic": {"name": "joint_angles_processor", "arg_names": [], "import_names": [], "rhs_call_name": "partial", "annotation": ""}, "snippet": " joint_angles_processor = ft.partial(joints_state_processor, \n right_arm=is_right_arm, \n angles_velocities_efforts=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L350_C12", "label": "joint_angles_listener = GenericListener()", "type": "assigned_variable", "loc": [350, 351], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L346_C8", "vector": [14, 3, 0.2743, 0.0016, 3, 0.12, 0.5, 620, 3, 5, 0, 0, 36, 10, 1], "semantic": {"name": "joint_angles_listener", "arg_names": [], "import_names": [], "rhs_call_name": "GenericListener", "annotation": ""}, "snippet": " joint_angles_listener = GenericListener(\"joint_angles_mon_node\", JointState, \n \"joint_states\", rate, joint_angles_processor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L352_C12", "label": "assign", "type": "assigned_variable", "loc": [352, 352], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L346_C8", "vector": [14, 3, 0.2754, 0.0008, 3, 0.12, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.perceptions[\"joint_angles\"] = joint_angles_listener.read"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L354_C8", "label": "if", "type": "if", "loc": [354, 360], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "vector": [4, 2, 0.2793, 0.0055, 2, 0.83, 0.4737, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if \"joint_velocities\" in percept_mon_list:\n joint_velocities_processor = ft.partial(joints_state_processor, \n right_arm=is_right_arm, \n angles_velocities_efforts=1)\n joint_velocities_listener = GenericListener(\"joint_efforts_mon_node\", JointState, \n \"joint_states\", rate, joint_velocities_processor)\n self.perceptions[\"joint_velocities\"] = joint_velocities_listener.read"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L355_C12", "label": "joint_velocities_processor = partial()", "type": "assigned_variable", "loc": [355, 357], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L354_C8", "vector": [14, 3, 0.2786, 0.0023, 3, 0.32, 0.0, 695, 3, 3, 0, 0, 365, 10, 1], "semantic": {"name": "joint_velocities_processor", "arg_names": [], "import_names": [], "rhs_call_name": "partial", "annotation": ""}, "snippet": " joint_velocities_processor = ft.partial(joints_state_processor, \n right_arm=is_right_arm, \n angles_velocities_efforts=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L358_C12", "label": "joint_velocities_listener = GenericListener()", "type": "assigned_variable", "loc": [358, 359], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L354_C8", "vector": [14, 3, 0.2805, 0.0016, 3, 0.32, 0.5, 693, 3, 5, 0, 0, 36, 10, 1], "semantic": {"name": "joint_velocities_listener", "arg_names": [], "import_names": [], "rhs_call_name": "GenericListener", "annotation": ""}, "snippet": " joint_velocities_listener = GenericListener(\"joint_efforts_mon_node\", JointState, \n \"joint_states\", rate, joint_velocities_processor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L360_C12", "label": "assign", "type": "assigned_variable", "loc": [360, 360], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L354_C8", "vector": [14, 3, 0.2817, 0.0008, 3, 0.32, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.perceptions[\"joint_velocities\"] = joint_velocities_listener.read"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L362_C8", "label": "if", "type": "if", "loc": [362, 368], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "vector": [4, 2, 0.2856, 0.0055, 2, 0.83, 0.5263, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if \"joint_efforts\" in percept_mon_list:\n joint_efforts_processor = ft.partial(joints_state_processor, \n right_arm=is_right_arm, \n angles_velocities_efforts=2)\n joint_efforts_listener = GenericListener(\"joint_efforts_mon_node\", JointState, \n \"joint_states\", rate, joint_efforts_processor)\n self.perceptions[\"joint_efforts\"] = joint_efforts_listener.read"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L363_C12", "label": "joint_efforts_processor = partial()", "type": "assigned_variable", "loc": [363, 365], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L362_C8", "vector": [14, 3, 0.2848, 0.0023, 3, 0.49, 0.0, 938, 3, 3, 0, 0, 365, 10, 1], "semantic": {"name": "joint_efforts_processor", "arg_names": [], "import_names": [], "rhs_call_name": "partial", "annotation": ""}, "snippet": " joint_efforts_processor = ft.partial(joints_state_processor, \n right_arm=is_right_arm, \n angles_velocities_efforts=2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L366_C12", "label": "joint_efforts_listener = GenericListener()", "type": "assigned_variable", "loc": [366, 367], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L362_C8", "vector": [14, 3, 0.2868, 0.0016, 3, 0.49, 0.5, 68, 3, 5, 0, 0, 36, 10, 1], "semantic": {"name": "joint_efforts_listener", "arg_names": [], "import_names": [], "rhs_call_name": "GenericListener", "annotation": ""}, "snippet": " joint_efforts_listener = GenericListener(\"joint_efforts_mon_node\", JointState, \n \"joint_states\", rate, joint_efforts_processor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L368_C12", "label": "assign", "type": "assigned_variable", "loc": [368, 368], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L362_C8", "vector": [14, 3, 0.2879, 0.0008, 3, 0.49, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.perceptions[\"joint_efforts\"] = joint_efforts_listener.read"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L370_C8", "label": "if", "type": "if", "loc": [370, 376], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "vector": [4, 2, 0.2919, 0.0055, 2, 0.83, 0.5789, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if \"r_finger_periph_pressure\" in percept_mon_list:\n r_finger_periph_pressure_processor = ft.partial(pressure_state_processor, \n right_finger_tip=True, indicies=range(1,7))\n r_finger_periph_pressure_listener = GenericListener(\"pressure_mon_node\", PressureState, \n \"pressure/\" + armc + \"_gripper_motor\", rate, \n r_finger_periph_pressure_processor)\n self.perceptions[\"r_finger_periph_pressure\"] = r_finger_periph_pressure_listener.read"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L371_C12", "label": "r_finger_periph_pressure_processor = partial()", "type": "assigned_variable", "loc": [371, 372], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L370_C8", "vector": [14, 3, 0.2907, 0.0016, 3, 0.55, 0.0, 647, 3, 3, 0, 0, 365, 10, 2], "semantic": {"name": "r_finger_periph_pressure_processor", "arg_names": [], "import_names": [], "rhs_call_name": "partial", "annotation": ""}, "snippet": " r_finger_periph_pressure_processor = ft.partial(pressure_state_processor, \n right_finger_tip=True, indicies=range(1,7))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L373_C12", "label": "r_finger_periph_pressure_listener = GenericListener()", "type": "assigned_variable", "loc": [373, 375], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L370_C8", "vector": [14, 3, 0.2926, 0.0023, 3, 0.55, 0.5, 551, 3, 5, 0, 0, 36, 10, 1], "semantic": {"name": "r_finger_periph_pressure_listener", "arg_names": [], "import_names": [], "rhs_call_name": "GenericListener", "annotation": ""}, "snippet": " r_finger_periph_pressure_listener = GenericListener(\"pressure_mon_node\", PressureState, \n \"pressure/\" + armc + \"_gripper_motor\", rate, \n r_finger_periph_pressure_processor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L376_C12", "label": "assign", "type": "assigned_variable", "loc": [376, 376], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L370_C8", "vector": [14, 3, 0.2942, 0.0008, 3, 0.55, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.perceptions[\"r_finger_periph_pressure\"] = r_finger_periph_pressure_listener.read"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L378_C8", "label": "if", "type": "if", "loc": [378, 384], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "vector": [4, 2, 0.2981, 0.0055, 2, 0.83, 0.6316, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if \"r_finger_pad_pressure\" in percept_mon_list:\n r_finger_pad_pressure_processor = ft.partial(pressure_state_processor, \n right_finger_tip=True, indicies=range(7,22))\n r_finger_pad_pressure_listener = GenericListener(\"pressure_mon_node\", PressureState, \n \"pressure/\" + armc + \"_gripper_motor\", rate, \n r_finger_pad_pressure_processor)\n self.perceptions[\"r_finger_pad_pressure\"] = r_finger_pad_pressure_listener.read"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L379_C12", "label": "r_finger_pad_pressure_processor = partial()", "type": "assigned_variable", "loc": [379, 380], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L378_C8", "vector": [14, 3, 0.2969, 0.0016, 3, 0.5, 0.0, 510, 3, 3, 0, 0, 365, 10, 2], "semantic": {"name": "r_finger_pad_pressure_processor", "arg_names": [], "import_names": [], "rhs_call_name": "partial", "annotation": ""}, "snippet": " r_finger_pad_pressure_processor = ft.partial(pressure_state_processor, \n right_finger_tip=True, indicies=range(7,22))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L381_C12", "label": "r_finger_pad_pressure_listener = GenericListener()", "type": "assigned_variable", "loc": [381, 383], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L378_C8", "vector": [14, 3, 0.2989, 0.0023, 3, 0.5, 0.5, 333, 3, 5, 0, 0, 36, 10, 1], "semantic": {"name": "r_finger_pad_pressure_listener", "arg_names": [], "import_names": [], "rhs_call_name": "GenericListener", "annotation": ""}, "snippet": " r_finger_pad_pressure_listener = GenericListener(\"pressure_mon_node\", PressureState, \n \"pressure/\" + armc + \"_gripper_motor\", rate, \n r_finger_pad_pressure_processor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L384_C12", "label": "assign", "type": "assigned_variable", "loc": [384, 384], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L378_C8", "vector": [14, 3, 0.3005, 0.0008, 3, 0.5, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.perceptions[\"r_finger_pad_pressure\"] = r_finger_pad_pressure_listener.read"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L386_C8", "label": "if", "type": "if", "loc": [386, 392], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "vector": [4, 2, 0.3044, 0.0055, 2, 0.83, 0.6842, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if \"l_finger_periph_pressure\" in percept_mon_list:\n l_finger_periph_pressure_processor = ft.partial(pressure_state_processor, \n right_finger_tip=False, indicies=range(1,7))\n l_finger_periph_pressure_listener = GenericListener(\"pressure_mon_node\", PressureState, \n \"pressure/\" + armc + \"_gripper_motor\", rate, \n l_finger_periph_pressure_processor)\n self.perceptions[\"l_finger_periph_pressure\"] = l_finger_periph_pressure_listener.read"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L387_C12", "label": "l_finger_periph_pressure_processor = partial()", "type": "assigned_variable", "loc": [387, 388], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L386_C8", "vector": [14, 3, 0.3032, 0.0016, 3, 0.31, 0.0, 234, 3, 3, 0, 0, 365, 10, 2], "semantic": {"name": "l_finger_periph_pressure_processor", "arg_names": [], "import_names": [], "rhs_call_name": "partial", "annotation": ""}, "snippet": " l_finger_periph_pressure_processor = ft.partial(pressure_state_processor, \n right_finger_tip=False, indicies=range(1,7))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L389_C12", "label": "l_finger_periph_pressure_listener = GenericListener()", "type": "assigned_variable", "loc": [389, 391], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L386_C8", "vector": [14, 3, 0.3052, 0.0023, 3, 0.31, 0.5, 275, 3, 5, 0, 0, 36, 10, 1], "semantic": {"name": "l_finger_periph_pressure_listener", "arg_names": [], "import_names": [], "rhs_call_name": "GenericListener", "annotation": ""}, "snippet": " l_finger_periph_pressure_listener = GenericListener(\"pressure_mon_node\", PressureState, \n \"pressure/\" + armc + \"_gripper_motor\", rate, \n l_finger_periph_pressure_processor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L392_C12", "label": "assign", "type": "assigned_variable", "loc": [392, 392], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L386_C8", "vector": [14, 3, 0.3067, 0.0008, 3, 0.31, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.perceptions[\"l_finger_periph_pressure\"] = l_finger_periph_pressure_listener.read"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L394_C8", "label": "if", "type": "if", "loc": [394, 400], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "vector": [4, 2, 0.3106, 0.0055, 2, 0.83, 0.7368, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if \"l_finger_pad_pressure\" in percept_mon_list:\n l_finger_pad_pressure_processor = ft.partial(pressure_state_processor, \n right_finger_tip=False, indicies=range(7,22))\n l_finger_pad_pressure_listener = GenericListener(\"pressure_mon_node\", PressureState, \n \"pressure/\" + armc + \"_gripper_motor\", rate, \n l_finger_pad_pressure_processor)\n self.perceptions[\"l_finger_pad_pressure\"] = l_finger_pad_pressure_listener.read"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L395_C12", "label": "l_finger_pad_pressure_processor = partial()", "type": "assigned_variable", "loc": [395, 396], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L394_C8", "vector": [14, 3, 0.3095, 0.0016, 3, 0.27, 0.0, 170, 3, 3, 0, 0, 365, 10, 2], "semantic": {"name": "l_finger_pad_pressure_processor", "arg_names": [], "import_names": [], "rhs_call_name": "partial", "annotation": ""}, "snippet": " l_finger_pad_pressure_processor = ft.partial(pressure_state_processor, \n right_finger_tip=False, indicies=range(7,22))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L397_C12", "label": "l_finger_pad_pressure_listener = GenericListener()", "type": "assigned_variable", "loc": [397, 399], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L394_C8", "vector": [14, 3, 0.3114, 0.0023, 3, 0.27, 0.5, 764, 3, 5, 0, 0, 36, 10, 1], "semantic": {"name": "l_finger_pad_pressure_listener", "arg_names": [], "import_names": [], "rhs_call_name": "GenericListener", "annotation": ""}, "snippet": " l_finger_pad_pressure_listener = GenericListener(\"pressure_mon_node\", PressureState, \n \"pressure/\" + armc + \"_gripper_motor\", rate, \n l_finger_pad_pressure_processor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L400_C12", "label": "assign", "type": "assigned_variable", "loc": [400, 400], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L394_C8", "vector": [14, 3, 0.313, 0.0008, 3, 0.27, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.perceptions[\"l_finger_pad_pressure\"] = l_finger_pad_pressure_listener.read"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L402_C8", "label": "for k", "type": "for", "loc": [402, 405], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "vector": [6, 2, 0.3157, 0.0031, 2, 0.83, 0.7895, 954, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in self.perceptions:\n self.perceptions[k] = ft.partial(self.perceptions[k], willing_to_wait=False, \n quiet=True,\n warn=False, allow_duplication=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L403_C12", "label": " = partial()", "type": "assigned_variable", "loc": [403, 405], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L402_C8", "vector": [14, 3, 0.3161, 0.0023, 3, 0.18, 0.0, 0, 3, 5, 0, 0, 365, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "partial", "annotation": ""}, "snippet": " self.perceptions[k] = ft.partial(self.perceptions[k], willing_to_wait=False, \n quiet=True,\n warn=False, allow_duplication=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L407_C8", "label": "if", "type": "if", "loc": [407, 413], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "vector": [4, 2, 0.3208, 0.0055, 2, 0.83, 0.8421, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if \"gripper_pose\" in percept_mon_list:\n def gripper_pose_lookup():\n lct = tf_listener.getLatestCommonTime(\"/torso_lift_link\", \"/\" + armc + \"_wrist_roll_link\")\n pos, quat = tf_listener.lookupTransform(\"/torso_lift_link\", \"/\" + armc + \"_wrist_roll_link\", lct)\n return (lct.to_nsec(), np.array(pos + quat))\n\n self.perceptions[\"gripper_pose\"] = gripper_pose_lookup"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L408_C12", "label": "gripper_pose_lookup", "type": "function", "loc": [408, 411], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L407_C8", "vector": [2, 3, 0.3204, 0.0031, 3, 0.33, 0.0, 694, 0, 0, 1, 0, 0, 0, 4], "semantic": {"name": "gripper_pose_lookup", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def gripper_pose_lookup():\n lct = tf_listener.getLatestCommonTime(\"/torso_lift_link\", \"/\" + armc + \"_wrist_roll_link\")\n pos, quat = tf_listener.lookupTransform(\"/torso_lift_link\", \"/\" + armc + \"_wrist_roll_link\", lct)\n return (lct.to_nsec(), np.array(pos + quat))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L409_C16", "label": "lct = getLatestCommonTime()", "type": "assigned_variable", "loc": [409, 409], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L408_C12", "vector": [14, 4, 0.32, 0.0008, 4, 0.96, 0.0, 483, 3, 2, 0, 0, 168, 10, 1], "semantic": {"name": "lct", "arg_names": [], "import_names": [], "rhs_call_name": "getLatestCommonTime", "annotation": ""}, "snippet": " lct = tf_listener.getLatestCommonTime(\"/torso_lift_link\", \"/\" + armc + \"_wrist_roll_link\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L410_C16", "label": "pos, quat = lookupTransform()", "type": "assigned_variable", "loc": [410, 410], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L408_C12", "vector": [14, 4, 0.3208, 0.0008, 4, 0.96, 0.5, 375, 3, 3, 0, 0, 926, 10, 1], "semantic": {"name": "pos, quat", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": " pos, quat = tf_listener.lookupTransform(\"/torso_lift_link\", \"/\" + armc + \"_wrist_roll_link\", lct)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L411_C16", "label": "return", "type": "return", "loc": [411, 411], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L408_C12", "vector": [13, 4, 0.3216, 0.0008, 4, 0.96, 1.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (lct.to_nsec(), np.array(pos + quat))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L413_C12", "label": "assign", "type": "assigned_variable", "loc": [413, 413], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L407_C8", "vector": [14, 3, 0.3232, 0.0008, 3, 0.33, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.perceptions[\"gripper_pose\"] = gripper_pose_lookup"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L422_C8", "label": "clear_vars()", "type": "expression", "loc": [422, 422], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "vector": [8, 2, 0.3302, 0.0008, 2, 0.83, 0.8947, 806, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clear_vars", "arg_names": [], "import_names": [], "rhs_call_name": "clear_vars", "annotation": ""}, "snippet": " self.clear_vars()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L424_C8", "label": "self.logger = RateCaller()", "type": "assigned_variable", "loc": [424, 424], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "vector": [14, 2, 0.3318, 0.0008, 2, 0.83, 0.9474, 829, 3, 2, 0, 0, 67, 10, 1], "semantic": {"name": "self.logger", "arg_names": [], "import_names": [], "rhs_call_name": "RateCaller", "annotation": ""}, "snippet": " self.logger = RateCaller(self._gather_perception, self.rate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L426_C8", "label": "log()", "type": "expression", "loc": [426, 426], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "vector": [8, 2, 0.3333, 0.0008, 2, 0.83, 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 initialization\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L428_C4", "label": "_gather_perception", "type": "function", "loc": [428, 435], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "vector": [2, 1, 0.3376, 0.0063, 1, 0.94, 0.0526, 376, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "_gather_perception", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _gather_perception(self):\n t1 = rospy.Time.now().to_sec()\n for k in self.perceptions:\n self.datasets[k][-1] += [self.perceptions[k]()]\n t2 = rospy.Time.now().to_sec()\n import random\n if random.randint(0,100)==0:\n print(\"Time:\", t1-t2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L429_C8", "label": "t1 = to_sec()", "type": "assigned_variable", "loc": [429, 429], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L428_C4", "vector": [14, 2, 0.3357, 0.0008, 2, 0.67, 0.0, 329, 3, 0, 0, 0, 750, 10, 2], "semantic": {"name": "t1", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " t1 = rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L430_C8", "label": "for k", "type": "for", "loc": [430, 431], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L428_C4", "vector": [6, 2, 0.3369, 0.0016, 2, 0.67, 0.25, 954, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in self.perceptions:\n self.datasets[k][-1] += [self.perceptions[k]()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L432_C8", "label": "t2 = to_sec()", "type": "assigned_variable", "loc": [432, 432], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L428_C4", "vector": [14, 2, 0.338, 0.0008, 2, 0.67, 0.5, 469, 3, 0, 0, 0, 750, 10, 2], "semantic": {"name": "t2", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " t2 = rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Import_L433_C8", "label": "random import random", "type": "import", "loc": [433, 433], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L428_C4", "vector": [1, 2, 0.3388, 0.0008, 2, 0.67, 0.75, 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_99296:If_L434_C8", "label": "if", "type": "if", "loc": [434, 435], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L428_C4", "vector": [4, 2, 0.34, 0.0016, 2, 0.67, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if random.randint(0,100)==0:\n print(\"Time:\", t1-t2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L435_C12", "label": "print()", "type": "expression", "loc": [435, 435], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L434_C8", "vector": [8, 3, 0.3404, 0.0008, 3, 0.09, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Time:\", t1-t2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L439_C4", "label": "clear_vars", "type": "function", "loc": [439, 446], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "vector": [2, 1, 0.3462, 0.0063, 1, 0.94, 0.1053, 806, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "clear_vars", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def clear_vars(self):\n self.datasets = {}\n self.models = {}\n for k in self.perceptions:\n self.datasets[k] = []\n self.models[k] = {\"mean\" : None, \"variance\" : None}\n\n self.active = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L440_C8", "label": "self.datasets =", "type": "assigned_variable", "loc": [440, 440], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L439_C4", "vector": [14, 2, 0.3443, 0.0008, 2, 0.8, 0.0, 863, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.datasets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.datasets = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L441_C8", "label": "self.models =", "type": "assigned_variable", "loc": [441, 441], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L439_C4", "vector": [14, 2, 0.3451, 0.0008, 2, 0.8, 0.3333, 134, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.models = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L442_C8", "label": "for k", "type": "for", "loc": [442, 444], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L439_C4", "vector": [6, 2, 0.3466, 0.0023, 2, 0.8, 0.6667, 954, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in self.perceptions:\n self.datasets[k] = []\n self.models[k] = {\"mean\" : None, \"variance\" : None}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L443_C12", "label": "assign", "type": "assigned_variable", "loc": [443, 443], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L442_C8", "vector": [14, 3, 0.3466, 0.0008, 3, 0.91, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.datasets[k] = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L444_C12", "label": "assign", "type": "assigned_variable", "loc": [444, 444], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L442_C8", "vector": [14, 3, 0.3474, 0.0008, 3, 0.91, 1.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.models[k] = {\"mean\" : None, \"variance\" : None}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L446_C8", "label": "self.active =", "type": "assigned_variable", "loc": [446, 446], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L439_C4", "vector": [14, 2, 0.349, 0.0008, 2, 0.8, 1.0, 175, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.active", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.active = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L453_C4", "label": "start_training", "type": "function", "loc": [453, 464], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "vector": [2, 1, 0.3588, 0.0094, 1, 0.94, 0.1579, 638, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "start_training", "arg_names": ["self", "duration"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_training(self, duration=None):\n if self.active:\n log(\"Perception already active.\")\n return\n self.active = True\n\n for k in self.perceptions:\n self.datasets[k] += [[]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L454_C8", "label": "if", "type": "if", "loc": [454, 456], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L453_C4", "vector": [4, 2, 0.356, 0.0023, 2, 0.31, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.active:\n log(\"Perception already active.\")\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L455_C12", "label": "log()", "type": "expression", "loc": [455, 455], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L454_C8", "vector": [8, 3, 0.356, 0.0008, 3, 0.92, 0.0, 432, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": " log(\"Perception already active.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L456_C12", "label": "return", "type": "return", "loc": [456, 456], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L454_C8", "vector": [13, 3, 0.3568, 0.0008, 3, 0.92, 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_99296:Assign_L457_C8", "label": "self.active =", "type": "assigned_variable", "loc": [457, 457], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L453_C4", "vector": [14, 2, 0.3576, 0.0008, 2, 0.31, 0.25, 175, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.active", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.active = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L459_C8", "label": "for k", "type": "for", "loc": [459, 460], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L453_C4", "vector": [6, 2, 0.3595, 0.0016, 2, 0.31, 0.5, 954, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in self.perceptions:\n self.datasets[k] += [[]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L461_C8", "label": "run()", "type": "expression", "loc": [461, 461], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L453_C4", "vector": [8, 2, 0.3607, 0.0008, 2, 0.31, 0.75, 679, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " self.logger.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L463_C8", "label": "if", "type": "if", "loc": [463, 464], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L453_C4", "vector": [4, 2, 0.3627, 0.0016, 2, 0.31, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not duration is None:\n threading.Timer(self.stop_training, duration)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L464_C12", "label": "Timer()", "type": "expression", "loc": [464, 464], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L463_C8", "vector": [8, 3, 0.3631, 0.0008, 3, 0.82, 0.0, 771, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Timer", "arg_names": [], "import_names": [], "rhs_call_name": "Timer", "annotation": ""}, "snippet": " threading.Timer(self.stop_training, duration)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L469_C4", "label": "stop_training", "type": "function", "loc": [469, 477], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "vector": [2, 1, 0.3701, 0.007, 1, 0.94, 0.2105, 347, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "stop_training", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop_training(self):\n if not self.active:\n log(\"Nothing to stop.\")\n return\n\n self.logger.stop()\n\n self.active = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L470_C8", "label": "if", "type": "if", "loc": [470, 472], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L469_C4", "vector": [4, 2, 0.3685, 0.0023, 2, 0.8, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.active:\n log(\"Nothing to stop.\")\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L471_C12", "label": "log()", "type": "expression", "loc": [471, 471], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L470_C8", "vector": [8, 3, 0.3685, 0.0008, 3, 0.65, 0.0, 432, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": " log(\"Nothing to stop.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L472_C12", "label": "return", "type": "return", "loc": [472, 472], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L470_C8", "vector": [13, 3, 0.3693, 0.0008, 3, 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_99296:Expr_L474_C8", "label": "stop()", "type": "expression", "loc": [474, 474], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L469_C4", "vector": [8, 2, 0.3709, 0.0008, 2, 0.8, 0.3333, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " self.logger.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L476_C8", "label": "self.active =", "type": "assigned_variable", "loc": [476, 476], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L469_C4", "vector": [14, 2, 0.3725, 0.0008, 2, 0.8, 0.6667, 175, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.active", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.active = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L477_C8", "label": "return", "type": "return", "loc": [477, 477], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L469_C4", "vector": [13, 2, 0.3732, 0.0008, 2, 0.8, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return len(self.datasets[self.datasets.keys()[0]][-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L483_C4", "label": "save", "type": "function", "loc": [483, 484], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "vector": [2, 1, 0.3783, 0.0016, 1, 0.94, 0.2632, 928, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save", "arg_names": ["self", "filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def save(self, filename):\n save_pickle((self.datasets, self.models), filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L484_C8", "label": "save_pickle()", "type": "expression", "loc": [484, 484], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L483_C4", "vector": [8, 2, 0.3787, 0.0008, 2, 0.6, 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": " save_pickle((self.datasets, self.models), filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L490_C4", "label": "load", "type": "function", "loc": [490, 491], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "vector": [2, 1, 0.3838, 0.0016, 1, 0.94, 0.3158, 37, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": ["self", "filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def load(self, filename):\n self.datasets, self.models = load_pickle(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L491_C8", "label": " = load_pickle()", "type": "assigned_variable", "loc": [491, 491], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L490_C4", "vector": [14, 2, 0.3842, 0.0008, 2, 0.9, 0.0, 0, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " self.datasets, self.models = load_pickle(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L592_C4", "label": "get_zeros", "type": "function", "loc": [592, 605], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "vector": [2, 1, 0.4683, 0.011, 1, 0.94, 0.3684, 264, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "get_zeros", "arg_names": ["self", "time"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_zeros(self, time=4.):\n self._zeros = {}\n for k in self.perceptions:\n self._zeros[k] = None\n self._n = 0\n \n monitor = RateCaller(self._sum_values, self.rate)\n monitor.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L593_C8", "label": "self._zeros =", "type": "assigned_variable", "loc": [593, 593], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L592_C4", "vector": [14, 2, 0.464, 0.0008, 2, 0.57, 0.0, 275, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self._zeros", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._zeros = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L594_C8", "label": "for k", "type": "for", "loc": [594, 595], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L592_C4", "vector": [6, 2, 0.4652, 0.0016, 2, 0.57, 0.125, 954, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in self.perceptions:\n self._zeros[k] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L595_C12", "label": "assign", "type": "assigned_variable", "loc": [595, 595], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L594_C8", "vector": [14, 3, 0.4656, 0.0008, 3, 0.1, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._zeros[k] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L596_C8", "label": "self._n =", "type": "assigned_variable", "loc": [596, 596], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L592_C4", "vector": [14, 2, 0.4664, 0.0008, 2, 0.57, 0.25, 185, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self._n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._n = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L598_C8", "label": "monitor = RateCaller()", "type": "assigned_variable", "loc": [598, 598], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L592_C4", "vector": [14, 2, 0.4679, 0.0008, 2, 0.57, 0.375, 68, 3, 2, 0, 0, 67, 10, 1], "semantic": {"name": "monitor", "arg_names": [], "import_names": [], "rhs_call_name": "RateCaller", "annotation": ""}, "snippet": " monitor = RateCaller(self._sum_values, self.rate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L599_C8", "label": "run()", "type": "expression", "loc": [599, 599], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L592_C4", "vector": [8, 2, 0.4687, 0.0008, 2, 0.57, 0.5, 679, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " monitor.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L600_C8", "label": "sleep()", "type": "expression", "loc": [600, 600], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L592_C4", "vector": [8, 2, 0.4695, 0.0008, 2, 0.57, 0.625, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L601_C8", "label": "stop()", "type": "expression", "loc": [601, 601], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L592_C4", "vector": [8, 2, 0.4703, 0.0008, 2, 0.57, 0.75, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " monitor.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L603_C8", "label": "for k", "type": "for", "loc": [603, 604], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L592_C4", "vector": [6, 2, 0.4722, 0.0016, 2, 0.57, 0.875, 954, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in self.perceptions:\n self._zeros[k] /= self._n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L605_C8", "label": "return", "type": "return", "loc": [605, 605], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L592_C4", "vector": [13, 2, 0.4734, 0.0008, 2, 0.57, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._zeros"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L607_C4", "label": "_sum_values", "type": "function", "loc": [607, 614], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "vector": [2, 1, 0.4777, 0.0063, 1, 0.94, 0.4211, 395, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "_sum_values", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _sum_values(self):\n for k in self.perceptions:\n add_data = np.array(self.perceptions[k]()[1])\n if self._zeros[k] is None:\n self._zeros[k] = np.copy(add_data)\n else:\n self._zeros[k] += add_data\n self._n += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L608_C8", "label": "for k", "type": "for", "loc": [608, 613], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L607_C4", "vector": [6, 2, 0.4777, 0.0047, 2, 0.77, 0.0, 954, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in self.perceptions:\n add_data = np.array(self.perceptions[k]()[1])\n if self._zeros[k] is None:\n self._zeros[k] = np.copy(add_data)\n else:\n self._zeros[k] += add_data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L609_C12", "label": "add_data = array()", "type": "assigned_variable", "loc": [609, 609], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L608_C8", "vector": [14, 3, 0.4765, 0.0008, 3, 0.62, 0.0, 954, 3, 1, 0, 0, 80, 10, 2], "semantic": {"name": "add_data", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " add_data = np.array(self.perceptions[k]()[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L610_C12", "label": "if", "type": "if", "loc": [610, 613], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L608_C8", "vector": [4, 3, 0.4785, 0.0031, 3, 0.62, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._zeros[k] is None:\n self._zeros[k] = np.copy(add_data)\n else:\n self._zeros[k] += add_data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L611_C16", "label": " = copy()", "type": "assigned_variable", "loc": [611, 611], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L610_C12", "vector": [14, 4, 0.4781, 0.0008, 4, 0.4, 0.0, 0, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self._zeros[k] = np.copy(add_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "label": "setup_monitoring", "type": "function", "loc": [618, 656], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "vector": [2, 1, 0.4984, 0.0305, 1, 0.94, 0.4737, 745, 0, 15, 0, 0, 0, 0, 2], "semantic": {"name": "setup_monitoring", "arg_names": ["self", "models", "std_dev_dict", "noise_dev_dict", "duration", "std_dev_default", "noise_dev_default", "tol_thresh_dict", "contingency", "window_size", "current_zeros", "sampling_rate", "transform_dict", "verbose", "collide"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setup_monitoring(self, models,\n std_dev_dict=None, noise_dev_dict=None, duration=None,\n std_dev_default=2.0, noise_dev_default=0.25,\n tol_thresh_dict=None,\n contingency=None, window_size=70, current_zeros=None,\n sampling_rate = 1,\n transform_dict=None, verbose=True, collide=True):\n self.std_dev_default = std_dev_default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L625_C8", "label": "self.std_dev_default =", "type": "assigned_variable", "loc": [625, 625], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "vector": [14, 2, 0.489, 0.0008, 2, 0.17, 0.0, 723, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.std_dev_default", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.std_dev_default = std_dev_default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L626_C8", "label": "self.noise_dev_default =", "type": "assigned_variable", "loc": [626, 626], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "vector": [14, 2, 0.4898, 0.0008, 2, 0.17, 0.0435, 566, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.noise_dev_default", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.noise_dev_default = noise_dev_default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L628_C8", "label": "self.models =", "type": "assigned_variable", "loc": [628, 628], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "vector": [14, 2, 0.4914, 0.0008, 2, 0.17, 0.087, 134, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.models = models"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L629_C8", "label": "self.current_data =", "type": "assigned_variable", "loc": [629, 629], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "vector": [14, 2, 0.4922, 0.0008, 2, 0.17, 0.1304, 201, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.current_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_data = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L630_C8", "label": "self.std_dev_dict =", "type": "assigned_variable", "loc": [630, 630], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "vector": [14, 2, 0.493, 0.0008, 2, 0.17, 0.1739, 238, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.std_dev_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.std_dev_dict = std_dev_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L631_C8", "label": "self.noise_dev_dict =", "type": "assigned_variable", "loc": [631, 631], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "vector": [14, 2, 0.4937, 0.0008, 2, 0.17, 0.2174, 122, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.noise_dev_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.noise_dev_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L632_C8", "label": "self.contingency =", "type": "assigned_variable", "loc": [632, 632], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "vector": [14, 2, 0.4945, 0.0008, 2, 0.17, 0.2609, 701, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.contingency", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.contingency = contingency"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L633_C8", "label": "self.window_size =", "type": "assigned_variable", "loc": [633, 633], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "vector": [14, 2, 0.4953, 0.0008, 2, 0.17, 0.3043, 991, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.window_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.window_size = window_size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L634_C8", "label": "self.current_zeros =", "type": "assigned_variable", "loc": [634, 634], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "vector": [14, 2, 0.4961, 0.0008, 2, 0.17, 0.3478, 732, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.current_zeros", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_zeros = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L635_C8", "label": "self.transform_dict =", "type": "assigned_variable", "loc": [635, 635], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "vector": [14, 2, 0.4969, 0.0008, 2, 0.17, 0.3913, 708, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.transform_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.transform_dict = transform_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L636_C8", "label": "self.tol_thresh_dict =", "type": "assigned_variable", "loc": [636, 636], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "vector": [14, 2, 0.4977, 0.0008, 2, 0.17, 0.4348, 710, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tol_thresh_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tol_thresh_dict = tol_thresh_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L637_C8", "label": "self.sampling_rate =", "type": "assigned_variable", "loc": [637, 637], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "vector": [14, 2, 0.4984, 0.0008, 2, 0.17, 0.4783, 214, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.sampling_rate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.sampling_rate = sampling_rate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L638_C8", "label": "self.verbose =", "type": "assigned_variable", "loc": [638, 638], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "vector": [14, 2, 0.4992, 0.0008, 2, 0.17, 0.5217, 552, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.verbose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.verbose = verbose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L639_C8", "label": "self.collide =", "type": "assigned_variable", "loc": [639, 639], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "vector": [14, 2, 0.5, 0.0008, 2, 0.17, 0.5652, 122, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.collide", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.collide = collide"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L640_C8", "label": "self.sum_data =", "type": "assigned_variable", "loc": [640, 640], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "vector": [14, 2, 0.5008, 0.0008, 2, 0.17, 0.6087, 605, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.sum_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.sum_data = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L641_C8", "label": "self.cur_pt =", "type": "assigned_variable", "loc": [641, 641], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "vector": [14, 2, 0.5016, 0.0008, 2, 0.17, 0.6522, 983, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.cur_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cur_pt = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L642_C8", "label": "self.failure =", "type": "assigned_variable", "loc": [642, 642], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "vector": [14, 2, 0.5023, 0.0008, 2, 0.17, 0.6957, 81, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.failure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.failure = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L643_C8", "label": "self.dur_timer =", "type": "assigned_variable", "loc": [643, 643], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "vector": [14, 2, 0.5031, 0.0008, 2, 0.17, 0.7391, 750, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.dur_timer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dur_timer = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L644_C8", "label": "self.avg_list =", "type": "assigned_variable", "loc": [644, 644], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "vector": [14, 2, 0.5039, 0.0008, 2, 0.17, 0.7826, 835, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.avg_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.avg_list = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L645_C8", "label": "self.cum_avg =", "type": "assigned_variable", "loc": [645, 645], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "vector": [14, 2, 0.5047, 0.0008, 2, 0.17, 0.8261, 161, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.cum_avg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cum_avg = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L646_C8", "label": "self.c =", "type": "assigned_variable", "loc": [646, 646], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "vector": [14, 2, 0.5055, 0.0008, 2, 0.17, 0.8696, 974, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.c = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L647_C8", "label": "self.locks =", "type": "assigned_variable", "loc": [647, 647], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "vector": [14, 2, 0.5063, 0.0008, 2, 0.17, 0.913, 205, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.locks", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.locks = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L649_C8", "label": "for k", "type": "for", "loc": [649, 654], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "vector": [6, 2, 0.5098, 0.0047, 2, 0.17, 0.9565, 954, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in self.perceptions:\n self.current_data[k] = [None] * window_size\n self.sum_data[k] = None\n self.avg_list[k] = []\n self.c[k] = None\n self.locks[k] = threading.Lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L650_C12", "label": "assign", "type": "assigned_variable", "loc": [650, 650], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L649_C8", "vector": [14, 3, 0.5086, 0.0008, 3, 0.11, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_data[k] = [None] * window_size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L651_C12", "label": "assign", "type": "assigned_variable", "loc": [651, 651], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L649_C8", "vector": [14, 3, 0.5094, 0.0008, 3, 0.11, 0.25, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.sum_data[k] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L652_C12", "label": "assign", "type": "assigned_variable", "loc": [652, 652], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L649_C8", "vector": [14, 3, 0.5102, 0.0008, 3, 0.11, 0.5, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.avg_list[k] = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L653_C12", "label": "assign", "type": "assigned_variable", "loc": [653, 653], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L649_C8", "vector": [14, 3, 0.511, 0.0008, 3, 0.11, 0.75, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.c[k] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L654_C12", "label": " = Lock()", "type": "assigned_variable", "loc": [654, 654], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L649_C8", "vector": [14, 3, 0.5117, 0.0008, 3, 0.11, 1.0, 0, 3, 0, 0, 0, 843, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "Lock", "annotation": ""}, "snippet": " self.locks[k] = threading.Lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L656_C8", "label": "create_max_min()", "type": "expression", "loc": [656, 656], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "vector": [8, 2, 0.5133, 0.0008, 2, 0.17, 1.0, 597, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "create_max_min", "arg_names": [], "import_names": [], "rhs_call_name": "create_max_min", "annotation": ""}, "snippet": " self.create_max_min()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L662_C4", "label": "create_max_min", "type": "function", "loc": [662, 685], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "vector": [2, 1, 0.527, 0.0188, 1, 0.94, 0.5263, 597, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "create_max_min", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create_max_min(self):\n for k in self.models:\n deviation = self.models[k][\"variance\"]\n # noise_deviation = np.sqrt(self.models[k][\"noise_variance\"])\n if self.std_dev_dict is not None and k in self.std_dev_dict:\n std_dev = np.array(self.std_dev_dict[k])\n else:\n std_dev = self.std_dev_default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L663_C8", "label": "for k", "type": "for", "loc": [663, 685], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L662_C4", "vector": [6, 2, 0.5274, 0.018, 2, 0.93, 0.0, 954, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in self.models:\n deviation = self.models[k][\"variance\"]\n # noise_deviation = np.sqrt(self.models[k][\"noise_variance\"])\n if self.std_dev_dict is not None and k in self.std_dev_dict:\n std_dev = np.array(self.std_dev_dict[k])\n else:\n std_dev = self.std_dev_default\n # if self.noise_dev_dict is not None and k in self.noise_dev_dict:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L664_C12", "label": "deviation =", "type": "assigned_variable", "loc": [664, 664], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L663_C8", "vector": [14, 3, 0.5196, 0.0008, 3, 0.85, 0.0, 872, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "deviation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " deviation = self.models[k][\"variance\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L666_C12", "label": "if", "type": "if", "loc": [666, 669], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L663_C8", "vector": [4, 3, 0.5223, 0.0031, 3, 0.85, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.std_dev_dict is not None and k in self.std_dev_dict:\n std_dev = np.array(self.std_dev_dict[k])\n else:\n std_dev = self.std_dev_default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L667_C16", "label": "std_dev = array()", "type": "assigned_variable", "loc": [667, 667], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L666_C12", "vector": [14, 4, 0.5219, 0.0008, 4, 0.13, 0.0, 784, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "std_dev", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " std_dev = np.array(self.std_dev_dict[k])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L669_C16", "label": "std_dev =", "type": "assigned_variable", "loc": [669, 669], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L666_C12", "vector": [14, 4, 0.5235, 0.0008, 4, 0.13, 1.0, 784, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "std_dev", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " std_dev = self.std_dev_default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L674_C12", "label": "if", "type": "if", "loc": [674, 677], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L663_C8", "vector": [4, 3, 0.5286, 0.0031, 3, 0.85, 0.4, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.tol_thresh_dict is not None and k in self.tol_thresh_dict:\n tol_thresh = np.array(self.tol_thresh_dict[k])\n else:\n tol_thresh = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L675_C16", "label": "tol_thresh = array()", "type": "assigned_variable", "loc": [675, 675], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L674_C12", "vector": [14, 4, 0.5282, 0.0008, 4, 0.15, 0.0, 420, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "tol_thresh", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " tol_thresh = np.array(self.tol_thresh_dict[k])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L677_C16", "label": "tol_thresh =", "type": "assigned_variable", "loc": [677, 677], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L674_C12", "vector": [14, 4, 0.5297, 0.0008, 4, 0.15, 1.0, 420, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "tol_thresh", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tol_thresh = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L679_C12", "label": "assign", "type": "assigned_variable", "loc": [679, 679], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L663_C8", "vector": [14, 3, 0.5313, 0.0008, 3, 0.85, 0.6, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.models[k][\"dev\"] = (std_dev * deviation + tol_thresh)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L684_C12", "label": "assign", "type": "assigned_variable", "loc": [684, 684], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L663_C8", "vector": [14, 3, 0.5352, 0.0008, 3, 0.85, 0.8, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.models[k][\"max\"] = self.models[k][\"mean\"] + self.models[k][\"dev\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L685_C12", "label": "assign", "type": "assigned_variable", "loc": [685, 685], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L663_C8", "vector": [14, 3, 0.536, 0.0008, 3, 0.85, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.models[k][\"min\"] = self.models[k][\"mean\"] - self.models[k][\"dev\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "label": "begin_monitoring", "type": "function", "loc": [694, 741], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "vector": [2, 1, 0.5614, 0.0376, 1, 0.94, 0.5789, 794, 0, 17, 0, 0, 0, 0, 6], "semantic": {"name": "begin_monitoring", "arg_names": ["self", "models", "model_zeros", "std_dev_dict", "noise_dev_dict", "duration", "std_dev_default", "noise_dev_default", "tol_thresh_dict", "contingency", "window_size", "current_zeros", "sampling_rate", "only_pressure", "transform_dict", "verbose", "collide"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def begin_monitoring(self, models=None, model_zeros=None,\n std_dev_dict=None, noise_dev_dict=None, duration=None,\n std_dev_default=2.0, noise_dev_default=0.25,\n tol_thresh_dict=None,\n contingency=None, window_size=70, current_zeros=None,\n sampling_rate = 1,\n only_pressure=False,\n transform_dict=None, verbose=True, collide=True):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L702_C8", "label": "if", "type": "if", "loc": [702, 704], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "vector": [4, 2, 0.5501, 0.0023, 2, 0.02, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.active:\n log(\"Perception already active.\")\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L703_C12", "label": "log()", "type": "expression", "loc": [703, 703], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L702_C8", "vector": [8, 3, 0.5501, 0.0008, 3, 0.39, 0.0, 432, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": " log(\"Perception already active.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L704_C12", "label": "return", "type": "return", "loc": [704, 704], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L702_C8", "vector": [13, 3, 0.5509, 0.0008, 3, 0.39, 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_99296:Assign_L705_C8", "label": "self.active =", "type": "assigned_variable", "loc": [705, 705], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "vector": [14, 2, 0.5516, 0.0008, 2, 0.02, 0.0556, 175, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.active", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.active = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L708_C8", "label": "setup_monitoring()", "type": "expression", "loc": [708, 716], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "vector": [8, 2, 0.5571, 0.007, 2, 0.02, 0.1111, 745, 3, 14, 0, 0, 0, 0, 1], "semantic": {"name": "setup_monitoring", "arg_names": [], "import_names": [], "rhs_call_name": "setup_monitoring", "annotation": ""}, "snippet": " self.setup_monitoring(models, \n std_dev_dict=std_dev_dict, noise_dev_dict=noise_dev_dict,\n duration=duration, std_dev_default=std_dev_default, \n noise_dev_default=noise_dev_default, \n tol_thresh_dict=tol_thresh_dict,\n contingency=contingency, window_size=window_size, \n sampling_rate=sampling_rate,\n current_zeros=current_zeros, transform_dict=transform_dict, "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L719_C8", "label": "if", "type": "if", "loc": [719, 720], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "vector": [4, 2, 0.563, 0.0016, 2, 0.02, 0.1667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if model_zeros is not None:\n self.model_zeros = model_zeros"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L720_C12", "label": "self.model_zeros =", "type": "assigned_variable", "loc": [720, 720], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L719_C8", "vector": [14, 3, 0.5634, 0.0008, 3, 0.44, 0.0, 850, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.model_zeros", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.model_zeros = model_zeros"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L721_C8", "label": "self.cur_pt =", "type": "assigned_variable", "loc": [721, 721], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "vector": [14, 2, 0.5642, 0.0008, 2, 0.02, 0.2222, 983, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.cur_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cur_pt = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L722_C8", "label": "self.collision_times =", "type": "assigned_variable", "loc": [722, 722], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "vector": [14, 2, 0.5649, 0.0008, 2, 0.02, 0.2778, 892, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.collision_times", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.collision_times = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L723_C8", "label": "self.collision_sums =", "type": "assigned_variable", "loc": [723, 723], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "vector": [14, 2, 0.5657, 0.0008, 2, 0.02, 0.3333, 155, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.collision_sums", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.collision_sums = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L724_C8", "label": "self.cur_col_time =", "type": "assigned_variable", "loc": [724, 724], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "vector": [14, 2, 0.5665, 0.0008, 2, 0.02, 0.3889, 552, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.cur_col_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cur_col_time = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L725_C8", "label": "self.current_zeros =", "type": "assigned_variable", "loc": [725, 725], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "vector": [14, 2, 0.5673, 0.0008, 2, 0.02, 0.4444, 732, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.current_zeros", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_zeros = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L726_C8", "label": "self.z_sum =", "type": "assigned_variable", "loc": [726, 726], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "vector": [14, 2, 0.5681, 0.0008, 2, 0.02, 0.5, 196, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.z_sum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.z_sum = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L727_C8", "label": "self.z_rsum =", "type": "assigned_variable", "loc": [727, 727], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "vector": [14, 2, 0.5689, 0.0008, 2, 0.02, 0.5556, 244, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.z_rsum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.z_rsum = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L728_C8", "label": "self.z_list =", "type": "assigned_variable", "loc": [728, 728], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "vector": [14, 2, 0.5696, 0.0008, 2, 0.02, 0.6111, 772, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.z_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.z_list = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L729_C8", "label": "self.min_prob =", "type": "assigned_variable", "loc": [729, 729], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "vector": [14, 2, 0.5704, 0.0008, 2, 0.02, 0.6667, 798, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.min_prob", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.min_prob = 100000.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L730_C8", "label": "self.cur_mals =", "type": "assigned_variable", "loc": [730, 730], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "vector": [14, 2, 0.5712, 0.0008, 2, 0.02, 0.7222, 30, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.cur_mals", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cur_mals = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L731_C8", "label": "self.mals =", "type": "assigned_variable", "loc": [731, 731], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "vector": [14, 2, 0.572, 0.0008, 2, 0.02, 0.7778, 443, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.mals", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mals = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L732_C8", "label": "self.only_pressure =", "type": "assigned_variable", "loc": [732, 732], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "vector": [14, 2, 0.5728, 0.0008, 2, 0.02, 0.8333, 287, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.only_pressure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.only_pressure = only_pressure"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L734_C8", "label": "self.monitor = RateCaller()", "type": "assigned_variable", "loc": [734, 734], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "vector": [14, 2, 0.5743, 0.0008, 2, 0.02, 0.8889, 640, 3, 2, 0, 0, 67, 10, 1], "semantic": {"name": "self.monitor", "arg_names": [], "import_names": [], "rhs_call_name": "RateCaller", "annotation": ""}, "snippet": " self.monitor = RateCaller(self._monitor_data, self.rate * self.sampling_rate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L735_C8", "label": "run()", "type": "expression", "loc": [735, 735], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "vector": [8, 2, 0.5751, 0.0008, 2, 0.02, 0.9444, 679, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " self.monitor.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L739_C8", "label": "if", "type": "if", "loc": [739, 741], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "vector": [4, 2, 0.579, 0.0023, 2, 0.02, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not duration is None:\n self.dur_timer = threading.Timer(self.end_monitoring, duration)\n self.dur_timer.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L740_C12", "label": "self.dur_timer = Timer()", "type": "assigned_variable", "loc": [740, 740], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L739_C8", "vector": [14, 3, 0.579, 0.0008, 3, 0.17, 0.0, 750, 3, 2, 0, 0, 771, 10, 1], "semantic": {"name": "self.dur_timer", "arg_names": [], "import_names": [], "rhs_call_name": "Timer", "annotation": ""}, "snippet": " self.dur_timer = threading.Timer(self.end_monitoring, duration)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L741_C12", "label": "start()", "type": "expression", "loc": [741, 741], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L739_C8", "vector": [8, 3, 0.5798, 0.0008, 3, 0.17, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.dur_timer.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L743_C4", "label": "_stable_summer", "type": "function", "loc": [743, 760], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "vector": [2, 1, 0.588, 0.0141, 1, 0.94, 0.6316, 149, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "_stable_summer", "arg_names": ["self", "percept", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _stable_summer(self, percept, data):\n # kahanSum\n k = percept\n # if percept not in self.sumcalls:\n # self.sumcalls[percept] = 1\n # self.sumsave[percept] = []\n # else:\n # self.sumcalls[percept] += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L745_C8", "label": "k =", "type": "assigned_variable", "loc": [745, 745], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L743_C4", "vector": [14, 2, 0.5829, 0.0008, 2, 0.18, 0.0, 954, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " k = percept"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L752_C8", "label": "if", "type": "if", "loc": [752, 753], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L743_C4", "vector": [4, 2, 0.5888, 0.0016, 2, 0.18, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.c[k] is None:\n self.c[k] = np.array([0.]*len(data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L753_C12", "label": " = array()", "type": "assigned_variable", "loc": [753, 753], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L752_C8", "vector": [14, 3, 0.5892, 0.0008, 3, 0.5, 0.0, 0, 3, 1, 0, 0, 80, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " self.c[k] = np.array([0.]*len(data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L754_C8", "label": "if", "type": "if", "loc": [754, 760], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L743_C4", "vector": [4, 2, 0.5923, 0.0055, 2, 0.18, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.sum_data[k] is None:\n self.sum_data[k] = np.copy(data)\n else:\n y = data - self.c[k]\n t = self.sum_data[k] + y\n self.c[k] = (t - self.sum_data[k]) - y\n self.sum_data[k] = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L755_C12", "label": " = copy()", "type": "assigned_variable", "loc": [755, 755], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L754_C8", "vector": [14, 3, 0.5908, 0.0008, 3, 0.85, 0.0, 0, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.sum_data[k] = np.copy(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L757_C12", "label": "y =", "type": "assigned_variable", "loc": [757, 757], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L754_C8", "vector": [14, 3, 0.5923, 0.0008, 3, 0.85, 0.25, 304, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = data - self.c[k]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L758_C12", "label": "t =", "type": "assigned_variable", "loc": [758, 758], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L754_C8", "vector": [14, 3, 0.5931, 0.0008, 3, 0.85, 0.5, 15, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t = self.sum_data[k] + y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L759_C12", "label": "assign", "type": "assigned_variable", "loc": [759, 759], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L754_C8", "vector": [14, 3, 0.5939, 0.0008, 3, 0.85, 0.75, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.c[k] = (t - self.sum_data[k]) - y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L760_C12", "label": "assign", "type": "assigned_variable", "loc": [760, 760], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L754_C8", "vector": [14, 3, 0.5947, 0.0008, 3, 0.85, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.sum_data[k] = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L764_C4", "label": "_monitor_data", "type": "function", "loc": [764, 843], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "vector": [2, 1, 0.6287, 0.0626, 1, 0.94, 0.6842, 896, 0, 1, 0, 0, 0, 0, 17], "semantic": {"name": "_monitor_data", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _monitor_data(self):\n avg_dict = {}\n sttime = rospy.Time.now().to_sec()\n for k in self.perceptions:\n # update the running sum\n add_data = self.perceptions[k]()[1]\n\n # apply necessary transforms"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L765_C8", "label": "avg_dict =", "type": "assigned_variable", "loc": [765, 765], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L764_C4", "vector": [14, 2, 0.5986, 0.0008, 2, 0.17, 0.0, 307, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "avg_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " avg_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L766_C8", "label": "sttime = to_sec()", "type": "assigned_variable", "loc": [766, 766], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L764_C4", "vector": [14, 2, 0.5994, 0.0008, 2, 0.17, 0.2, 574, 3, 0, 0, 0, 750, 10, 2], "semantic": {"name": "sttime", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " sttime = rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L767_C8", "label": "for k", "type": "for", "loc": [767, 824], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L764_C4", "vector": [6, 2, 0.6225, 0.0454, 2, 0.17, 0.4, 954, 7, 0, 0, 0, 0, 0, 5], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in self.perceptions:\n # update the running sum\n add_data = self.perceptions[k]()[1]\n\n # apply necessary transforms\n # if self.transform_dict is not None:\n # if k in self.transform_dict:\n # add_data = self.transform_dict[k](add_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L769_C12", "label": "add_data =", "type": "assigned_variable", "loc": [769, 769], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L767_C8", "vector": [14, 3, 0.6017, 0.0008, 3, 0.79, 0.0, 954, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "add_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " add_data = self.perceptions[k]()[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L776_C12", "label": "_stable_summer()", "type": "expression", "loc": [776, 776], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L767_C8", "vector": [8, 3, 0.6072, 0.0008, 3, 0.79, 0.3333, 149, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_stable_summer", "arg_names": [], "import_names": [], "rhs_call_name": "_stable_summer", "annotation": ""}, "snippet": " self._stable_summer(k, add_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L779_C12", "label": "if", "type": "if", "loc": [779, 822], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L767_C8", "vector": [4, 3, 0.6264, 0.0344, 3, 0.79, 0.6667, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.cur_pt >= self.window_size: #self.current_data[k].full():\n # self.prev_sum = copy.deepcopy(self.sum_data)\n avg_dict[k] = self.sum_data[k] / self.window_size\n if not k in self.current_zeros:\n if not self.only_pressure:\n mean = np.array(self.models[k][\"mean\"][self.cur_pt * self.sampling_rate])\n else:\n mean = np.array(self.models[k][\"mean\"][0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L781_C16", "label": "assign", "type": "assigned_variable", "loc": [781, 781], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L779_C12", "vector": [14, 4, 0.6111, 0.0008, 4, 0.4, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " avg_dict[k] = self.sum_data[k] / self.window_size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L782_C16", "label": "if", "type": "if", "loc": [782, 787], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L779_C12", "vector": [4, 4, 0.6138, 0.0047, 4, 0.4, 0.3333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not k in self.current_zeros:\n if not self.only_pressure:\n mean = np.array(self.models[k][\"mean\"][self.cur_pt * self.sampling_rate])\n else:\n mean = np.array(self.models[k][\"mean\"][0])\n self.current_zeros[k] = mean - avg_dict[k]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L783_C20", "label": "if", "type": "if", "loc": [783, 786], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L782_C16", "vector": [4, 5, 0.6138, 0.0031, 5, 0.31, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.only_pressure:\n mean = np.array(self.models[k][\"mean\"][self.cur_pt * self.sampling_rate])\n else:\n mean = np.array(self.models[k][\"mean\"][0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L784_C24", "label": "mean = array()", "type": "assigned_variable", "loc": [784, 784], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L783_C20", "vector": [14, 6, 0.6135, 0.0008, 6, 0.95, 0.0, 856, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "mean", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " mean = np.array(self.models[k][\"mean\"][self.cur_pt * self.sampling_rate])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L786_C24", "label": "mean = array()", "type": "assigned_variable", "loc": [786, 786], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L783_C20", "vector": [14, 6, 0.615, 0.0008, 6, 0.95, 1.0, 856, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "mean", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " mean = np.array(self.models[k][\"mean\"][0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L787_C20", "label": "assign", "type": "assigned_variable", "loc": [787, 787], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L782_C16", "vector": [14, 5, 0.6158, 0.0008, 5, 0.31, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_zeros[k] = mean - avg_dict[k]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L821_C16", "label": "rem_data =", "type": "assigned_variable", "loc": [821, 821], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L779_C12", "vector": [14, 4, 0.6424, 0.0008, 4, 0.4, 0.6667, 297, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rem_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rem_data = self.current_data[k][self.cur_pt % self.window_size]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L822_C16", "label": "_stable_summer()", "type": "expression", "loc": [822, 822], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L779_C12", "vector": [8, 4, 0.6432, 0.0008, 4, 0.4, 1.0, 149, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_stable_summer", "arg_names": [], "import_names": [], "rhs_call_name": "_stable_summer", "annotation": ""}, "snippet": " self._stable_summer(k, -rem_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L824_C12", "label": "assign", "type": "assigned_variable", "loc": [824, 824], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L767_C8", "vector": [14, 3, 0.6448, 0.0008, 3, 0.79, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_data[k][self.cur_pt % self.window_size] = add_data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L826_C8", "label": "if", "type": "if", "loc": [826, 834], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L764_C4", "vector": [4, 2, 0.6495, 0.007, 2, 0.17, 0.6, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.cur_pt >= self.window_size: #self.current_data[k].full():\n collision_detected = self.collision_detect(avg_dict)\n if self.collide and collision_detected:\n print(\"collision reported\")\n self.failure = True\n if not self.contingency is None:\n self.contingency()\n self.monitor.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L827_C12", "label": "collision_detected = collision_detect()", "type": "assigned_variable", "loc": [827, 827], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L826_C8", "vector": [14, 3, 0.6471, 0.0008, 3, 0.78, 0.0, 215, 3, 1, 0, 0, 489, 10, 1], "semantic": {"name": "collision_detected", "arg_names": [], "import_names": [], "rhs_call_name": "collision_detect", "annotation": ""}, "snippet": " collision_detected = self.collision_detect(avg_dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L828_C12", "label": "if", "type": "if", "loc": [828, 834], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L826_C8", "vector": [4, 3, 0.6502, 0.0055, 3, 0.78, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.collide and collision_detected:\n print(\"collision reported\")\n self.failure = True\n if not self.contingency is None:\n self.contingency()\n self.monitor.stop()\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L829_C16", "label": "print()", "type": "expression", "loc": [829, 829], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L828_C12", "vector": [8, 4, 0.6487, 0.0008, 4, 0.36, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"collision reported\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L830_C16", "label": "self.failure =", "type": "assigned_variable", "loc": [830, 830], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L828_C12", "vector": [14, 4, 0.6495, 0.0008, 4, 0.36, 0.25, 81, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.failure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.failure = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L831_C16", "label": "if", "type": "if", "loc": [831, 832], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L828_C12", "vector": [4, 4, 0.6506, 0.0016, 4, 0.36, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.contingency is None:\n self.contingency()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L832_C20", "label": "contingency()", "type": "expression", "loc": [832, 832], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L831_C16", "vector": [8, 5, 0.651, 0.0008, 5, 0.87, 0.0, 16, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "contingency", "arg_names": [], "import_names": [], "rhs_call_name": "contingency", "annotation": ""}, "snippet": " self.contingency()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L833_C16", "label": "stop()", "type": "expression", "loc": [833, 833], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L828_C12", "vector": [8, 4, 0.6518, 0.0008, 4, 0.36, 0.75, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " self.monitor.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L834_C16", "label": "return", "type": "return", "loc": [834, 834], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L828_C12", "vector": [13, 4, 0.6526, 0.0008, 4, 0.36, 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_99296:If_L839_C8", "label": "if", "type": "if", "loc": [839, 842], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L764_C4", "vector": [4, 2, 0.6577, 0.0031, 2, 0.17, 0.8, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.only_pressure:\n if self.cur_pt * self.sampling_rate >= 1.00 * len(self.models[self.models.keys()[0]][\"mean\"]):\n print(\"ending early:\", self.cur_pt * self.sampling_rate)\n self.end_monitoring()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L840_C12", "label": "if", "type": "if", "loc": [840, 842], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L839_C8", "vector": [4, 3, 0.6581, 0.0023, 3, 0.19, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.cur_pt * self.sampling_rate >= 1.00 * len(self.models[self.models.keys()[0]][\"mean\"]):\n print(\"ending early:\", self.cur_pt * self.sampling_rate)\n self.end_monitoring()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L841_C16", "label": "print()", "type": "expression", "loc": [841, 841], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L840_C12", "vector": [8, 4, 0.6581, 0.0008, 4, 0.95, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"ending early:\", self.cur_pt * self.sampling_rate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L842_C16", "label": "end_monitoring()", "type": "expression", "loc": [842, 842], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L840_C12", "vector": [8, 4, 0.6588, 0.0008, 4, 0.95, 1.0, 790, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "end_monitoring", "arg_names": [], "import_names": [], "rhs_call_name": "end_monitoring", "annotation": ""}, "snippet": " self.end_monitoring()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L843_C8", "label": "endtime = to_sec()", "type": "assigned_variable", "loc": [843, 843], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L764_C4", "vector": [14, 2, 0.6596, 0.0008, 2, 0.17, 1.0, 975, 3, 0, 0, 0, 750, 10, 2], "semantic": {"name": "endtime", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " endtime = rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "label": "end_monitoring", "type": "function", "loc": [853, 877], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "vector": [2, 1, 0.6768, 0.0196, 1, 0.94, 0.7368, 790, 0, 1, 1, 0, 0, 0, 10], "semantic": {"name": "end_monitoring", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_monitoring(self):\n if not self.active:\n log(\"Nothing to stop.\")\n return self.avg_list \n\n print(\"-------------------------\")\n print(\"z averages:\")\n self.z_avg = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L854_C8", "label": "if", "type": "if", "loc": [854, 856], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "vector": [4, 2, 0.669, 0.0023, 2, 0.17, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.active:\n log(\"Nothing to stop.\")\n return self.avg_list "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L855_C12", "label": "log()", "type": "expression", "loc": [855, 855], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L854_C8", "vector": [8, 3, 0.669, 0.0008, 3, 0.51, 0.0, 432, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": " log(\"Nothing to stop.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L856_C12", "label": "return", "type": "return", "loc": [856, 856], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L854_C8", "vector": [13, 3, 0.6698, 0.0008, 3, 0.51, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.avg_list "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L858_C8", "label": "print()", "type": "expression", "loc": [858, 858], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "vector": [8, 2, 0.6714, 0.0008, 2, 0.17, 0.0833, 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_99296:Expr_L859_C8", "label": "print()", "type": "expression", "loc": [859, 859], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "vector": [8, 2, 0.6721, 0.0008, 2, 0.17, 0.1667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"z averages:\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L860_C8", "label": "self.z_avg =", "type": "assigned_variable", "loc": [860, 860], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "vector": [14, 2, 0.6729, 0.0008, 2, 0.17, 0.25, 446, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.z_avg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.z_avg = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L861_C8", "label": "for k", "type": "for", "loc": [861, 863], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "vector": [6, 2, 0.6745, 0.0023, 2, 0.17, 0.3333, 954, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in self.z_sum:\n self.z_avg[k] = self.z_sum[k] / self.cur_pt\n print(k, \":\", self.z_avg[k])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L862_C12", "label": "assign", "type": "assigned_variable", "loc": [862, 862], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L861_C8", "vector": [14, 3, 0.6745, 0.0008, 3, 0.86, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.z_avg[k] = self.z_sum[k] / self.cur_pt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L863_C12", "label": "print()", "type": "expression", "loc": [863, 863], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L861_C8", "vector": [8, 3, 0.6753, 0.0008, 3, 0.86, 1.0, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(k, \":\", self.z_avg[k])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L864_C8", "label": "print()", "type": "expression", "loc": [864, 864], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "vector": [8, 2, 0.6761, 0.0008, 2, 0.17, 0.4167, 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_99296:Expr_L865_C8", "label": "print()", "type": "expression", "loc": [865, 865], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "vector": [8, 2, 0.6768, 0.0008, 2, 0.17, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"MINIMUM PROB\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L866_C8", "label": "print()", "type": "expression", "loc": [866, 866], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "vector": [8, 2, 0.6776, 0.0008, 2, 0.17, 0.5833, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(self.min_prob)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L867_C8", "label": "print()", "type": "expression", "loc": [867, 867], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "vector": [8, 2, 0.6784, 0.0008, 2, 0.17, 0.6667, 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_99296:Expr_L871_C8", "label": "stop()", "type": "expression", "loc": [871, 871], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "vector": [8, 2, 0.6815, 0.0008, 2, 0.17, 0.75, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " self.monitor.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L872_C8", "label": "if", "type": "if", "loc": [872, 874], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "vector": [4, 2, 0.6831, 0.0023, 2, 0.17, 0.8333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.dur_timer is not None:\n self.dur_timer.cancel()\n self.dur_timer = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L873_C12", "label": "cancel()", "type": "expression", "loc": [873, 873], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L872_C8", "vector": [8, 3, 0.6831, 0.0008, 3, 0.82, 0.0, 732, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel", "arg_names": [], "import_names": [], "rhs_call_name": "cancel", "annotation": ""}, "snippet": " self.dur_timer.cancel()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L874_C12", "label": "self.dur_timer =", "type": "assigned_variable", "loc": [874, 874], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L872_C8", "vector": [14, 3, 0.6839, 0.0008, 3, 0.82, 1.0, 750, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.dur_timer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dur_timer = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L876_C8", "label": "self.active =", "type": "assigned_variable", "loc": [876, 876], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "vector": [14, 2, 0.6854, 0.0008, 2, 0.17, 0.9167, 175, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.active", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.active = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L877_C8", "label": "return", "type": "return", "loc": [877, 877], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "vector": [13, 2, 0.6862, 0.0008, 2, 0.17, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.avg_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L882_C4", "label": "collision_detect", "type": "function", "loc": [882, 918], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "vector": [2, 1, 0.7042, 0.029, 1, 0.94, 0.7895, 489, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "collision_detect", "arg_names": ["self", "avg_dict"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def collision_detect(self, avg_dict):\n # is_outside_range_dict = {}\n z = {}\n mal_sum = 0.\n for k in avg_dict:\n\n # This is the monitoring equation\n # is_outside_range_dict[k] = ((avg_dict[k] > self.models[k][\"max\"][self.cur_pt * self.sampling_rate]) +"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L884_C8", "label": "z =", "type": "assigned_variable", "loc": [884, 884], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L882_C4", "vector": [14, 2, 0.6917, 0.0008, 2, 0.81, 0.0, 859, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L885_C8", "label": "mal_sum =", "type": "assigned_variable", "loc": [885, 885], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L882_C4", "vector": [14, 2, 0.6925, 0.0008, 2, 0.81, 0.25, 981, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "mal_sum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mal_sum = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L886_C8", "label": "for k", "type": "for", "loc": [886, 907], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L882_C4", "vector": [6, 2, 0.7015, 0.0172, 2, 0.81, 0.5, 954, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in avg_dict:\n\n # This is the monitoring equation\n # is_outside_range_dict[k] = ((avg_dict[k] > self.models[k][\"max\"][self.cur_pt * self.sampling_rate]) +\n # (avg_dict[k] < self.models[k][\"min\"][self.cur_pt * self.sampling_rate]))\n # Uses both variance from various grasp tries and general noise variance\n if not self.only_pressure:\n mean = self.models[k][\"mean\"][self.cur_pt * self.sampling_rate]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L892_C12", "label": "if", "type": "if", "loc": [892, 897], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L886_C8", "vector": [4, 3, 0.6999, 0.0047, 3, 0.09, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.only_pressure:\n mean = self.models[k][\"mean\"][self.cur_pt * self.sampling_rate]\n dev = self.models[k][\"dev\"][self.cur_pt * self.sampling_rate]\n else:\n mean = self.models[k][\"mean\"][0]\n dev = self.models[k][\"dev\"][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L893_C16", "label": "mean =", "type": "assigned_variable", "loc": [893, 893], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L892_C12", "vector": [14, 4, 0.6987, 0.0008, 4, 0.58, 0.0, 856, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mean", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mean = self.models[k][\"mean\"][self.cur_pt * self.sampling_rate]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L894_C16", "label": "dev =", "type": "assigned_variable", "loc": [894, 894], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L892_C12", "vector": [14, 4, 0.6995, 0.0008, 4, 0.58, 0.3333, 680, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dev", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dev = self.models[k][\"dev\"][self.cur_pt * self.sampling_rate]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L896_C16", "label": "mean =", "type": "assigned_variable", "loc": [896, 896], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L892_C12", "vector": [14, 4, 0.7011, 0.0008, 4, 0.58, 0.6667, 856, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mean", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mean = self.models[k][\"mean\"][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L897_C16", "label": "dev =", "type": "assigned_variable", "loc": [897, 897], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L892_C12", "vector": [14, 4, 0.7019, 0.0008, 4, 0.58, 1.0, 680, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dev", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dev = self.models[k][\"dev\"][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L899_C12", "label": "cur_mal =", "type": "assigned_variable", "loc": [899, 899], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L886_C8", "vector": [14, 3, 0.7034, 0.0008, 3, 0.09, 0.25, 12, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cur_mal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cur_mal = ((avg_dict[k] - mean) / dev) ** 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L900_C12", "label": "assign", "type": "assigned_variable", "loc": [900, 900], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L886_C8", "vector": [14, 3, 0.7042, 0.0008, 3, 0.09, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cur_mals[k] = cur_mal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L902_C12", "label": "assign", "type": "assigned_variable", "loc": [902, 902], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L886_C8", "vector": [14, 3, 0.7058, 0.0008, 3, 0.09, 0.75, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z[k] = np.fabs(avg_dict[k] - mean) / dev "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L904_C12", "label": "if", "type": "if", "loc": [904, 907], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L886_C8", "vector": [4, 3, 0.7085, 0.0031, 3, 0.09, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not k in self.z_sum:\n self.z_sum[k] = np.copy(z[k])\n else:\n self.z_sum[k] += z[k]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L905_C16", "label": " = copy()", "type": "assigned_variable", "loc": [905, 905], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L904_C12", "vector": [14, 4, 0.7081, 0.0008, 4, 0.47, 0.0, 0, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.z_sum[k] = np.copy(z[k])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L915_C8", "label": "collision_detected = collision_filtering()", "type": "assigned_variable", "loc": [915, 915], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L882_C4", "vector": [14, 2, 0.716, 0.0008, 2, 0.81, 0.75, 215, 3, 1, 0, 0, 818, 10, 1], "semantic": {"name": "collision_detected", "arg_names": [], "import_names": [], "rhs_call_name": "collision_filtering", "annotation": ""}, "snippet": " collision_detected = self.collision_filtering(z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L918_C8", "label": "return", "type": "return", "loc": [918, 918], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L882_C4", "vector": [13, 2, 0.7183, 0.0008, 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 collision_detected"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L920_C4", "label": "collision_filtering_mal", "type": "function", "loc": [920, 937], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "vector": [2, 1, 0.7265, 0.0141, 1, 0.94, 0.8421, 979, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "collision_filtering_mal", "arg_names": ["self", "mal"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def collision_filtering_mal(self, mal):\n prob = 1.\n TIME_WINDOW = 4\n if self.mals is None:\n self.mals = np.array([0.] * TIME_WINDOW)\n self.mals[self.cur_pt % TIME_WINDOW] = mal\n\n if self.cur_pt < TIME_WINDOW:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L921_C8", "label": "prob =", "type": "assigned_variable", "loc": [921, 921], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L920_C4", "vector": [14, 2, 0.7207, 0.0008, 2, 0.7, 0.0, 24, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "prob", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prob = 1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L922_C8", "label": "TIME_WINDOW =", "type": "assigned_variable", "loc": [922, 922], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L920_C4", "vector": [14, 2, 0.7214, 0.0008, 2, 0.7, 0.125, 612, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "TIME_WINDOW", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " TIME_WINDOW = 4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L923_C8", "label": "if", "type": "if", "loc": [923, 924], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L920_C4", "vector": [4, 2, 0.7226, 0.0016, 2, 0.7, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.mals is None:\n self.mals = np.array([0.] * TIME_WINDOW)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L924_C12", "label": "self.mals = array()", "type": "assigned_variable", "loc": [924, 924], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L923_C8", "vector": [14, 3, 0.723, 0.0008, 3, 0.47, 0.0, 443, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "self.mals", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " self.mals = np.array([0.] * TIME_WINDOW)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L925_C8", "label": "assign", "type": "assigned_variable", "loc": [925, 925], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L920_C4", "vector": [14, 2, 0.7238, 0.0008, 2, 0.7, 0.375, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mals[self.cur_pt % TIME_WINDOW] = mal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L927_C8", "label": "if", "type": "if", "loc": [927, 928], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L920_C4", "vector": [4, 2, 0.7257, 0.0016, 2, 0.7, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.cur_pt < TIME_WINDOW:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L928_C12", "label": "return", "type": "return", "loc": [928, 928], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L927_C8", "vector": [13, 3, 0.7261, 0.0008, 3, 0.94, 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_99296:Assign_L929_C8", "label": "mal_avg = reduce()", "type": "assigned_variable", "loc": [929, 929], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L920_C4", "vector": [14, 2, 0.7269, 0.0008, 2, 0.7, 0.625, 135, 3, 1, 0, 0, 622, 10, 1], "semantic": {"name": "mal_avg", "arg_names": [], "import_names": [], "rhs_call_name": "reduce", "annotation": ""}, "snippet": " mal_avg = np.add.reduce(self.mals / TIME_WINDOW)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L931_C8", "label": "MAL_THRESH =", "type": "assigned_variable", "loc": [931, 931], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L920_C4", "vector": [14, 2, 0.7285, 0.0008, 2, 0.7, 0.75, 398, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "MAL_THRESH", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " MAL_THRESH = 8.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L932_C8", "label": "if", "type": "if", "loc": [932, 936], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L920_C4", "vector": [4, 2, 0.7308, 0.0039, 2, 0.7, 0.875, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mal_avg > MAL_THRESH:\n print(\"Collision with mal dist:\", mal_avg)\n for k in self.cur_mals:\n print(k, self.cur_mals[k])\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L933_C12", "label": "print()", "type": "expression", "loc": [933, 933], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L932_C8", "vector": [8, 3, 0.73, 0.0008, 3, 0.08, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Collision with mal dist:\", mal_avg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L934_C12", "label": "for k", "type": "for", "loc": [934, 935], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L932_C8", "vector": [6, 3, 0.7312, 0.0016, 3, 0.08, 0.5, 954, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in self.cur_mals:\n print(k, self.cur_mals[k])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L935_C16", "label": "print()", "type": "expression", "loc": [935, 935], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L934_C12", "vector": [8, 4, 0.7316, 0.0008, 4, 0.23, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(k, self.cur_mals[k])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L936_C12", "label": "return", "type": "return", "loc": [936, 936], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L932_C8", "vector": [13, 3, 0.7324, 0.0008, 3, 0.08, 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_99296:Return_L937_C8", "label": "return", "type": "return", "loc": [937, 937], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L920_C4", "vector": [13, 2, 0.7332, 0.0008, 2, 0.7, 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_99296:FunctionDef_L939_C4", "label": "collision_filtering", "type": "function", "loc": [939, 983], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "vector": [2, 1, 0.752, 0.0352, 1, 0.94, 0.8947, 818, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "collision_filtering", "arg_names": ["self", "z"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def collision_filtering(self, z):\n prob = 1.\n TIME_WINDOW = 4\n for k in z:\n if not k in self.z_rsum:\n self.z_rsum[k] = np.copy(z[k])\n self.z_list[k] = [np.array([0.]*len(z[k]))] * TIME_WINDOW\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L940_C8", "label": "prob =", "type": "assigned_variable", "loc": [940, 940], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L939_C4", "vector": [14, 2, 0.7355, 0.0008, 2, 0.81, 0.0, 24, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "prob", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prob = 1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L941_C8", "label": "TIME_WINDOW =", "type": "assigned_variable", "loc": [941, 941], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L939_C4", "vector": [14, 2, 0.7363, 0.0008, 2, 0.81, 0.125, 612, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "TIME_WINDOW", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " TIME_WINDOW = 4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L942_C8", "label": "for k", "type": "for", "loc": [942, 953], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L939_C4", "vector": [6, 2, 0.7414, 0.0094, 2, 0.81, 0.25, 954, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in z:\n if not k in self.z_rsum:\n self.z_rsum[k] = np.copy(z[k])\n self.z_list[k] = [np.array([0.]*len(z[k]))] * TIME_WINDOW\n else:\n self.z_rsum[k] += z[k]\n \n self.z_rsum[k] -= self.z_list[k][self.cur_pt % TIME_WINDOW]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L943_C12", "label": "if", "type": "if", "loc": [943, 947], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L942_C8", "vector": [4, 3, 0.7394, 0.0039, 3, 0.2, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not k in self.z_rsum:\n self.z_rsum[k] = np.copy(z[k])\n self.z_list[k] = [np.array([0.]*len(z[k]))] * TIME_WINDOW\n else:\n self.z_rsum[k] += z[k]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L944_C16", "label": " = copy()", "type": "assigned_variable", "loc": [944, 944], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L943_C12", "vector": [14, 4, 0.7387, 0.0008, 4, 0.36, 0.0, 0, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.z_rsum[k] = np.copy(z[k])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L945_C16", "label": "assign", "type": "assigned_variable", "loc": [945, 945], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L943_C12", "vector": [14, 4, 0.7394, 0.0008, 4, 0.36, 1.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.z_list[k] = [np.array([0.]*len(z[k]))] * TIME_WINDOW"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L950_C12", "label": "assign", "type": "assigned_variable", "loc": [950, 950], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L942_C8", "vector": [14, 3, 0.7433, 0.0008, 3, 0.2, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.z_list[k][self.cur_pt % TIME_WINDOW] = z[k]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L956_C8", "label": "if", "type": "if", "loc": [956, 957], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L939_C4", "vector": [4, 2, 0.7484, 0.0016, 2, 0.81, 0.375, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.cur_pt < TIME_WINDOW:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L957_C12", "label": "return", "type": "return", "loc": [957, 957], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L956_C8", "vector": [13, 3, 0.7488, 0.0008, 3, 0.13, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L959_C8", "label": "if", "type": "if", "loc": [959, 960], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L939_C4", "vector": [4, 2, 0.7508, 0.0016, 2, 0.81, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if prob < self.min_prob:\n self.min_prob = prob"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L960_C12", "label": "self.min_prob =", "type": "assigned_variable", "loc": [960, 960], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L959_C8", "vector": [14, 3, 0.7512, 0.0008, 3, 0.71, 0.0, 798, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.min_prob", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.min_prob = prob"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L963_C8", "label": "if", "type": "if", "loc": [963, 968], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L939_C4", "vector": [4, 2, 0.7555, 0.0047, 2, 0.81, 0.625, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.only_pressure:\n # 4e-7 50/50\n CONFIDENCE = 2.0e-6\n else:\n # pressure only confidence\n CONFIDENCE = 1.e-5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L965_C12", "label": "CONFIDENCE =", "type": "assigned_variable", "loc": [965, 965], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L963_C8", "vector": [14, 3, 0.7551, 0.0008, 3, 0.25, 0.0, 778, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "CONFIDENCE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " CONFIDENCE = 2.0e-6"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L968_C12", "label": "CONFIDENCE =", "type": "assigned_variable", "loc": [968, 968], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L963_C8", "vector": [14, 3, 0.7574, 0.0008, 3, 0.25, 1.0, 778, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "CONFIDENCE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " CONFIDENCE = 1.e-5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L969_C8", "label": "if", "type": "if", "loc": [969, 970], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L939_C4", "vector": [4, 2, 0.7586, 0.0016, 2, 0.81, 0.75, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.cur_pt % 20 == 0:\n print(\"Current pt:\", self.cur_pt, \", probability:\", prob)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L970_C12", "label": "print()", "type": "expression", "loc": [970, 970], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L969_C8", "vector": [8, 3, 0.759, 0.0008, 3, 0.35, 0.0, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Current pt:\", self.cur_pt, \", probability:\", prob)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L971_C8", "label": "if", "type": "if", "loc": [971, 974], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L939_C4", "vector": [4, 2, 0.761, 0.0031, 2, 0.81, 0.875, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if prob < CONFIDENCE:\n print(\"probability:\", prob)\n print(\"collision returned\")\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L972_C12", "label": "print()", "type": "expression", "loc": [972, 972], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L971_C8", "vector": [8, 3, 0.7606, 0.0008, 3, 0.6, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"probability:\", prob)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L973_C12", "label": "print()", "type": "expression", "loc": [973, 973], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L971_C8", "vector": [8, 3, 0.7613, 0.0008, 3, 0.6, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"collision returned\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L974_C12", "label": "return", "type": "return", "loc": [974, 974], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L971_C8", "vector": [13, 3, 0.7621, 0.0008, 3, 0.6, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L983_C8", "label": "return", "type": "return", "loc": [983, 983], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L939_C4", "vector": [13, 2, 0.7692, 0.0008, 2, 0.81, 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_99296:FunctionDef_L1060_C4", "label": "simulate_monitoring", "type": "function", "loc": [1060, 1086], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "vector": [2, 1, 0.8396, 0.0211, 1, 0.94, 0.9474, 330, 0, 16, 1, 0, 0, 0, 5], "semantic": {"name": "simulate_monitoring", "arg_names": ["self", "monitor_data", "models", "model_zeros", "std_dev_dict", "noise_dev_dict", "duration", "std_dev_default", "noise_dev_default", "tol_thresh_dict", "contingency", "window_size", "current_zeros", "transform_dict", "verbose", "collide"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def simulate_monitoring(self, monitor_data, models=None, model_zeros=None,\n std_dev_dict=None, noise_dev_dict=None, \n duration=None,\n std_dev_default=2.0, noise_dev_default=0.25,\n tol_thresh_dict=None,\n contingency=None, window_size=70, current_zeros=None,\n transform_dict=None, verbose=True, collide=True):\n self.setup_monitoring(std_dev_dict=std_dev_dict, noise_dev_dict=noise_dev_dict,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1067_C8", "label": "setup_monitoring()", "type": "expression", "loc": [1067, 1072], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1060_C4", "vector": [8, 2, 0.8369, 0.0047, 2, 0.09, 0.0, 745, 3, 12, 0, 0, 0, 0, 1], "semantic": {"name": "setup_monitoring", "arg_names": [], "import_names": [], "rhs_call_name": "setup_monitoring", "annotation": ""}, "snippet": " self.setup_monitoring(std_dev_dict=std_dev_dict, noise_dev_dict=noise_dev_dict,\n duration=duration, std_dev_default=std_dev_default, \n tol_thresh_dict=tol_thresh_dict,\n noise_dev_default=noise_dev_default, contingency=contingency, window_size=window_size, \n current_zeros=current_zeros, transform_dict=transform_dict, \n verbose=verbose, collide=collide)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1073_C8", "label": "if", "type": "if", "loc": [1073, 1074], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1060_C4", "vector": [4, 2, 0.84, 0.0016, 2, 0.09, 0.1667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if models is not None:\n self.models = models"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1074_C12", "label": "self.models =", "type": "assigned_variable", "loc": [1074, 1074], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1073_C8", "vector": [14, 3, 0.8404, 0.0008, 3, 0.5, 0.0, 134, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.models = models"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1075_C8", "label": "if", "type": "if", "loc": [1075, 1076], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1060_C4", "vector": [4, 2, 0.8415, 0.0016, 2, 0.09, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if model_zeros is not None:\n self.model_zeros = model_zeros"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1076_C12", "label": "self.model_zeros =", "type": "assigned_variable", "loc": [1076, 1076], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1075_C8", "vector": [14, 3, 0.8419, 0.0008, 3, 0.61, 0.0, 850, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.model_zeros", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.model_zeros = model_zeros"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1077_C8", "label": "self.cur_pt =", "type": "assigned_variable", "loc": [1077, 1077], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1060_C4", "vector": [14, 2, 0.8427, 0.0008, 2, 0.09, 0.5, 983, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cur_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cur_pt = self.window_size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1078_C8", "label": "collision =", "type": "assigned_variable", "loc": [1078, 1078], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1060_C4", "vector": [14, 2, 0.8435, 0.0008, 2, 0.09, 0.6667, 871, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "collision", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " collision = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1080_C8", "label": "for i", "type": "for", "loc": [1080, 1085], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1060_C4", "vector": [6, 2, 0.847, 0.0047, 2, 0.09, 0.8333, 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(monitor_data[monitor_data.keys()[0]])):\n for k in monitor_data:\n index, diff = self.collision_detect(k, monitor_data[k][i])\n if index != -1:\n collision = (k, index, diff)\n self.cur_pt += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1081_C12", "label": "for k", "type": "for", "loc": [1081, 1084], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1080_C8", "vector": [6, 3, 0.847, 0.0031, 3, 0.97, 0.0, 954, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in monitor_data:\n index, diff = self.collision_detect(k, monitor_data[k][i])\n if index != -1:\n collision = (k, index, diff)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1082_C16", "label": "index, diff = collision_detect()", "type": "assigned_variable", "loc": [1082, 1082], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1081_C12", "vector": [14, 4, 0.8466, 0.0008, 4, 0.71, 0.0, 35, 3, 2, 0, 0, 489, 10, 1], "semantic": {"name": "index, diff", "arg_names": [], "import_names": [], "rhs_call_name": "collision_detect", "annotation": ""}, "snippet": " index, diff = self.collision_detect(k, monitor_data[k][i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1083_C16", "label": "if", "type": "if", "loc": [1083, 1084], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1081_C12", "vector": [4, 4, 0.8478, 0.0016, 4, 0.71, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if index != -1:\n collision = (k, index, diff)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1084_C20", "label": "collision =", "type": "assigned_variable", "loc": [1084, 1084], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1083_C16", "vector": [14, 5, 0.8482, 0.0008, 5, 0.14, 0.0, 871, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "collision", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " collision = (k, index, diff)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L1086_C8", "label": "return", "type": "return", "loc": [1086, 1086], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1060_C4", "vector": [13, 2, 0.8498, 0.0008, 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 collision"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1088_C4", "label": "resample_and_thin_data", "type": "function", "loc": [1088, 1094], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "vector": [2, 1, 0.8537, 0.0055, 1, 0.94, 1.0, 225, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "resample_and_thin_data", "arg_names": ["self", "monitor_data", "sample_rate"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def resample_and_thin_data(self, monitor_data, sample_rate):\n ret_data = {}\n for k in monitor_data:\n ret_data[k] = {}\n ret_data[k][\"mean\"] = monitor_data[k][\"mean\"][::sample_rate]\n ret_data[k][\"variance\"] = monitor_data[k][\"variance\"][::sample_rate]\n return ret_data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1089_C8", "label": "ret_data =", "type": "assigned_variable", "loc": [1089, 1089], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1088_C4", "vector": [14, 2, 0.8521, 0.0008, 2, 0.83, 0.0, 150, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "ret_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret_data = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1090_C8", "label": "for k", "type": "for", "loc": [1090, 1093], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1088_C4", "vector": [6, 2, 0.8541, 0.0031, 2, 0.83, 0.5, 954, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in monitor_data:\n ret_data[k] = {}\n ret_data[k][\"mean\"] = monitor_data[k][\"mean\"][::sample_rate]\n ret_data[k][\"variance\"] = monitor_data[k][\"variance\"][::sample_rate]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1091_C12", "label": "assign", "type": "assigned_variable", "loc": [1091, 1091], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1090_C8", "vector": [14, 3, 0.8537, 0.0008, 3, 0.57, 0.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret_data[k] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1092_C12", "label": "assign", "type": "assigned_variable", "loc": [1092, 1092], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1090_C8", "vector": [14, 3, 0.8545, 0.0008, 3, 0.57, 0.5, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret_data[k][\"mean\"] = monitor_data[k][\"mean\"][::sample_rate]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1093_C12", "label": "assign", "type": "assigned_variable", "loc": [1093, 1093], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1090_C8", "vector": [14, 3, 0.8552, 0.0008, 3, 0.57, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret_data[k][\"variance\"] = monitor_data[k][\"variance\"][::sample_rate]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L1094_C8", "label": "return", "type": "return", "loc": [1094, 1094], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1088_C4", "vector": [13, 2, 0.856, 0.0008, 2, 0.83, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret_data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1096_C0", "label": "split_signals", "type": "function", "loc": [1096, 1173], "level": 0, "parent": null, "vector": [2, 0, 0.8877, 0.061, 0, 0.66, 0.9355, 669, 0, 1, 1, 0, 0, 0, 33], "semantic": {"name": "split_signals", "arg_names": ["datasets"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def split_signals(datasets):\n\n for perception in datasets:\n data_list = datasets[perception]\n\n # get the minimum model length\n lens = [len(m) for m in data_list]\n max_len = np.max(lens)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "label": "for perception", "type": "for", "loc": [1098, 1171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1096_C0", "vector": [6, 1, 0.8877, 0.0579, 1, 0.63, 0.0, 828, 2, 0, 0, 0, 0, 0, 33], "semantic": {"name": "perception", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for perception in datasets:\n data_list = datasets[perception]\n\n # get the minimum model length\n lens = [len(m) for m in data_list]\n max_len = np.max(lens)\n\n # dynamic finding of parameters"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1099_C8", "label": "data_list =", "type": "assigned_variable", "loc": [1099, 1099], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "vector": [14, 2, 0.8599, 0.0008, 2, 0.76, 0.0, 390, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "data_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_list = datasets[perception]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1102_C8", "label": "lens =", "type": "assigned_variable", "loc": [1102, 1102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "vector": [14, 2, 0.8623, 0.0008, 2, 0.76, 0.0714, 770, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "lens", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lens = [len(m) for m in data_list]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1103_C8", "label": "max_len = max()", "type": "assigned_variable", "loc": [1103, 1103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "vector": [14, 2, 0.8631, 0.0008, 2, 0.76, 0.1429, 851, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "max_len", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_len = np.max(lens)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1106_C8", "label": "if", "type": "if", "loc": [1106, 1109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "vector": [4, 2, 0.8666, 0.0031, 2, 0.76, 0.2143, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if smooth_wind_dict is None or smooth_wind_dict[perception] is None:\n smooth_wind = smooth_wind_default\n else:\n smooth_wind = smooth_wind_dict[perception]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1107_C12", "label": "smooth_wind =", "type": "assigned_variable", "loc": [1107, 1107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1106_C8", "vector": [14, 3, 0.8662, 0.0008, 3, 0.9, 0.0, 688, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "smooth_wind", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " smooth_wind = smooth_wind_default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1109_C12", "label": "smooth_wind =", "type": "assigned_variable", "loc": [1109, 1109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1106_C8", "vector": [14, 3, 0.8678, 0.0008, 3, 0.9, 1.0, 688, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "smooth_wind", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " smooth_wind = smooth_wind_dict[perception]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1111_C8", "label": "ret_means, ret_vars, ret_mean_models, ret_noise_vars =", "type": "assigned_variable", "loc": [1111, 1111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "vector": [14, 2, 0.8693, 0.0008, 2, 0.76, 0.2857, 921, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "ret_means, ret_vars, ret_mean_models, ret_noise_vars", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret_means, ret_vars, ret_mean_models, ret_noise_vars = [], [], [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1112_C8", "label": "ret_times, noise_vars =", "type": "assigned_variable", "loc": [1112, 1112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "vector": [14, 2, 0.8701, 0.0008, 2, 0.76, 0.3571, 360, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "ret_times, noise_vars", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret_times, noise_vars = [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1114_C8", "label": "num_coords = len()", "type": "assigned_variable", "loc": [1114, 1114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "vector": [14, 2, 0.8717, 0.0008, 2, 0.76, 0.4286, 586, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "num_coords", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " num_coords = len(data_list[0][0][1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1115_C8", "label": "for coord", "type": "for", "loc": [1115, 1152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "vector": [6, 2, 0.8869, 0.0297, 2, 0.76, 0.5, 84, 3, 0, 0, 0, 0, 0, 17], "semantic": {"name": "coord", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for coord in range(num_coords):\n mean_models, variance_models = [], []\n times = None\n for stream in data_list:\n # extract only the data stream for a single coordinate (all x values)\n stream_coord = np.array(zip(*zip(*stream)[1])[coord])\n cur_mean_model = signal_smooth(stream_coord, smooth_wind)\n mean_models += [cur_mean_model]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1116_C12", "label": "mean_models, variance_models =", "type": "assigned_variable", "loc": [1116, 1116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1115_C8", "vector": [14, 3, 0.8732, 0.0008, 3, 0.29, 0.0, 860, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "mean_models, variance_models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mean_models, variance_models = [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1117_C12", "label": "times =", "type": "assigned_variable", "loc": [1117, 1117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1115_C8", "vector": [14, 3, 0.874, 0.0008, 3, 0.29, 0.125, 342, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "times", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " times = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1118_C12", "label": "for stream", "type": "for", "loc": [1118, 1126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1115_C8", "vector": [6, 3, 0.8779, 0.007, 3, 0.29, 0.25, 517, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "stream", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for stream in data_list:\n # extract only the data stream for a single coordinate (all x values)\n stream_coord = np.array(zip(*zip(*stream)[1])[coord])\n cur_mean_model = signal_smooth(stream_coord, smooth_wind)\n mean_models += [cur_mean_model]\n \n # sum up the squared difference over the whole model\n noise_vars += [ ( sum([(x - y) ** 2 for x,y in zip(cur_mean_model,stream_coord)]) /"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1120_C16", "label": "stream_coord = array()", "type": "assigned_variable", "loc": [1120, 1120], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1118_C12", "vector": [14, 4, 0.8764, 0.0008, 4, 0.38, 0.0, 918, 3, 1, 0, 0, 80, 10, 3], "semantic": {"name": "stream_coord", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " stream_coord = np.array(zip(*zip(*stream)[1])[coord])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1121_C16", "label": "cur_mean_model = signal_smooth()", "type": "assigned_variable", "loc": [1121, 1121], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1118_C12", "vector": [14, 4, 0.8772, 0.0008, 4, 0.38, 1.0, 225, 3, 2, 0, 0, 833, 10, 1], "semantic": {"name": "cur_mean_model", "arg_names": [], "import_names": [], "rhs_call_name": "signal_smooth", "annotation": ""}, "snippet": " cur_mean_model = signal_smooth(stream_coord, smooth_wind)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1129_C12", "label": "avg_means_model = array()", "type": "assigned_variable", "loc": [1129, 1129], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1115_C8", "vector": [14, 3, 0.8834, 0.0008, 3, 0.29, 0.375, 177, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "avg_means_model", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " avg_means_model = np.array([0.] * max_len)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1130_C12", "label": "for i", "type": "for", "loc": [1130, 1136], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1115_C8", "vector": [6, 3, 0.8865, 0.0055, 3, 0.29, 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(max_len):\n n = 0\n for j in range(len(mean_models)):\n if i < len(mean_models[j]):\n avg_means_model[i] += mean_models[j][i]\n n += 1\n avg_means_model[i] /= n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1131_C16", "label": "n =", "type": "assigned_variable", "loc": [1131, 1131], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1130_C12", "vector": [14, 4, 0.885, 0.0008, 4, 0.88, 0.0, 773, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1132_C16", "label": "for j", "type": "for", "loc": [1132, 1135], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1130_C12", "vector": [6, 4, 0.8869, 0.0031, 4, 0.88, 1.0, 100, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for j in range(len(mean_models)):\n if i < len(mean_models[j]):\n avg_means_model[i] += mean_models[j][i]\n n += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1133_C20", "label": "if", "type": "if", "loc": [1133, 1135], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1132_C16", "vector": [4, 5, 0.8873, 0.0023, 5, 0.41, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i < len(mean_models[j]):\n avg_means_model[i] += mean_models[j][i]\n n += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1138_C12", "label": "if", "type": "if", "loc": [1138, 1141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1115_C8", "vector": [4, 3, 0.8916, 0.0031, 3, 0.29, 0.625, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if var_wind_dict is None or var_wind_dict[perception] is None:\n var_wind = var_wind_default\n else:\n var_wind = var_wind_dict[perception]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1139_C16", "label": "var_wind =", "type": "assigned_variable", "loc": [1139, 1139], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1138_C12", "vector": [14, 4, 0.8912, 0.0008, 4, 0.91, 0.0, 92, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "var_wind", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " var_wind = var_wind_default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1141_C16", "label": "var_wind =", "type": "assigned_variable", "loc": [1141, 1141], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1138_C12", "vector": [14, 4, 0.8928, 0.0008, 4, 0.91, 1.0, 92, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "var_wind", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " var_wind = var_wind_dict[perception]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1144_C12", "label": "vars_model = signal_list_variance()", "type": "assigned_variable", "loc": [1144, 1144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1115_C8", "vector": [14, 3, 0.8951, 0.0008, 3, 0.29, 0.75, 840, 3, 3, 0, 0, 321, 10, 1], "semantic": {"name": "vars_model", "arg_names": [], "import_names": [], "rhs_call_name": "signal_list_variance", "annotation": ""}, "snippet": " vars_model = signal_list_variance(mean_models, avg_means_model, var_wind)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1145_C12", "label": "vars_model = signal_smooth()", "type": "assigned_variable", "loc": [1145, 1145], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1115_C8", "vector": [14, 3, 0.8959, 0.0008, 3, 0.29, 0.875, 840, 3, 2, 0, 0, 833, 10, 1], "semantic": {"name": "vars_model", "arg_names": [], "import_names": [], "rhs_call_name": "signal_smooth", "annotation": ""}, "snippet": " vars_model = signal_smooth(vars_model, var_smooth_wind)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1146_C12", "label": "vars_model = signal_smooth()", "type": "assigned_variable", "loc": [1146, 1146], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1115_C8", "vector": [14, 3, 0.8967, 0.0008, 3, 0.29, 1.0, 840, 3, 2, 0, 0, 833, 10, 1], "semantic": {"name": "vars_model", "arg_names": [], "import_names": [], "rhs_call_name": "signal_smooth", "annotation": ""}, "snippet": " vars_model = signal_smooth(vars_model, var_smooth_wind + 23)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1156_C8", "label": " = array()", "type": "assigned_variable", "loc": [1156, 1156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "vector": [14, 2, 0.9045, 0.0008, 2, 0.76, 0.5714, 0, 3, 1, 0, 0, 80, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " self.models[perception][\"mean\"] = np.array(zip(*ret_means))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1157_C8", "label": " = array()", "type": "assigned_variable", "loc": [1157, 1157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "vector": [14, 2, 0.9053, 0.0008, 2, 0.76, 0.6429, 0, 3, 1, 0, 0, 80, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " self.models[perception][\"variance\"] = np.array(zip(*ret_vars))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1158_C8", "label": "a =", "type": "assigned_variable", "loc": [1158, 1158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "vector": [14, 2, 0.9061, 0.0008, 2, 0.76, 0.7143, 475, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " a = ret_mean_models"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1159_C8", "label": "b =", "type": "assigned_variable", "loc": [1159, 1159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "vector": [14, 2, 0.9069, 0.0008, 2, 0.76, 0.7857, 756, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "b", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " b = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1160_C8", "label": "for stream", "type": "for", "loc": [1160, 1168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "vector": [6, 2, 0.9108, 0.007, 2, 0.76, 0.8571, 517, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "stream", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for stream in range(len(a[0])):\n t1 = []\n for val in range(len(a[0][0])):\n t2 = []\n for coord in range(len(a)):\n if val < len(a[coord][stream]):\n t2 += [a[coord][stream][val]]\n t1 += [np.array(t2)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1161_C12", "label": "t1 =", "type": "assigned_variable", "loc": [1161, 1161], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1160_C8", "vector": [14, 3, 0.9085, 0.0008, 3, 0.24, 0.0, 329, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "t1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t1 = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1162_C12", "label": "for val", "type": "for", "loc": [1162, 1167], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1160_C8", "vector": [6, 3, 0.9112, 0.0047, 3, 0.24, 1.0, 618, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for val in range(len(a[0][0])):\n t2 = []\n for coord in range(len(a)):\n if val < len(a[coord][stream]):\n t2 += [a[coord][stream][val]]\n t1 += [np.array(t2)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1163_C20", "label": "t2 =", "type": "assigned_variable", "loc": [1163, 1163], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1162_C12", "vector": [14, 4, 0.91, 0.0008, 4, 0.1, 0.0, 469, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "t2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t2 = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1164_C20", "label": "for coord", "type": "for", "loc": [1164, 1166], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1162_C12", "vector": [6, 4, 0.9116, 0.0023, 4, 0.1, 1.0, 84, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "coord", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for coord in range(len(a)):\n if val < len(a[coord][stream]):\n t2 += [a[coord][stream][val]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1165_C28", "label": "if", "type": "if", "loc": [1165, 1166], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1164_C20", "vector": [4, 5, 0.912, 0.0016, 5, 0.57, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if val < len(a[coord][stream]):\n t2 += [a[coord][stream][val]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1170_C8", "label": "assign", "type": "assigned_variable", "loc": [1170, 1170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "vector": [14, 2, 0.9155, 0.0008, 2, 0.76, 0.9286, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.models[perception][\"smoothed_signals\"] = b"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1171_C8", "label": " = array()", "type": "assigned_variable", "loc": [1171, 1171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "vector": [14, 2, 0.9163, 0.0008, 2, 0.76, 1.0, 0, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " self.models[perception][\"noise_variance\"] = np.array(ret_noise_vars)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L1173_C4", "label": "return", "type": "return", "loc": [1173, 1173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1096_C0", "vector": [13, 1, 0.9178, 0.0008, 1, 0.63, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.models"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1184_C0", "label": "generate_mean_grasp", "type": "function", "loc": [1184, 1220], "level": 0, "parent": null, "vector": [2, 0, 0.9405, 0.029, 0, 0.66, 0.9677, 447, 0, 1, 1, 0, 0, 0, 15], "semantic": {"name": "generate_mean_grasp", "arg_names": ["datasets"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def generate_mean_grasp(datasets):\n\n smooth_wind_default = 234\n means = {}\n for perception in datasets:\n data_list = datasets[perception]\n\n # get the minimum model length"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1186_C4", "label": "smooth_wind_default =", "type": "assigned_variable", "loc": [1186, 1186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1184_C0", "vector": [14, 1, 0.928, 0.0008, 1, 0.36, 0.0, 686, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "smooth_wind_default", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " smooth_wind_default = 234"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1187_C4", "label": "means =", "type": "assigned_variable", "loc": [1187, 1187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1184_C0", "vector": [14, 1, 0.9288, 0.0008, 1, 0.36, 0.3333, 622, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "means", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " means = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1188_C4", "label": "for perception", "type": "for", "loc": [1188, 1218], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1184_C0", "vector": [6, 1, 0.9413, 0.0243, 1, 0.36, 0.6667, 828, 2, 0, 0, 0, 0, 0, 15], "semantic": {"name": "perception", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for perception in datasets:\n data_list = datasets[perception]\n\n # get the minimum model length\n lens = [len(m) for m in data_list]\n max_len = np.max(lens)\n\n ret_means = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1189_C8", "label": "data_list =", "type": "assigned_variable", "loc": [1189, 1189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1188_C4", "vector": [14, 2, 0.9304, 0.0008, 2, 0.76, 0.0, 390, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "data_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_list = datasets[perception]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1192_C8", "label": "lens =", "type": "assigned_variable", "loc": [1192, 1192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1188_C4", "vector": [14, 2, 0.9327, 0.0008, 2, 0.76, 0.1667, 770, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "lens", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lens = [len(m) for m in data_list]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1193_C8", "label": "max_len = max()", "type": "assigned_variable", "loc": [1193, 1193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1188_C4", "vector": [14, 2, 0.9335, 0.0008, 2, 0.76, 0.3333, 851, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "max_len", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_len = np.max(lens)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1195_C8", "label": "ret_means =", "type": "assigned_variable", "loc": [1195, 1195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1188_C4", "vector": [14, 2, 0.9351, 0.0008, 2, 0.76, 0.5, 993, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ret_means", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret_means = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1197_C8", "label": "num_coords = len()", "type": "assigned_variable", "loc": [1197, 1197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1188_C4", "vector": [14, 2, 0.9366, 0.0008, 2, 0.76, 0.6667, 586, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "num_coords", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " num_coords = len(data_list[0][0][1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1198_C8", "label": "for coord", "type": "for", "loc": [1198, 1216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1188_C4", "vector": [6, 2, 0.9444, 0.0149, 2, 0.76, 0.8333, 84, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "coord", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for coord in range(num_coords):\n mean_models, variance_models = [], []\n for stream in data_list:\n # extract only the data stream for a single coordinate (all x values)\n stream_coord = np.array(zip(*zip(*stream)[1])[coord])\n cur_mean_model = signal_smooth(stream_coord, smooth_wind)\n mean_models += [cur_mean_model]\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1199_C12", "label": "mean_models, variance_models =", "type": "assigned_variable", "loc": [1199, 1199], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1198_C8", "vector": [14, 3, 0.9382, 0.0008, 3, 0.16, 0.0, 860, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "mean_models, variance_models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mean_models, variance_models = [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1200_C12", "label": "for stream", "type": "for", "loc": [1200, 1204], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1198_C8", "vector": [6, 3, 0.9405, 0.0039, 3, 0.16, 0.3333, 517, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "stream", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for stream in data_list:\n # extract only the data stream for a single coordinate (all x values)\n stream_coord = np.array(zip(*zip(*stream)[1])[coord])\n cur_mean_model = signal_smooth(stream_coord, smooth_wind)\n mean_models += [cur_mean_model]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1202_C16", "label": "stream_coord = array()", "type": "assigned_variable", "loc": [1202, 1202], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1200_C12", "vector": [14, 4, 0.9405, 0.0008, 4, 0.3, 0.0, 918, 3, 1, 0, 0, 80, 10, 3], "semantic": {"name": "stream_coord", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " stream_coord = np.array(zip(*zip(*stream)[1])[coord])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1203_C16", "label": "cur_mean_model = signal_smooth()", "type": "assigned_variable", "loc": [1203, 1203], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1200_C12", "vector": [14, 4, 0.9413, 0.0008, 4, 0.3, 1.0, 225, 3, 2, 0, 0, 833, 10, 1], "semantic": {"name": "cur_mean_model", "arg_names": [], "import_names": [], "rhs_call_name": "signal_smooth", "annotation": ""}, "snippet": " cur_mean_model = signal_smooth(stream_coord, smooth_wind)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1207_C12", "label": "avg_means_model = array()", "type": "assigned_variable", "loc": [1207, 1207], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1198_C8", "vector": [14, 3, 0.9444, 0.0008, 3, 0.16, 0.6667, 177, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "avg_means_model", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " avg_means_model = np.array([0.] * max_len)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1208_C12", "label": "for i", "type": "for", "loc": [1208, 1214], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1198_C8", "vector": [6, 3, 0.9476, 0.0055, 3, 0.16, 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(max_len):\n n = 0\n for j in range(len(mean_models)):\n if i < len(mean_models[j]):\n avg_means_model[i] += mean_models[j][i]\n n += 1\n avg_means_model[i] /= n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1209_C16", "label": "n =", "type": "assigned_variable", "loc": [1209, 1209], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1208_C12", "vector": [14, 4, 0.946, 0.0008, 4, 0.61, 0.0, 773, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1210_C16", "label": "for j", "type": "for", "loc": [1210, 1213], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1208_C12", "vector": [6, 4, 0.948, 0.0031, 4, 0.61, 1.0, 100, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for j in range(len(mean_models)):\n if i < len(mean_models[j]):\n avg_means_model[i] += mean_models[j][i]\n n += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1211_C20", "label": "if", "type": "if", "loc": [1211, 1213], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1210_C16", "vector": [4, 5, 0.9484, 0.0023, 5, 0.97, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i < len(mean_models[j]):\n avg_means_model[i] += mean_models[j][i]\n n += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1218_C8", "label": " = array()", "type": "assigned_variable", "loc": [1218, 1218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1188_C4", "vector": [14, 2, 0.9531, 0.0008, 2, 0.76, 1.0, 0, 3, 1, 0, 0, 80, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " means[perception] = np.array(zip(*ret_means))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L1220_C4", "label": "return", "type": "return", "loc": [1220, 1220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1184_C0", "vector": [13, 1, 0.9546, 0.0008, 1, 0.36, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return means"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "label": "if", "type": "if", "loc": [1222, 1278], "level": 0, "parent": null, "vector": [4, 0, 0.9781, 0.0446, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 52], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n rospy.init_node(node_name, anonymous=True)\n\n apm = ArmPerceptionMonitor(0, 0.001)\n for x in range(3):\n raw_input(\"Begin arm\")\n apm.start_training()\n rospy.sleep(1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1223_C4", "label": "init_node()", "type": "expression", "loc": [1223, 1223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.957, 0.0008, 1, 0.63, 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(node_name, anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1225_C4", "label": "apm = ArmPerceptionMonitor()", "type": "assigned_variable", "loc": [1225, 1225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [14, 1, 0.9585, 0.0008, 1, 0.63, 0.0227, 21, 3, 2, 0, 0, 815, 10, 1], "semantic": {"name": "apm", "arg_names": [], "import_names": [], "rhs_call_name": "ArmPerceptionMonitor", "annotation": ""}, "snippet": " apm = ArmPerceptionMonitor(0, 0.001)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1226_C4", "label": "for x", "type": "for", "loc": [1226, 1231], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [6, 1, 0.9613, 0.0047, 1, 0.63, 0.0455, 190, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x in range(3):\n raw_input(\"Begin arm\")\n apm.start_training()\n rospy.sleep(1.)\n apm.stop_training()\n rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1227_C8", "label": "raw_input()", "type": "expression", "loc": [1227, 1227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1226_C4", "vector": [8, 2, 0.9601, 0.0008, 2, 0.74, 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": " raw_input(\"Begin arm\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1228_C8", "label": "start_training()", "type": "expression", "loc": [1228, 1228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1226_C4", "vector": [8, 2, 0.9609, 0.0008, 2, 0.74, 0.25, 638, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start_training", "arg_names": [], "import_names": [], "rhs_call_name": "start_training", "annotation": ""}, "snippet": " apm.start_training()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1229_C8", "label": "sleep()", "type": "expression", "loc": [1229, 1229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1226_C4", "vector": [8, 2, 0.9617, 0.0008, 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(1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1230_C8", "label": "stop_training()", "type": "expression", "loc": [1230, 1230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1226_C4", "vector": [8, 2, 0.9624, 0.0008, 2, 0.74, 0.75, 347, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop_training", "arg_names": [], "import_names": [], "rhs_call_name": "stop_training", "annotation": ""}, "snippet": " apm.stop_training()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1231_C8", "label": "sleep()", "type": "expression", "loc": [1231, 1231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1226_C4", "vector": [8, 2, 0.9632, 0.0008, 2, 0.74, 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_99296:Assign_L1232_C4", "label": "models = generate_models()", "type": "assigned_variable", "loc": [1232, 1232], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [14, 1, 0.964, 0.0008, 1, 0.63, 0.0682, 495, 3, 0, 0, 0, 956, 10, 1], "semantic": {"name": "models", "arg_names": [], "import_names": [], "rhs_call_name": "generate_models", "annotation": ""}, "snippet": " models = apm.generate_models()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1233_C4", "label": "pickle_datasets()", "type": "expression", "loc": [1233, 1233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.9648, 0.0008, 1, 0.63, 0.0909, 550, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "pickle_datasets", "arg_names": [], "import_names": [], "rhs_call_name": "pickle_datasets", "annotation": ""}, "snippet": " apm.pickle_datasets(\"pickles//apmtest.pickle\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1234_C4", "label": "means =", "type": "assigned_variable", "loc": [1234, 1234], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [14, 1, 0.9656, 0.0008, 1, 0.63, 0.1136, 622, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "means", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " means = models[\"accelerometer\"][\"mean\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1235_C4", "label": "vars =", "type": "assigned_variable", "loc": [1235, 1235], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [14, 1, 0.9664, 0.0008, 1, 0.63, 0.1364, 302, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vars", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vars = models[\"accelerometer\"][\"variance\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1237_C4", "label": "xm, ym, zm = zip()", "type": "assigned_variable", "loc": [1237, 1237], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [14, 1, 0.9679, 0.0008, 1, 0.63, 0.1591, 739, 3, 1, 0, 0, 814, 10, 1], "semantic": {"name": "xm, ym, zm", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": " xm, ym, zm = zip(*means)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1238_C4", "label": "xv, yv, zv = zip()", "type": "assigned_variable", "loc": [1238, 1238], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [14, 1, 0.9687, 0.0008, 1, 0.63, 0.1818, 986, 3, 1, 0, 0, 814, 10, 1], "semantic": {"name": "xv, yv, zv", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": " xv, yv, zv = zip(*vars)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1239_C4", "label": "xv = map()", "type": "assigned_variable", "loc": [1239, 1239], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [14, 1, 0.9695, 0.0008, 1, 0.63, 0.2045, 9, 3, 2, 0, 0, 53, 10, 1], "semantic": {"name": "xv", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " xv = map(np.sqrt, xv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1240_C4", "label": "yv = map()", "type": "assigned_variable", "loc": [1240, 1240], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [14, 1, 0.9703, 0.0008, 1, 0.63, 0.2273, 503, 3, 2, 0, 0, 53, 10, 1], "semantic": {"name": "yv", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " yv = map(np.sqrt, yv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1241_C4", "label": "zv = map()", "type": "assigned_variable", "loc": [1241, 1241], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [14, 1, 0.971, 0.0008, 1, 0.63, 0.25, 739, 3, 2, 0, 0, 53, 10, 1], "semantic": {"name": "zv", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " zv = map(np.sqrt, zv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1242_C4", "label": "std_dev =", "type": "assigned_variable", "loc": [1242, 1242], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [14, 1, 0.9718, 0.0008, 1, 0.63, 0.2727, 784, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "std_dev", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " std_dev = 2.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1243_C4", "label": "xmmax =", "type": "assigned_variable", "loc": [1243, 1243], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [14, 1, 0.9726, 0.0008, 1, 0.63, 0.2955, 190, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "xmmax", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xmmax = [m + np.sqrt(v) * std_dev for m, v in zip(xm, xv)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1244_C4", "label": "ymmax =", "type": "assigned_variable", "loc": [1244, 1244], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [14, 1, 0.9734, 0.0008, 1, 0.63, 0.3182, 518, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "ymmax", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ymmax = [m + np.sqrt(v) * std_dev for m, v in zip(ym, yv)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1245_C4", "label": "zmmax =", "type": "assigned_variable", "loc": [1245, 1245], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [14, 1, 0.9742, 0.0008, 1, 0.63, 0.3409, 680, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "zmmax", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " zmmax = [m + np.sqrt(v) * std_dev for m, v in zip(zm, zv)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1246_C4", "label": "xmmin =", "type": "assigned_variable", "loc": [1246, 1246], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [14, 1, 0.975, 0.0008, 1, 0.63, 0.3636, 57, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "xmmin", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xmmin = [m - np.sqrt(v) * std_dev for m, v in zip(xm, xv)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1247_C4", "label": "ymmin =", "type": "assigned_variable", "loc": [1247, 1247], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [14, 1, 0.9757, 0.0008, 1, 0.63, 0.3864, 616, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "ymmin", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ymmin = [m - np.sqrt(v) * std_dev for m, v in zip(ym, yv)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1248_C4", "label": "zmmin =", "type": "assigned_variable", "loc": [1248, 1248], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [14, 1, 0.9765, 0.0008, 1, 0.63, 0.4091, 763, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "zmmin", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " zmmin = [m - np.sqrt(v) * std_dev for m, v in zip(zm, zv)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Import_L1250_C4", "label": "matplotlib.pyplot import plt", "type": "import", "loc": [1250, 1250], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [1, 1, 0.9781, 0.0008, 1, 0.63, 0.4318, 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_99296:Expr_L1251_C4", "label": "subplot()", "type": "expression", "loc": [1251, 1251], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.9789, 0.0008, 1, 0.63, 0.4545, 905, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subplot", "arg_names": [], "import_names": [], "rhs_call_name": "subplot", "annotation": ""}, "snippet": " plt.subplot(321)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1252_C4", "label": "plot()", "type": "expression", "loc": [1252, 1252], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.9797, 0.0008, 1, 0.63, 0.4773, 929, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " plt.plot(xm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1253_C4", "label": "plot()", "type": "expression", "loc": [1253, 1253], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.9804, 0.0008, 1, 0.63, 0.5, 929, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " plt.plot(xmmax)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1254_C4", "label": "plot()", "type": "expression", "loc": [1254, 1254], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.9812, 0.0008, 1, 0.63, 0.5227, 929, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " plt.plot(xmmin)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1256_C4", "label": "title()", "type": "expression", "loc": [1256, 1256], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.9828, 0.0008, 1, 0.63, 0.5455, 48, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "title", "arg_names": [], "import_names": [], "rhs_call_name": "title", "annotation": ""}, "snippet": " plt.title(\"X mean\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1257_C4", "label": "subplot()", "type": "expression", "loc": [1257, 1257], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.9836, 0.0008, 1, 0.63, 0.5682, 905, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subplot", "arg_names": [], "import_names": [], "rhs_call_name": "subplot", "annotation": ""}, "snippet": " plt.subplot(323)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1258_C4", "label": "plot()", "type": "expression", "loc": [1258, 1258], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.9844, 0.0008, 1, 0.63, 0.5909, 929, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " plt.plot(ym)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1259_C4", "label": "plot()", "type": "expression", "loc": [1259, 1259], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.9851, 0.0008, 1, 0.63, 0.6136, 929, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " plt.plot(ymmax)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1260_C4", "label": "plot()", "type": "expression", "loc": [1260, 1260], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.9859, 0.0008, 1, 0.63, 0.6364, 929, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " plt.plot(ymmin)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1261_C4", "label": "title()", "type": "expression", "loc": [1261, 1261], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.9867, 0.0008, 1, 0.63, 0.6591, 48, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "title", "arg_names": [], "import_names": [], "rhs_call_name": "title", "annotation": ""}, "snippet": " plt.title(\"Y mean\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1262_C4", "label": "subplot()", "type": "expression", "loc": [1262, 1262], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.9875, 0.0008, 1, 0.63, 0.6818, 905, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subplot", "arg_names": [], "import_names": [], "rhs_call_name": "subplot", "annotation": ""}, "snippet": " plt.subplot(325)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1263_C4", "label": "plot()", "type": "expression", "loc": [1263, 1263], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.9883, 0.0008, 1, 0.63, 0.7045, 929, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " plt.plot(zm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1264_C4", "label": "plot()", "type": "expression", "loc": [1264, 1264], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.989, 0.0008, 1, 0.63, 0.7273, 929, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " plt.plot(zmmax)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1265_C4", "label": "plot()", "type": "expression", "loc": [1265, 1265], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.9898, 0.0008, 1, 0.63, 0.75, 929, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " plt.plot(zmmin)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1266_C4", "label": "title()", "type": "expression", "loc": [1266, 1266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.9906, 0.0008, 1, 0.63, 0.7727, 48, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "title", "arg_names": [], "import_names": [], "rhs_call_name": "title", "annotation": ""}, "snippet": " plt.title(\"Z mean\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1268_C4", "label": "subplot()", "type": "expression", "loc": [1268, 1268], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.9922, 0.0008, 1, 0.63, 0.7955, 905, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subplot", "arg_names": [], "import_names": [], "rhs_call_name": "subplot", "annotation": ""}, "snippet": " plt.subplot(322)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1269_C4", "label": "plot()", "type": "expression", "loc": [1269, 1269], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.993, 0.0008, 1, 0.63, 0.8182, 929, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " plt.plot(xv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1270_C4", "label": "title()", "type": "expression", "loc": [1270, 1270], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.9937, 0.0008, 1, 0.63, 0.8409, 48, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "title", "arg_names": [], "import_names": [], "rhs_call_name": "title", "annotation": ""}, "snippet": " plt.title(\"X variance\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1271_C4", "label": "subplot()", "type": "expression", "loc": [1271, 1271], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.9945, 0.0008, 1, 0.63, 0.8636, 905, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subplot", "arg_names": [], "import_names": [], "rhs_call_name": "subplot", "annotation": ""}, "snippet": " plt.subplot(324)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1272_C4", "label": "plot()", "type": "expression", "loc": [1272, 1272], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.9953, 0.0008, 1, 0.63, 0.8864, 929, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " plt.plot(yv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1273_C4", "label": "title()", "type": "expression", "loc": [1273, 1273], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.9961, 0.0008, 1, 0.63, 0.9091, 48, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "title", "arg_names": [], "import_names": [], "rhs_call_name": "title", "annotation": ""}, "snippet": " plt.title(\"Y variance\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1274_C4", "label": "subplot()", "type": "expression", "loc": [1274, 1274], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.9969, 0.0008, 1, 0.63, 0.9318, 905, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subplot", "arg_names": [], "import_names": [], "rhs_call_name": "subplot", "annotation": ""}, "snippet": " plt.subplot(326)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1275_C4", "label": "plot()", "type": "expression", "loc": [1275, 1275], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.9977, 0.0008, 1, 0.63, 0.9545, 929, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " plt.plot(zv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1276_C4", "label": "title()", "type": "expression", "loc": [1276, 1276], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 0.9984, 0.0008, 1, 0.63, 0.9773, 48, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "title", "arg_names": [], "import_names": [], "rhs_call_name": "title", "annotation": ""}, "snippet": " plt.title(\"Z variance\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1278_C4", "label": "show()", "type": "expression", "loc": [1278, 1278], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "vector": [8, 1, 1.0, 0.0008, 1, 0.63, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " plt.show()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L67_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L68_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L67_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L69_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L70_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L69_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L72_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L78_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L79_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L78_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L80_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L81_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L80_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L83_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L94_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L122_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L123_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L133_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L141_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L149_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L149_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L150_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L149_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L151_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L158_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L159_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L166_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L167_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L174_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L174_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L201_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L202_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L201_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L203_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L204_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L205_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L213_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L174_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L221_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L222_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L223_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L221_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L221_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L221_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L221_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L221_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L230_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L231_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L230_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L233_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L221_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L236_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L237_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L236_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L238_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L236_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L239_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L239_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L241_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L239_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L242_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L239_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L244_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L244_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L245_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L244_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L247_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L239_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L248_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L221_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L251_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L252_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L251_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L253_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L221_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L256_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L258_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L258_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L259_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L258_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L260_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L174_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L265_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L265_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L265_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L267_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L267_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L268_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L265_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L265_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L270_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L174_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L274_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L276_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L174_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L280_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L280_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L281_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L174_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L284_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L284_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:While_L285_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:While_L285_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L286_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L284_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L287_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L312_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L314_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L316_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L316_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L317_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L316_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L318_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L316_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L320_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L316_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L321_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L323_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L325_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L327_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L337_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L337_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L338_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L340_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L340_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L341_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L340_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L344_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L346_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L346_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L347_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L346_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L350_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L346_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L352_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L354_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L354_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L355_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L354_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L358_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L354_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L360_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L362_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L362_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L363_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L362_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L366_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L362_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L368_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L370_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L370_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L371_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L370_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L373_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L370_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L376_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L378_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L378_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L379_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L378_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L381_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L378_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L384_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L386_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L386_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L387_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L386_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L389_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L386_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L392_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L394_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L394_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L395_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L394_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L397_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L394_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L400_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L402_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L402_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L403_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L407_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L407_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L408_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L408_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L409_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L408_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L410_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L408_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L411_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L407_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L413_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L422_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L424_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L426_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L428_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L428_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L429_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L428_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L430_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L428_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L432_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L428_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Import_L433_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L428_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L434_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L434_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L435_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L439_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L439_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L440_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L439_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L441_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L439_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L442_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L442_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L443_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L442_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L444_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L439_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L446_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L453_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L453_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L454_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L454_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L455_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L454_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L456_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L453_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L457_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L453_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L459_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L453_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L461_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L453_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L463_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L463_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L464_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L469_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L469_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L470_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L470_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L471_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L470_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L472_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L469_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L474_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L469_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L476_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L469_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L477_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L483_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L483_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L484_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L490_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L491_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L592_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L592_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L593_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L592_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L594_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L594_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L595_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L592_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L596_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L592_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L598_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L592_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L599_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L592_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L600_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L592_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L601_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L592_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L603_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L592_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L605_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L607_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L607_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L608_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L608_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L609_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L608_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L610_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L610_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L611_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L625_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L626_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L628_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L629_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L630_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L631_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L632_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L633_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L634_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L635_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L636_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L637_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L638_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L639_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L640_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L641_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L642_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L643_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L644_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L645_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L646_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L647_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L649_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L649_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L650_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L649_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L651_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L649_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L652_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L649_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L653_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L649_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L654_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L656_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L662_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L662_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L663_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L663_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L664_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L663_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L666_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L666_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L667_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L666_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L669_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L663_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L674_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L674_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L675_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L674_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L677_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L663_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L679_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L663_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L684_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L663_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L685_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L702_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L702_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L703_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L702_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L704_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L705_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L708_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L719_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L719_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L720_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L721_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L722_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L723_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L724_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L725_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L726_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L727_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L728_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L729_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L730_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L731_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L732_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L734_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L735_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L694_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L739_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L739_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L740_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L739_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L741_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L743_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L743_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L745_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L743_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L752_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L752_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L753_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L743_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L754_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L754_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L755_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L754_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L757_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L754_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L758_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L754_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L759_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L754_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L760_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L764_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L764_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L765_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L764_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L766_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L764_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L767_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L767_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L769_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L767_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L776_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L767_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L779_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L779_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L781_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L779_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L782_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L782_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L783_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L783_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L784_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L783_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L786_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L782_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L787_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L779_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L821_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L779_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L822_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L767_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L824_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L764_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L826_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L826_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L827_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L826_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L828_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L828_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L829_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L828_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L830_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L828_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L831_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L831_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L832_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L828_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L833_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L828_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L834_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L764_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L839_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L839_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L840_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L840_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L841_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L840_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L842_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L764_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L843_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L854_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L854_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L855_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L854_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L856_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L858_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L859_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L860_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L861_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L861_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L862_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L861_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L863_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L864_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L865_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L866_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L867_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L871_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L872_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L872_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L873_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L872_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L874_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L876_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L853_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L877_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L882_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L882_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L884_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L882_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L885_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L882_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L886_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L886_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L892_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L892_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L893_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L892_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L894_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L892_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L896_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L892_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L897_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L886_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L899_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L886_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L900_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L886_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L902_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L886_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L904_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L904_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L905_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L882_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L915_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L882_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L918_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L920_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L920_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L921_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L920_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L922_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L920_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L923_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L923_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L924_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L920_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L925_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L920_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L927_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L927_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L928_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L920_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L929_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L920_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L931_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L920_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L932_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L932_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L933_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L932_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L934_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L934_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L935_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L932_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L936_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L920_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L937_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L939_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L939_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L940_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L939_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L941_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L939_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L942_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L942_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L943_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L943_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L944_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L943_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L945_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L942_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L950_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L939_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L956_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L956_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L957_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L939_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L959_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L959_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L960_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L939_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L963_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L963_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L965_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L963_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L968_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L939_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L969_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L969_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L970_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L939_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L971_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L971_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L972_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L971_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L973_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L971_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L974_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L939_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L983_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1060_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1060_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1067_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1060_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1073_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1073_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1074_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1060_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1075_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1075_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1076_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1060_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1077_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1060_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1078_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1060_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1080_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1080_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1081_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1081_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1082_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1081_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1083_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1083_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1084_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1060_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L1086_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:ClassDef_L302_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1088_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1088_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1089_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1088_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1090_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1090_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1091_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1090_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1092_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1090_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1093_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1088_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L1094_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1096_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1099_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1115_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1115_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1115_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1118_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1118_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1120_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1118_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1121_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1115_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1129_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1115_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1130_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1131_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1130_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1132_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1132_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1133_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1115_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1138_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1138_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1139_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1138_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1141_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1115_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1144_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1115_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1145_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1115_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1146_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1160_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1161_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1160_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1162_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1162_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1163_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1162_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1164_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1164_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1165_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1098_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1096_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L1173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1184_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1186_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1184_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1184_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1198_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1199_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1198_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1200_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1200_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1202_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1200_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1203_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1198_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1207_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1198_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1208_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1208_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1209_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1208_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1210_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1210_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1211_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:FunctionDef_L1184_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Return_L1220_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1223_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1226_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1226_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1226_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1226_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1229_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1226_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:For_L1226_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1232_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1233_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1234_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1238_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1239_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1240_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1241_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1242_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1243_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1244_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1245_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1246_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1247_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Assign_L1248_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Import_L1250_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1251_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1252_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1253_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1254_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1256_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1257_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1258_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1259_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1260_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1262_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1263_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1264_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1265_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1266_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1268_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1269_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1270_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1271_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1272_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1273_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1274_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1275_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1276_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99296:If_L1222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99296:Expr_L1278_C4"}]
#! /usr/bin/python import numpy as np import sys import cPickle as pickle import roslib roslib.load_manifest('kelsey_sandbox') roslib.load_manifest('hrl_generic_arms') import rospy import rosparam import tf import tf.transformations as tf_trans from hrl_generic_arms.pose_converter import PoseConverter #from umeyama_method import umeyama_method def capture_data(): tf_list = tf.TransformListener() opti_mat, robot_mat = [], [] print "Hit enter to collect a data sample" i = 0 while not rospy.is_shutdown(): rospy.sleep(0.3) #if raw_input(".") == 'q': # break now = rospy.Time(0.) (opti_pos, opti_rot) = tf_list.lookupTransform("/pr2_antenna", "/optitrak", now) (robot_pos, robot_rot) = tf_list.lookupTransform("/wide_stereo_link", "/base_footprint", now) opti_mat.append(opti_pos) opti_rot_foot = np.mat([[-0.17496687, 0.03719102, -0.98387165], [-0.98098458, -0.09183928, 0.17098186], [-0.08399907, 0.99507908, 0.05255265]]).T opti_pos_foot = np.mat([[ 1.276 ], [-0.81755], [-0.06905]]) foot_B_opti = PoseConverter.to_homo_mat(opti_pos_foot, opti_rot_foot) ** -1 opti_B_ant = PoseConverter.to_homo_mat(opti_pos, opti_rot) ** -1 wide_B_foot = PoseConverter.to_homo_mat(robot_pos, robot_rot) print wide_B_foot * foot_B_opti * opti_B_ant offset_robot_pos = (wide_B_foot * foot_B_opti)[:3,3] print offset_robot_pos, opti_pos robot_mat.append(offset_robot_pos.T.A[0].tolist()) i += 1 if i % 10 == 0: print i, "samples collected" return opti_mat, robot_mat def umeyama_method(A, B): ux = np.mean(A, 1) uy = np.mean(B, 1) A_demean = A - ux B_demean = B - uy U, D, VT = np.linalg.svd(A_demean * B_demean.T) R = VT.T * U.T t = uy - R * ux return t, R def save_params(pos, rot, filename): rot_homo = np.eye(4) rot_homo[:3,:3] = rot rot_quat = tf_trans.quaternion_from_matrix(rot_homo) optitrak_params = { "position" : pos.T.A[0].tolist(), "orientation" : rot_quat.tolist() } print optitrak_params rosparam.upload_params("optitrak_calibration", optitrak_params) rospy.sleep(0.5) rosparam.dump_params(filename, "optitrak_calibration") def publish_transform(): optitrak_params = rosparam.get_param("optitrak_calibration") remap_mat = PoseConverter.to_homo_mat(optitrak_params["position"], optitrak_params["orientation"]) ** -1 tf_list = tf.TransformListener() tf_broad = tf.TransformBroadcaster() small_dur = rospy.Duration(0.001) robot_mat = PoseConverter.to_homo_mat([0., 0., 0.], [0., 0., 0., 1.]) opti_mat = PoseConverter.to_homo_mat([0., 0., 0.], [0., 0., 0., 1.]) while not rospy.is_shutdown(): try: now = rospy.Time(0.) (opti_pos, opti_rot) = tf_list.lookupTransform("/optitrak", "/pr2_antenna", now) opti_mat = PoseConverter.to_homo_mat(opti_pos, opti_rot) now = rospy.Time(0.) (robot_pos, robot_rot) = tf_list.lookupTransform("/wide_stereo_link", "/base_footprint", now) robot_mat = PoseConverter.to_homo_mat(robot_pos, robot_rot) odom_mat = opti_mat * remap_mat * robot_mat odom_pos, odom_rot = PoseConverter.to_pos_quat(odom_mat) tf_broad.sendTransform(odom_pos, odom_rot, rospy.Time.now(), "/base_footprint", "/optitrak") rospy.sleep(0.001) except Exception as e: print e def main(): rospy.init_node("optitrak_odom_remap") from optparse import OptionParser p = OptionParser() p.add_option('-f', '--file', dest="filename", default="", help="YAML file to save parameters in.") p.add_option('-l', '--load', dest="is_load", action="store_true", default=False, help="Load parameters from file.") p.add_option('-t', '--train', dest="is_train", action="store_true", default=False, help="Train by moving the head to different poses and capturing the relative positions.") p.add_option('-p', '--publish', dest="is_pub", action="store_true", default=False, help="Publish the transformation from optitrak to base_footprint.") (opts, args) = p.parse_args() if opts.filename == "": print "Bad command line parameters" p.print_help() return if opts.is_load: print "hi" params = rosparam.load_file(opts.filename, "optitrak_calibration")[0][0] rosparam.upload_params("optitrak_calibration", params) rospy.sleep(0.1) if opts.is_pub: publish_transform() return if opts.is_train: opti_mat, robot_mat = capture_data() opti_mat = np.mat(opti_mat).T robot_mat = np.mat(robot_mat).T pos, rot = umeyama_method(opti_mat, robot_mat) print np.linalg.norm(robot_mat - (rot * opti_mat + pos)) save_params(pos, rot, opts.filename) return if __name__ == "__main__": main()
ajibawa-2023/Python-Code-Large/train/row_99297
104
142
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0211, 0.007, 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_99297:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0282, 0.007, 0, 0.66, 0.0625, 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_99297:Import_L5_C0", "label": "cPickle import pickle", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0352, 0.007, 0, 0.66, 0.125, 279, 0, 1, 0, 0, 279, 0, 0], "semantic": {"name": "cPickle", "arg_names": [], "import_names": ["pickle"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cPickle as pickle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Import_L7_C0", "label": "roslib import roslib", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0493, 0.007, 0, 0.66, 0.1875, 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_99297:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0563, 0.007, 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('kelsey_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L9_C0", "label": "load_manifest()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0634, 0.007, 0, 0.66, 0.3125, 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_99297:Import_L10_C0", "label": "rospy import rospy", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0704, 0.007, 0, 0.66, 0.375, 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_99297:Import_L11_C0", "label": "rosparam import rosparam", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0775, 0.007, 0, 0.66, 0.4375, 410, 0, 1, 0, 0, 410, 0, 0], "semantic": {"name": "rosparam", "arg_names": [], "import_names": ["rosparam"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rosparam"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Import_L12_C0", "label": "tf import tf", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0845, 0.007, 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_99297:Import_L13_C0", "label": "tf.transformations import tf_trans", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0915, 0.007, 0, 0.66, 0.5625, 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_99297:ImportFrom_L14_C0", "label": "from hrl_generic_arms.pose_converter import PoseConverter", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0986, 0.007, 0, 0.66, 0.625, 752, 0, 1, 0, 0, 752, 0, 0], "semantic": {"name": "hrl_generic_arms.pose_converter", "arg_names": [], "import_names": ["PoseConverter"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_generic_arms.pose_converter import PoseConverter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L17_C0", "label": "capture_data", "type": "function", "loc": [17, 48], "level": 0, "parent": null, "vector": [2, 0, 0.2289, 0.2254, 0, 0.66, 0.6875, 819, 0, 0, 1, 0, 0, 0, 18], "semantic": {"name": "capture_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def capture_data():\n tf_list = tf.TransformListener()\n opti_mat, robot_mat = [], []\n print(\"Hit enter to collect a data sample\")\n i = 0\n while not rospy.is_shutdown():\n rospy.sleep(0.3)\n#if raw_input(\".\") == 'q':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L18_C4", "label": "tf_list = TransformListener()", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L17_C0", "vector": [14, 1, 0.1268, 0.007, 1, 0.02, 0.0, 501, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "tf_list", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " tf_list = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L19_C4", "label": "opti_mat, robot_mat =", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L17_C0", "vector": [14, 1, 0.1338, 0.007, 1, 0.02, 0.2, 163, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "opti_mat, robot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opti_mat, robot_mat = [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L20_C4", "label": "print()", "type": "expression", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L17_C0", "vector": [8, 1, 0.1408, 0.007, 1, 0.02, 0.4, 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 collect a data sample\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L21_C4", "label": "i =", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L17_C0", "vector": [14, 1, 0.1479, 0.007, 1, 0.02, 0.6, 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_99297:While_L22_C4", "label": "while", "type": "while", "loc": [22, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L17_C0", "vector": [5, 1, 0.243, 0.1831, 1, 0.02, 0.8, 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 rospy.sleep(0.3)\n#if raw_input(\".\") == 'q':\n# break\n now = rospy.Time(0.)\n (opti_pos, opti_rot) = tf_list.lookupTransform(\"/pr2_antenna\", \n \"/optitrak\", now)\n (robot_pos, robot_rot) = tf_list.lookupTransform(\"/wide_stereo_link\", "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L23_C8", "label": "sleep()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "vector": [8, 2, 0.162, 0.007, 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": " rospy.sleep(0.3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L26_C8", "label": "now = Time()", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "vector": [14, 2, 0.1831, 0.007, 2, 0.65, 0.0714, 894, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "now", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " now = rospy.Time(0.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L27_C8", "label": "opti_pos, opti_rot = lookupTransform()", "type": "assigned_variable", "loc": [27, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "vector": [14, 2, 0.1937, 0.0141, 2, 0.65, 0.1429, 231, 3, 3, 0, 0, 926, 10, 1], "semantic": {"name": "opti_pos, opti_rot", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": " (opti_pos, opti_rot) = tf_list.lookupTransform(\"/pr2_antenna\", \n \"/optitrak\", now)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L29_C8", "label": "robot_pos, robot_rot = lookupTransform()", "type": "assigned_variable", "loc": [29, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "vector": [14, 2, 0.2077, 0.0141, 2, 0.65, 0.2143, 896, 3, 3, 0, 0, 926, 10, 1], "semantic": {"name": "robot_pos, robot_rot", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": " (robot_pos, robot_rot) = tf_list.lookupTransform(\"/wide_stereo_link\", \n \"/base_footprint\", now)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L31_C8", "label": "append()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "vector": [8, 2, 0.2183, 0.007, 2, 0.65, 0.2857, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " opti_mat.append(opti_pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L32_C8", "label": "opti_rot_foot =", "type": "assigned_variable", "loc": [32, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "vector": [14, 2, 0.2324, 0.0211, 2, 0.65, 0.3571, 216, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "opti_rot_foot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opti_rot_foot = np.mat([[-0.17496687, 0.03719102, -0.98387165],\n [-0.98098458, -0.09183928, 0.17098186],\n [-0.08399907, 0.99507908, 0.05255265]]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L35_C8", "label": "opti_pos_foot = mat()", "type": "assigned_variable", "loc": [35, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "vector": [14, 2, 0.2535, 0.0211, 2, 0.65, 0.4286, 588, 3, 1, 0, 0, 882, 10, 1], "semantic": {"name": "opti_pos_foot", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " opti_pos_foot = np.mat([[ 1.276 ],\n [-0.81755],\n [-0.06905]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L38_C8", "label": "foot_B_opti =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "vector": [14, 2, 0.2676, 0.007, 2, 0.65, 0.5, 141, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "foot_B_opti", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " foot_B_opti = PoseConverter.to_homo_mat(opti_pos_foot, opti_rot_foot) ** -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L39_C8", "label": "opti_B_ant =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "vector": [14, 2, 0.2746, 0.007, 2, 0.65, 0.5714, 499, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "opti_B_ant", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opti_B_ant = PoseConverter.to_homo_mat(opti_pos, opti_rot) ** -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L40_C8", "label": "wide_B_foot = to_homo_mat()", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "vector": [14, 2, 0.2817, 0.007, 2, 0.65, 0.6429, 398, 3, 2, 0, 0, 32, 10, 1], "semantic": {"name": "wide_B_foot", "arg_names": [], "import_names": [], "rhs_call_name": "to_homo_mat", "annotation": ""}, "snippet": " wide_B_foot = PoseConverter.to_homo_mat(robot_pos, robot_rot) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L41_C8", "label": "print()", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "vector": [8, 2, 0.2887, 0.007, 2, 0.65, 0.7143, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(wide_B_foot * foot_B_opti * opti_B_ant)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L42_C8", "label": "offset_robot_pos =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "vector": [14, 2, 0.2958, 0.007, 2, 0.65, 0.7857, 556, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "offset_robot_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " offset_robot_pos = (wide_B_foot * foot_B_opti)[:3,3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L43_C8", "label": "print()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "vector": [8, 2, 0.3028, 0.007, 2, 0.65, 0.8571, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(offset_robot_pos, opti_pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L44_C8", "label": "append()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "vector": [8, 2, 0.3099, 0.007, 2, 0.65, 0.9286, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " robot_mat.append(offset_robot_pos.T.A[0].tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L46_C8", "label": "if", "type": "if", "loc": [46, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "vector": [4, 2, 0.3275, 0.0141, 2, 0.65, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i % 10 == 0:\n print(i, \"samples collected\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L47_C12", "label": "print()", "type": "expression", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L46_C8", "vector": [8, 3, 0.331, 0.007, 3, 0.53, 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, \"samples collected\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Return_L48_C4", "label": "return", "type": "return", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L17_C0", "vector": [13, 1, 0.338, 0.007, 1, 0.02, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return opti_mat, robot_mat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L50_C0", "label": "umeyama_method", "type": "function", "loc": [50, 58], "level": 0, "parent": null, "vector": [2, 0, 0.3803, 0.0634, 0, 0.66, 0.75, 365, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "umeyama_method", "arg_names": ["A", "B"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def umeyama_method(A, B):\n ux = np.mean(A, 1)\n uy = np.mean(B, 1)\n A_demean = A - ux\n B_demean = B - uy\n U, D, VT = np.linalg.svd(A_demean * B_demean.T)\n R = VT.T * U.T\n t = uy - R * ux"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L51_C4", "label": "ux = mean()", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L50_C0", "vector": [14, 1, 0.3592, 0.007, 1, 0.64, 0.0, 211, 3, 2, 0, 0, 856, 10, 1], "semantic": {"name": "ux", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " ux = np.mean(A, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L52_C4", "label": "uy = mean()", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L50_C0", "vector": [14, 1, 0.3662, 0.007, 1, 0.64, 0.1429, 5, 3, 2, 0, 0, 856, 10, 1], "semantic": {"name": "uy", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " uy = np.mean(B, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L53_C4", "label": "A_demean =", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L50_C0", "vector": [14, 1, 0.3732, 0.007, 1, 0.64, 0.2857, 420, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "A_demean", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " A_demean = A - ux"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L54_C4", "label": "B_demean =", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L50_C0", "vector": [14, 1, 0.3803, 0.007, 1, 0.64, 0.4286, 775, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "B_demean", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " B_demean = B - uy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L55_C4", "label": "U, D, VT = svd()", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L50_C0", "vector": [14, 1, 0.3873, 0.007, 1, 0.64, 0.5714, 350, 3, 1, 0, 0, 388, 10, 1], "semantic": {"name": "U, D, VT", "arg_names": [], "import_names": [], "rhs_call_name": "svd", "annotation": ""}, "snippet": " U, D, VT = np.linalg.svd(A_demean * B_demean.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L56_C4", "label": "R =", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L50_C0", "vector": [14, 1, 0.3944, 0.007, 1, 0.64, 0.7143, 467, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "R", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " R = VT.T * U.T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L57_C4", "label": "t =", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L50_C0", "vector": [14, 1, 0.4014, 0.007, 1, 0.64, 0.8571, 15, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t = uy - R * ux"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Return_L58_C4", "label": "return", "type": "return", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L50_C0", "vector": [13, 1, 0.4085, 0.007, 1, 0.64, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return t, R"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L60_C0", "label": "save_params", "type": "function", "loc": [60, 69], "level": 0, "parent": null, "vector": [2, 0, 0.4542, 0.0704, 0, 0.66, 0.8125, 797, 0, 3, 0, 0, 0, 0, 8], "semantic": {"name": "save_params", "arg_names": ["pos", "rot", "filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def save_params(pos, rot, filename):\n rot_homo = np.eye(4)\n rot_homo[:3,:3] = rot\n rot_quat = tf_trans.quaternion_from_matrix(rot_homo)\n optitrak_params = { \"position\" : pos.T.A[0].tolist(),\n \"orientation\" : rot_quat.tolist() }\n print(optitrak_params)\n rosparam.upload_params(\"optitrak_calibration\", optitrak_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L61_C4", "label": "rot_homo = eye()", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L60_C0", "vector": [14, 1, 0.4296, 0.007, 1, 0.84, 0.0, 249, 3, 1, 0, 0, 881, 10, 1], "semantic": {"name": "rot_homo", "arg_names": [], "import_names": [], "rhs_call_name": "eye", "annotation": ""}, "snippet": " rot_homo = np.eye(4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L62_C4", "label": "assign", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L60_C0", "vector": [14, 1, 0.4366, 0.007, 1, 0.84, 0.1429, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_homo[:3,:3] = rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L63_C4", "label": "rot_quat = quaternion_from_matrix()", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L60_C0", "vector": [14, 1, 0.4437, 0.007, 1, 0.84, 0.2857, 58, 3, 1, 0, 0, 61, 10, 1], "semantic": {"name": "rot_quat", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_from_matrix", "annotation": ""}, "snippet": " rot_quat = tf_trans.quaternion_from_matrix(rot_homo)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L64_C4", "label": "optitrak_params =", "type": "assigned_variable", "loc": [64, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L60_C0", "vector": [14, 1, 0.4542, 0.0141, 1, 0.84, 0.4286, 842, 0, 0, 0, 0, 0, 6, 2], "semantic": {"name": "optitrak_params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " optitrak_params = { \"position\" : pos.T.A[0].tolist(),\n \"orientation\" : rot_quat.tolist() }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L66_C4", "label": "print()", "type": "expression", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L60_C0", "vector": [8, 1, 0.4648, 0.007, 1, 0.84, 0.5714, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(optitrak_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L67_C4", "label": "upload_params()", "type": "expression", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L60_C0", "vector": [8, 1, 0.4718, 0.007, 1, 0.84, 0.7143, 51, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "upload_params", "arg_names": [], "import_names": [], "rhs_call_name": "upload_params", "annotation": ""}, "snippet": " rosparam.upload_params(\"optitrak_calibration\", optitrak_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L68_C4", "label": "sleep()", "type": "expression", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L60_C0", "vector": [8, 1, 0.4789, 0.007, 1, 0.84, 0.8571, 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_99297:Expr_L69_C4", "label": "dump_params()", "type": "expression", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L60_C0", "vector": [8, 1, 0.4859, 0.007, 1, 0.84, 1.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "dump_params", "arg_names": [], "import_names": [], "rhs_call_name": "dump_params", "annotation": ""}, "snippet": " rosparam.dump_params(filename, \"optitrak_calibration\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L71_C0", "label": "publish_transform", "type": "function", "loc": [71, 98], "level": 0, "parent": null, "vector": [2, 0, 0.5951, 0.1972, 0, 0.66, 0.875, 288, 0, 0, 0, 0, 0, 0, 19], "semantic": {"name": "publish_transform", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def publish_transform():\n optitrak_params = rosparam.get_param(\"optitrak_calibration\")\n remap_mat = PoseConverter.to_homo_mat(optitrak_params[\"position\"], \n optitrak_params[\"orientation\"]) ** -1\n tf_list = tf.TransformListener()\n tf_broad = tf.TransformBroadcaster()\n small_dur = rospy.Duration(0.001)\n robot_mat = PoseConverter.to_homo_mat([0., 0., 0.], [0., 0., 0., 1.])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L72_C4", "label": "optitrak_params = get_param()", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L71_C0", "vector": [14, 1, 0.507, 0.007, 1, 0.63, 0.0, 842, 3, 1, 0, 0, 427, 10, 1], "semantic": {"name": "optitrak_params", "arg_names": [], "import_names": [], "rhs_call_name": "get_param", "annotation": ""}, "snippet": " optitrak_params = rosparam.get_param(\"optitrak_calibration\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L73_C4", "label": "remap_mat =", "type": "assigned_variable", "loc": [73, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L71_C0", "vector": [14, 1, 0.5176, 0.0141, 1, 0.63, 0.1429, 134, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "remap_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " remap_mat = PoseConverter.to_homo_mat(optitrak_params[\"position\"], \n optitrak_params[\"orientation\"]) ** -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L75_C4", "label": "tf_list = TransformListener()", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L71_C0", "vector": [14, 1, 0.5282, 0.007, 1, 0.63, 0.2857, 501, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "tf_list", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " tf_list = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L76_C4", "label": "tf_broad = TransformBroadcaster()", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L71_C0", "vector": [14, 1, 0.5352, 0.007, 1, 0.63, 0.4286, 389, 3, 0, 0, 0, 986, 10, 1], "semantic": {"name": "tf_broad", "arg_names": [], "import_names": [], "rhs_call_name": "TransformBroadcaster", "annotation": ""}, "snippet": " tf_broad = tf.TransformBroadcaster()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L77_C4", "label": "small_dur = Duration()", "type": "assigned_variable", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L71_C0", "vector": [14, 1, 0.5423, 0.007, 1, 0.63, 0.5714, 849, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "small_dur", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " small_dur = rospy.Duration(0.001)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L78_C4", "label": "robot_mat = to_homo_mat()", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L71_C0", "vector": [14, 1, 0.5493, 0.007, 1, 0.63, 0.7143, 101, 3, 2, 0, 0, 32, 10, 1], "semantic": {"name": "robot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "to_homo_mat", "annotation": ""}, "snippet": " robot_mat = PoseConverter.to_homo_mat([0., 0., 0.], [0., 0., 0., 1.])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L79_C4", "label": "opti_mat = to_homo_mat()", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L71_C0", "vector": [14, 1, 0.5563, 0.007, 1, 0.63, 0.8571, 725, 3, 2, 0, 0, 32, 10, 1], "semantic": {"name": "opti_mat", "arg_names": [], "import_names": [], "rhs_call_name": "to_homo_mat", "annotation": ""}, "snippet": " opti_mat = PoseConverter.to_homo_mat([0., 0., 0.], [0., 0., 0., 1.])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L80_C4", "label": "while", "type": "while", "loc": [80, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L71_C0", "vector": [5, 1, 0.6268, 0.1338, 1, 0.63, 1.0, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n try:\n now = rospy.Time(0.)\n\n (opti_pos, opti_rot) = tf_list.lookupTransform(\"/optitrak\", \n \"/pr2_antenna\", now)\n opti_mat = PoseConverter.to_homo_mat(opti_pos, opti_rot)\n now = rospy.Time(0.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Try_L81_C8", "label": "try", "type": "try", "loc": [81, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L80_C4", "vector": [7, 2, 0.6303, 0.1268, 2, 0.05, 0.0, 0, 0, 1, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n now = rospy.Time(0.)\n\n (opti_pos, opti_rot) = tf_list.lookupTransform(\"/optitrak\", \n \"/pr2_antenna\", now)\n opti_mat = PoseConverter.to_homo_mat(opti_pos, opti_rot)\n now = rospy.Time(0.)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L82_C12", "label": "now = Time()", "type": "assigned_variable", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:Try_L81_C8", "vector": [14, 3, 0.5775, 0.007, 3, 0.64, 0.0, 894, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "now", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " now = rospy.Time(0.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L84_C12", "label": "opti_pos, opti_rot = lookupTransform()", "type": "assigned_variable", "loc": [84, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:Try_L81_C8", "vector": [14, 3, 0.5951, 0.0141, 3, 0.64, 0.1111, 231, 3, 3, 0, 0, 926, 10, 1], "semantic": {"name": "opti_pos, opti_rot", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": " (opti_pos, opti_rot) = tf_list.lookupTransform(\"/optitrak\", \n \"/pr2_antenna\", now)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L86_C12", "label": "opti_mat = to_homo_mat()", "type": "assigned_variable", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:Try_L81_C8", "vector": [14, 3, 0.6056, 0.007, 3, 0.64, 0.2222, 725, 3, 2, 0, 0, 32, 10, 1], "semantic": {"name": "opti_mat", "arg_names": [], "import_names": [], "rhs_call_name": "to_homo_mat", "annotation": ""}, "snippet": " opti_mat = PoseConverter.to_homo_mat(opti_pos, opti_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L87_C12", "label": "now = Time()", "type": "assigned_variable", "loc": [87, 87], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:Try_L81_C8", "vector": [14, 3, 0.6127, 0.007, 3, 0.64, 0.3333, 894, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "now", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " now = rospy.Time(0.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L89_C12", "label": "robot_pos, robot_rot = lookupTransform()", "type": "assigned_variable", "loc": [89, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:Try_L81_C8", "vector": [14, 3, 0.6303, 0.0141, 3, 0.64, 0.4444, 896, 3, 3, 0, 0, 926, 10, 1], "semantic": {"name": "robot_pos, robot_rot", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": " (robot_pos, robot_rot) = tf_list.lookupTransform(\"/wide_stereo_link\", \n \"/base_footprint\", now)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L91_C12", "label": "robot_mat = to_homo_mat()", "type": "assigned_variable", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:Try_L81_C8", "vector": [14, 3, 0.6408, 0.007, 3, 0.64, 0.5556, 101, 3, 2, 0, 0, 32, 10, 1], "semantic": {"name": "robot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "to_homo_mat", "annotation": ""}, "snippet": " robot_mat = PoseConverter.to_homo_mat(robot_pos, robot_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L93_C12", "label": "odom_mat =", "type": "assigned_variable", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:Try_L81_C8", "vector": [14, 3, 0.6549, 0.007, 3, 0.64, 0.6667, 140, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "odom_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " odom_mat = opti_mat * remap_mat * robot_mat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L94_C12", "label": "odom_pos, odom_rot = to_pos_quat()", "type": "assigned_variable", "loc": [94, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:Try_L81_C8", "vector": [14, 3, 0.662, 0.007, 3, 0.64, 0.7778, 869, 3, 1, 0, 0, 926, 10, 1], "semantic": {"name": "odom_pos, odom_rot", "arg_names": [], "import_names": [], "rhs_call_name": "to_pos_quat", "annotation": ""}, "snippet": " odom_pos, odom_rot = PoseConverter.to_pos_quat(odom_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L95_C12", "label": "sendTransform()", "type": "expression", "loc": [95, 95], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:Try_L81_C8", "vector": [8, 3, 0.669, 0.007, 3, 0.64, 0.8889, 373, 3, 5, 0, 0, 0, 0, 2], "semantic": {"name": "sendTransform", "arg_names": [], "import_names": [], "rhs_call_name": "sendTransform", "annotation": ""}, "snippet": " tf_broad.sendTransform(odom_pos, odom_rot, rospy.Time.now(), \"/base_footprint\", \"/optitrak\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L96_C12", "label": "sleep()", "type": "expression", "loc": [96, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:Try_L81_C8", "vector": [8, 3, 0.6761, 0.007, 3, 0.64, 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.001)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L98_C12", "label": "print()", "type": "expression", "loc": [98, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:Try_L81_C8", "vector": [8, 3, 0.6901, 0.007, 3, 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(e)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "label": "main", "type": "function", "loc": [101, 138], "level": 0, "parent": null, "vector": [2, 0, 0.8415, 0.2676, 0, 0.66, 0.9375, 624, 0, 0, 0, 0, 0, 0, 21], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n rospy.init_node(\"optitrak_odom_remap\")\n \n from optparse import OptionParser\n p = OptionParser()\n p.add_option('-f', '--file', dest=\"filename\", default=\"\",\n help=\"YAML file to save parameters in.\")\n p.add_option('-l', '--load', dest=\"is_load\","}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L102_C4", "label": "init_node()", "type": "expression", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "vector": [8, 1, 0.7183, 0.007, 1, 0.21, 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(\"optitrak_odom_remap\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:ImportFrom_L104_C4", "label": "from optparse import OptionParser", "type": "import", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "vector": [1, 1, 0.7324, 0.007, 1, 0.21, 0.0909, 323, 0, 1, 0, 0, 323, 0, 0], "semantic": {"name": "optparse", "arg_names": [], "import_names": ["OptionParser"], "rhs_call_name": "", "annotation": ""}, "snippet": " from optparse import OptionParser"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L105_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "vector": [14, 1, 0.7394, 0.007, 1, 0.21, 0.1818, 491, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "OptionParser", "annotation": ""}, "snippet": " p = OptionParser()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L106_C4", "label": "add_option()", "type": "expression", "loc": [106, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "vector": [8, 1, 0.75, 0.0141, 1, 0.21, 0.2727, 176, 3, 5, 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', dest=\"filename\", default=\"\",\n help=\"YAML file to save parameters in.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L108_C4", "label": "add_option()", "type": "expression", "loc": [108, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "vector": [8, 1, 0.7676, 0.0211, 1, 0.21, 0.3636, 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('-l', '--load', dest=\"is_load\",\n action=\"store_true\", default=False,\n help=\"Load parameters from file.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L111_C4", "label": "add_option()", "type": "expression", "loc": [111, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "vector": [8, 1, 0.7887, 0.0211, 1, 0.21, 0.4545, 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('-t', '--train', dest=\"is_train\",\n action=\"store_true\", default=False,\n help=\"Train by moving the head to different poses and capturing the relative positions.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L114_C4", "label": "add_option()", "type": "expression", "loc": [114, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "vector": [8, 1, 0.8099, 0.0211, 1, 0.21, 0.5455, 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', '--publish', dest=\"is_pub\",\n action=\"store_true\", default=False,\n help=\"Publish the transformation from optitrak to base_footprint.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L117_C4", "label": "opts, args = parse_args()", "type": "assigned_variable", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "vector": [14, 1, 0.8239, 0.007, 1, 0.21, 0.6364, 616, 3, 0, 0, 0, 187, 10, 1], "semantic": {"name": "opts, args", "arg_names": [], "import_names": [], "rhs_call_name": "parse_args", "annotation": ""}, "snippet": " (opts, args) = p.parse_args()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L118_C4", "label": "if", "type": "if", "loc": [118, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "vector": [4, 1, 0.8415, 0.0282, 1, 0.21, 0.7273, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opts.filename == \"\":\n print(\"Bad command line parameters\")\n p.print_help()\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L119_C8", "label": "print()", "type": "expression", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L118_C4", "vector": [8, 2, 0.838, 0.007, 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(\"Bad command line parameters\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L120_C8", "label": "print_help()", "type": "expression", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L118_C4", "vector": [8, 2, 0.8451, 0.007, 2, 0.78, 0.5, 931, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "print_help", "arg_names": [], "import_names": [], "rhs_call_name": "print_help", "annotation": ""}, "snippet": " p.print_help()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Return_L121_C8", "label": "return", "type": "return", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L118_C4", "vector": [13, 2, 0.8521, 0.007, 2, 0.78, 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_99297:If_L123_C4", "label": "if", "type": "if", "loc": [123, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "vector": [4, 1, 0.8803, 0.0352, 1, 0.21, 0.8182, 0, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opts.is_load:\n print(\"hi\")\n params = rosparam.load_file(opts.filename, \"optitrak_calibration\")[0][0]\n rosparam.upload_params(\"optitrak_calibration\", params)\n rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L124_C8", "label": "print()", "type": "expression", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L123_C4", "vector": [8, 2, 0.8732, 0.007, 2, 0.42, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"hi\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L125_C8", "label": "params =", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L123_C4", "vector": [14, 2, 0.8803, 0.007, 2, 0.42, 0.3333, 206, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params = rosparam.load_file(opts.filename, \"optitrak_calibration\")[0][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L126_C8", "label": "upload_params()", "type": "expression", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L123_C4", "vector": [8, 2, 0.8873, 0.007, 2, 0.42, 0.6667, 51, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "upload_params", "arg_names": [], "import_names": [], "rhs_call_name": "upload_params", "annotation": ""}, "snippet": " rosparam.upload_params(\"optitrak_calibration\", params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L127_C8", "label": "sleep()", "type": "expression", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L123_C4", "vector": [8, 2, 0.8944, 0.007, 2, 0.42, 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_99297:If_L128_C4", "label": "if", "type": "if", "loc": [128, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "vector": [4, 1, 0.9085, 0.0211, 1, 0.21, 0.9091, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opts.is_pub:\n publish_transform()\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L129_C8", "label": "publish_transform()", "type": "expression", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L128_C4", "vector": [8, 2, 0.9085, 0.007, 2, 0.37, 0.0, 288, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "publish_transform", "arg_names": [], "import_names": [], "rhs_call_name": "publish_transform", "annotation": ""}, "snippet": " publish_transform()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Return_L130_C8", "label": "return", "type": "return", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L128_C4", "vector": [13, 2, 0.9155, 0.007, 2, 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_99297:If_L131_C4", "label": "if", "type": "if", "loc": [131, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "vector": [4, 1, 0.9472, 0.0563, 1, 0.21, 1.0, 0, 7, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opts.is_train:\n opti_mat, robot_mat = capture_data()\n opti_mat = np.mat(opti_mat).T\n robot_mat = np.mat(robot_mat).T\n pos, rot = umeyama_method(opti_mat, robot_mat)\n print(np.linalg.norm(robot_mat - (rot * opti_mat + pos)))\n save_params(pos, rot, opts.filename)\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L132_C8", "label": "opti_mat, robot_mat = capture_data()", "type": "assigned_variable", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L131_C4", "vector": [14, 2, 0.9296, 0.007, 2, 0.93, 0.0, 163, 3, 0, 0, 0, 819, 10, 1], "semantic": {"name": "opti_mat, robot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "capture_data", "annotation": ""}, "snippet": " opti_mat, robot_mat = capture_data()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L133_C8", "label": "opti_mat =", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L131_C4", "vector": [14, 2, 0.9366, 0.007, 2, 0.93, 0.1667, 725, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "opti_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opti_mat = np.mat(opti_mat).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L134_C8", "label": "robot_mat =", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L131_C4", "vector": [14, 2, 0.9437, 0.007, 2, 0.93, 0.3333, 101, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "robot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " robot_mat = np.mat(robot_mat).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L135_C8", "label": "pos, rot = umeyama_method()", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L131_C4", "vector": [14, 2, 0.9507, 0.007, 2, 0.93, 0.5, 298, 3, 2, 0, 0, 365, 10, 1], "semantic": {"name": "pos, rot", "arg_names": [], "import_names": [], "rhs_call_name": "umeyama_method", "annotation": ""}, "snippet": " pos, rot = umeyama_method(opti_mat, robot_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L136_C8", "label": "print()", "type": "expression", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L131_C4", "vector": [8, 2, 0.9577, 0.007, 2, 0.93, 0.6667, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(np.linalg.norm(robot_mat - (rot * opti_mat + pos)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L137_C8", "label": "save_params()", "type": "expression", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L131_C4", "vector": [8, 2, 0.9648, 0.007, 2, 0.93, 0.8333, 797, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "save_params", "arg_names": [], "import_names": [], "rhs_call_name": "save_params", "annotation": ""}, "snippet": " save_params(pos, rot, opts.filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Return_L138_C8", "label": "return", "type": "return", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L131_C4", "vector": [13, 2, 0.9718, 0.007, 2, 0.93, 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_99297:If_L141_C0", "label": "if", "type": "if", "loc": [141, 142], "level": 0, "parent": null, "vector": [4, 0, 0.9965, 0.0141, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L142_C4", "label": "main()", "type": "expression", "loc": [142, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L141_C0", "vector": [8, 1, 1.0, 0.007, 1, 0.57, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L46_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Return_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Return_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:While_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Try_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:Try_L81_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:Try_L81_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:Try_L81_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:Try_L81_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:Try_L81_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:Try_L81_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:Try_L81_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:Try_L81_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L94_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:Try_L81_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:Try_L81_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L96_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:Try_L81_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:ImportFrom_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Return_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Return_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:FunctionDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Return_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99297:If_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99297:Expr_L142_C4"}]
#! /usr/bin/python import numpy as np from collections import deque from threading import Lock import roslib roslib.load_manifest("hrl_pr2_arms") import tf.transformations as tf_trans import rospy from hrl_pr2_arms.pr2_controller_switcher import ControllerSwitcher from hrl_pr2_arms.pr2_arm import create_pr2_arm, PR2ArmJointTrajectory, PR2ArmCartesianPostureBase from hrl_generic_arms.controllers import PIDController rate = 100. # controller gains kp_proportional = 0.084 kp_integral = 0.35 kp_init_integral = 0.005 kp_constant = 0.002 kp_max_ctrl = 0.30 kr_proportional = 0.160 kr_integral = 0.200 kr_init_integral = 0.05 kr_constant = 0.020 kr_max_ctrl = 0.40 class PR2ArmCartVelocityController(object): def __init__(self, arm, velocity_rot=None): self.arm = arm if velocity_rot is None: self.velocity_rot = np.mat(np.eye(3)) else: self.velocity_rot = velocity_rot self._is_moving = False self.lock = Lock() def update_velocity_rot(self, velocity_rot): with self.lock: self.velocity_rot = np.mat(velocity_rot) def move_velocity(self, velocity=0.015, is_translation=True, velocity_rot=None): if velocity_rot is not None: self.update_velocity_rot(velocity_rot) pos_i_des, rot_i_des = self.arm.get_ep() pos_i_act, rot_i_act = self.arm.get_end_effector_pose() # this is the current residiual error in the controller at the start pos_err = pos_i_act - pos_i_des rot_err = rot_i_act.T * rot_i_des if is_translation: pos_vel_des = velocity pid_ctrl = PIDController(rate=rate, k_p=kp_proportional, k_i=kp_integral, i_max=None, init_integ=np.sign(pos_vel_des) * kp_init_integral, saturation=kp_max_ctrl, feed_forward=np.sign(pos_vel_des) * kp_constant, name="arm_vel") else: rot_vel_des = velocity pid_ctrl = PIDController(rate=rate, k_p=kr_proportional, k_i=kr_integral, i_max=None, init_integ=np.sign(rot_vel_des) * kr_init_integral, saturation=kr_max_ctrl, feed_forward=np.sign(rot_vel_des) * kr_constant, name="arm_vel") vels = deque([np.array([0]*6)]*40) r = rospy.Rate(rate) self._is_moving = True while not rospy.is_shutdown() and self._is_moving: with self.lock: vel_rot = self.velocity_rot.copy() cur_pos, cur_rot = self.arm.get_end_effector_pose() # hacky velocity filter xd_act = self.arm.get_controller_state()['xd_act'] vels.append(xd_act) vels.popleft() vel_filt = np.mat(np.mean(vels, 0)).T x_vel_filt = (vel_rot.T * vel_filt[:3,0])[0,0] roll_vel_filt = (vel_rot.T * vel_filt[3:,0])[0,0] if is_translation: # PI velocity controller for position pos_ctrl = pid_ctrl.update_state(pos_vel_des - x_vel_filt) pos_des = vel_rot * (np.mat([pos_ctrl, 0, 0]).T + np.mat(np.diag([1, 0, 0])) * vel_rot.T * (cur_pos - pos_err) + np.mat(np.diag([0, 1, 1])) * vel_rot.T * pos_i_des) rot_des = rot_i_des # don't change rotation if not is_translation: rot_des_vel_frame = np.mat(np.eye(4)) rot_des_vel_frame[:3,:3] = cur_rot * rot_err * vel_rot roll_des_vel_frame, r2, r3 = tf_trans.euler_from_matrix(rot_des_vel_frame) # PI velocity controller for rotation rot_ctrl = pid_ctrl.update_state(rot_vel_des + roll_vel_filt) print roll_vel_filt, rot_vel_des, rot_vel_des - roll_vel_filt roll_ctrl_des = roll_des_vel_frame + rot_ctrl r1, pitch_i_des, yaw_i_des = tf_trans.euler_from_matrix(rot_i_des * vel_rot) rot_des = np.mat(tf_trans.euler_matrix(roll_ctrl_des, pitch_i_des, yaw_i_des)[:3,:3]) * vel_rot.T pos_des = pos_i_des # don't change translation self.arm.set_ep((pos_des, rot_des), 1) r.sleep() self.arm.set_ep(self.arm.get_ep(), 1) def stop_moving(self): self._is_moving = False def main(): rospy.init_node("arm_cart_vel_control") if True: ctrl_switcher = ControllerSwitcher() ctrl_switcher.carefree_switch('r', '%s_arm_controller', '$(find hrl_pr2_arms)/params/joint_traj_params_electric.yaml') rospy.sleep(0.5) ctrl_switcher.carefree_switch('r', '%s_joint_controller_low', '$(find hrl_pr2_arms)/params/joint_traj_params_electric_low.yaml') r_arm_js = create_pr2_arm('r', PR2ArmJointTrajectory, controller_name='%s_joint_controller_low') q = [-0.34781704, 0.27341079, -1.75392154, -2.08626393, -3.43756314, -1.82146607, -1.85187734] r_arm_js.set_ep(q, 3) rospy.sleep(6) ctrl_switcher.carefree_switch('r', '%s_cart_low_rfh', '$(find kelsey_sandbox)/params/j_transpose_low_rfh.yaml') r_arm = create_pr2_arm('r', PR2ArmCartesianPostureBase) r_arm.set_posture() rospy.sleep(0.2) vel_ctrl = PR2ArmCartVelocityController(r_arm) #vel_frame = tf_trans.euler_matrix(0, -np.pi/2, 0)[:3,:3] #vel_ctrl.move_velocity(velocity_rot=vel_frame, velocity=0.005, is_translation=False) vel_frame = tf_trans.euler_matrix(0, 0, np.pi/2)[:3,:3] vel_ctrl.move_velocity(velocity_rot=vel_frame, velocity=0.10, is_translation=False) if __name__ == "__main__": main()
ajibawa-2023/Python-Code-Large/train/row_99298
94
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_99298: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.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_99298:ImportFrom_L4_C0", "label": "from collections import deque", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.028, 0.007, 0, 0.66, 0.0435, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "collections", "arg_names": [], "import_names": ["deque"], "rhs_call_name": "", "annotation": ""}, "snippet": "from collections import deque"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:ImportFrom_L5_C0", "label": "from threading import Lock", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.035, 0.007, 0, 0.66, 0.087, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["Lock"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import Lock"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Import_L7_C0", "label": "roslib import roslib", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.049, 0.007, 0, 0.66, 0.1304, 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_99298:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0559, 0.007, 0, 0.66, 0.1739, 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_99298:Import_L9_C0", "label": "tf.transformations import tf_trans", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0629, 0.007, 0, 0.66, 0.2174, 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_99298:Import_L11_C0", "label": "rospy import rospy", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.007, 0, 0.66, 0.2609, 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_99298:ImportFrom_L12_C0", "label": "from hrl_pr2_arms.pr2_controller_switcher import ControllerSwitcher", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0839, 0.007, 0, 0.66, 0.3043, 395, 0, 1, 0, 0, 395, 0, 0], "semantic": {"name": "hrl_pr2_arms.pr2_controller_switcher", "arg_names": [], "import_names": ["ControllerSwitcher"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_pr2_arms.pr2_controller_switcher import ControllerSwitcher"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:ImportFrom_L13_C0", "label": "from hrl_pr2_arms.pr2_arm import create_pr2_arm, PR2ArmJointTrajectory, PR2ArmCartesianPostureBase", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.007, 0, 0.66, 0.3478, 253, 0, 3, 0, 0, 253, 0, 0], "semantic": {"name": "hrl_pr2_arms.pr2_arm", "arg_names": [], "import_names": ["create_pr2_arm", "PR2ArmJointTrajectory", "PR2ArmCartesianPostureBase"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_pr2_arms.pr2_arm import create_pr2_arm, PR2ArmJointTrajectory, PR2ArmCartesianPostureBase"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:ImportFrom_L14_C0", "label": "from hrl_generic_arms.controllers import PIDController", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0979, 0.007, 0, 0.66, 0.3913, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "hrl_generic_arms.controllers", "arg_names": [], "import_names": ["PIDController"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_generic_arms.controllers import PIDController"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L16_C0", "label": "rate =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.1119, 0.007, 0, 0.66, 0.4348, 477, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "rate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "rate = 100."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L19_C0", "label": "kp_proportional =", "type": "assigned_variable", "loc": [19, 19], "level": 0, "parent": null, "vector": [14, 0, 0.1329, 0.007, 0, 0.66, 0.4783, 145, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "kp_proportional", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "kp_proportional = 0.084"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L20_C0", "label": "kp_integral =", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.1399, 0.007, 0, 0.66, 0.5217, 884, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "kp_integral", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "kp_integral = 0.35"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L21_C0", "label": "kp_init_integral =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.1469, 0.007, 0, 0.66, 0.5652, 645, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "kp_init_integral", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "kp_init_integral = 0.005"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L22_C0", "label": "kp_constant =", "type": "assigned_variable", "loc": [22, 22], "level": 0, "parent": null, "vector": [14, 0, 0.1538, 0.007, 0, 0.66, 0.6087, 661, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "kp_constant", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "kp_constant = 0.002"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L23_C0", "label": "kp_max_ctrl =", "type": "assigned_variable", "loc": [23, 23], "level": 0, "parent": null, "vector": [14, 0, 0.1608, 0.007, 0, 0.66, 0.6522, 782, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "kp_max_ctrl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "kp_max_ctrl = 0.30"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L25_C0", "label": "kr_proportional =", "type": "assigned_variable", "loc": [25, 25], "level": 0, "parent": null, "vector": [14, 0, 0.1748, 0.007, 0, 0.66, 0.6957, 316, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "kr_proportional", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "kr_proportional = 0.160"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L26_C0", "label": "kr_integral =", "type": "assigned_variable", "loc": [26, 26], "level": 0, "parent": null, "vector": [14, 0, 0.1818, 0.007, 0, 0.66, 0.7391, 322, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "kr_integral", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "kr_integral = 0.200"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L27_C0", "label": "kr_init_integral =", "type": "assigned_variable", "loc": [27, 27], "level": 0, "parent": null, "vector": [14, 0, 0.1888, 0.007, 0, 0.66, 0.7826, 101, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "kr_init_integral", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "kr_init_integral = 0.05"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L28_C0", "label": "kr_constant =", "type": "assigned_variable", "loc": [28, 28], "level": 0, "parent": null, "vector": [14, 0, 0.1958, 0.007, 0, 0.66, 0.8261, 264, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "kr_constant", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "kr_constant = 0.020"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L29_C0", "label": "kr_max_ctrl =", "type": "assigned_variable", "loc": [29, 29], "level": 0, "parent": null, "vector": [14, 0, 0.2028, 0.007, 0, 0.66, 0.8696, 944, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "kr_max_ctrl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "kr_max_ctrl = 0.40"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:ClassDef_L31_C0", "label": "PR2ArmCartVelocityController", "type": "class", "loc": [31, 114], "level": 0, "parent": null, "vector": [3, 0, 0.507, 0.5874, 0, 0.66, 0.913, 3, 0, 4, 0, 0, 186, 0, 42], "semantic": {"name": "PR2ArmCartVelocityController", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PR2ArmCartVelocityController(object):\n def __init__(self, arm, velocity_rot=None):\n self.arm = arm\n if velocity_rot is None:\n self.velocity_rot = np.mat(np.eye(3))\n else:\n self.velocity_rot = velocity_rot\n self._is_moving = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L32_C4", "label": "__init__", "type": "function", "loc": [32, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:ClassDef_L31_C0", "vector": [2, 1, 0.2483, 0.0559, 1, 0.39, 0.0, 555, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "arm", "velocity_rot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arm, velocity_rot=None):\n self.arm = arm\n if velocity_rot is None:\n self.velocity_rot = np.mat(np.eye(3))\n else:\n self.velocity_rot = velocity_rot\n self._is_moving = False\n self.lock = Lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L33_C8", "label": "self.arm =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L32_C4", "vector": [14, 2, 0.2308, 0.007, 2, 0.28, 0.0, 720, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm = arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L34_C8", "label": "if", "type": "if", "loc": [34, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L32_C4", "vector": [4, 2, 0.2483, 0.028, 2, 0.28, 0.3333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if velocity_rot is None:\n self.velocity_rot = np.mat(np.eye(3))\n else:\n self.velocity_rot = velocity_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L35_C12", "label": "self.velocity_rot = mat()", "type": "assigned_variable", "loc": [35, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L34_C8", "vector": [14, 3, 0.2448, 0.007, 3, 0.79, 0.0, 141, 3, 1, 0, 0, 882, 10, 2], "semantic": {"name": "self.velocity_rot", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " self.velocity_rot = np.mat(np.eye(3))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L37_C12", "label": "self.velocity_rot =", "type": "assigned_variable", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L34_C8", "vector": [14, 3, 0.2587, 0.007, 3, 0.79, 1.0, 141, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.velocity_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.velocity_rot = velocity_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L38_C8", "label": "self._is_moving =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L32_C4", "vector": [14, 2, 0.2657, 0.007, 2, 0.28, 0.6667, 335, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._is_moving", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._is_moving = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L39_C8", "label": "self.lock = Lock()", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L32_C4", "vector": [14, 2, 0.2727, 0.007, 2, 0.28, 1.0, 45, 3, 0, 0, 0, 843, 10, 1], "semantic": {"name": "self.lock", "arg_names": [], "import_names": [], "rhs_call_name": "Lock", "annotation": ""}, "snippet": " self.lock = Lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L41_C4", "label": "update_velocity_rot", "type": "function", "loc": [41, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:ClassDef_L31_C0", "vector": [2, 1, 0.2937, 0.021, 1, 0.39, 0.3333, 922, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "update_velocity_rot", "arg_names": ["self", "velocity_rot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update_velocity_rot(self, velocity_rot):\n with self.lock:\n self.velocity_rot = np.mat(velocity_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L43_C12", "label": "self.velocity_rot = mat()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L41_C4", "vector": [14, 2, 0.3007, 0.007, 2, 0.96, 0.0, 141, 3, 1, 0, 0, 882, 10, 1], "semantic": {"name": "self.velocity_rot", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " self.velocity_rot = np.mat(velocity_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L45_C4", "label": "move_velocity", "type": "function", "loc": [45, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:ClassDef_L31_C0", "vector": [2, 1, 0.5455, 0.4685, 1, 0.39, 0.6667, 94, 0, 4, 0, 0, 0, 0, 38], "semantic": {"name": "move_velocity", "arg_names": ["self", "velocity", "is_translation", "velocity_rot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_velocity(self, velocity=0.015, is_translation=True, velocity_rot=None):\n if velocity_rot is not None:\n self.update_velocity_rot(velocity_rot)\n pos_i_des, rot_i_des = self.arm.get_ep()\n pos_i_act, rot_i_act = self.arm.get_end_effector_pose()\n\n # this is the current residiual error in the controller at the start\n pos_err = pos_i_act - pos_i_des "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L46_C8", "label": "if", "type": "if", "loc": [46, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L45_C4", "vector": [4, 2, 0.3252, 0.014, 2, 0.49, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if velocity_rot is not None:\n self.update_velocity_rot(velocity_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L47_C12", "label": "update_velocity_rot()", "type": "expression", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L46_C8", "vector": [8, 3, 0.3287, 0.007, 3, 0.06, 0.0, 922, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update_velocity_rot", "arg_names": [], "import_names": [], "rhs_call_name": "update_velocity_rot", "annotation": ""}, "snippet": " self.update_velocity_rot(velocity_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L48_C8", "label": "pos_i_des, rot_i_des = get_ep()", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L45_C4", "vector": [14, 2, 0.3357, 0.007, 2, 0.49, 0.1, 115, 3, 0, 0, 0, 563, 10, 1], "semantic": {"name": "pos_i_des, rot_i_des", "arg_names": [], "import_names": [], "rhs_call_name": "get_ep", "annotation": ""}, "snippet": " pos_i_des, rot_i_des = self.arm.get_ep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L49_C8", "label": "pos_i_act, rot_i_act = get_end_effector_pose()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L45_C4", "vector": [14, 2, 0.3427, 0.007, 2, 0.49, 0.2, 534, 3, 0, 0, 0, 254, 10, 1], "semantic": {"name": "pos_i_act, rot_i_act", "arg_names": [], "import_names": [], "rhs_call_name": "get_end_effector_pose", "annotation": ""}, "snippet": " pos_i_act, rot_i_act = self.arm.get_end_effector_pose()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L52_C8", "label": "pos_err =", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L45_C4", "vector": [14, 2, 0.3636, 0.007, 2, 0.49, 0.3, 317, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos_err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos_err = pos_i_act - pos_i_des "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L53_C8", "label": "rot_err =", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L45_C4", "vector": [14, 2, 0.3706, 0.007, 2, 0.49, 0.4, 632, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rot_err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_err = rot_i_act.T * rot_i_des"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L55_C8", "label": "if", "type": "if", "loc": [55, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L45_C4", "vector": [4, 2, 0.4301, 0.0979, 2, 0.49, 0.5, 0, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if is_translation:\n pos_vel_des = velocity\n pid_ctrl = PIDController(rate=rate, k_p=kp_proportional, k_i=kp_integral, \n i_max=None, init_integ=np.sign(pos_vel_des) * kp_init_integral, \n saturation=kp_max_ctrl, \n feed_forward=np.sign(pos_vel_des) * kp_constant,\n name=\"arm_vel\")\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L56_C12", "label": "pos_vel_des =", "type": "assigned_variable", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L55_C8", "vector": [14, 3, 0.3916, 0.007, 3, 0.19, 0.0, 110, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos_vel_des", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos_vel_des = velocity"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L57_C12", "label": "pid_ctrl = PIDController()", "type": "assigned_variable", "loc": [57, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L55_C8", "vector": [14, 3, 0.4126, 0.035, 3, 0.19, 0.3333, 99, 3, 8, 0, 0, 15, 10, 3], "semantic": {"name": "pid_ctrl", "arg_names": [], "import_names": [], "rhs_call_name": "PIDController", "annotation": ""}, "snippet": " pid_ctrl = PIDController(rate=rate, k_p=kp_proportional, k_i=kp_integral, \n i_max=None, init_integ=np.sign(pos_vel_des) * kp_init_integral, \n saturation=kp_max_ctrl, \n feed_forward=np.sign(pos_vel_des) * kp_constant,\n name=\"arm_vel\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L63_C12", "label": "rot_vel_des =", "type": "assigned_variable", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L55_C8", "vector": [14, 3, 0.4406, 0.007, 3, 0.19, 0.6667, 935, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rot_vel_des", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_vel_des = velocity"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L64_C12", "label": "pid_ctrl = PIDController()", "type": "assigned_variable", "loc": [64, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L55_C8", "vector": [14, 3, 0.4615, 0.035, 3, 0.19, 1.0, 99, 3, 8, 0, 0, 15, 10, 3], "semantic": {"name": "pid_ctrl", "arg_names": [], "import_names": [], "rhs_call_name": "PIDController", "annotation": ""}, "snippet": " pid_ctrl = PIDController(rate=rate, k_p=kr_proportional, k_i=kr_integral, \n i_max=None, init_integ=np.sign(rot_vel_des) * kr_init_integral, \n saturation=kr_max_ctrl, \n feed_forward=np.sign(rot_vel_des) * kr_constant,\n name=\"arm_vel\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L69_C8", "label": "vels = deque()", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L45_C4", "vector": [14, 2, 0.4825, 0.007, 2, 0.49, 0.6, 813, 3, 1, 0, 0, 650, 10, 2], "semantic": {"name": "vels", "arg_names": [], "import_names": [], "rhs_call_name": "deque", "annotation": ""}, "snippet": " vels = deque([np.array([0]*6)]*40)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L70_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L45_C4", "vector": [14, 2, 0.4895, 0.007, 2, 0.49, 0.7, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " r = rospy.Rate(rate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L71_C8", "label": "self._is_moving =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L45_C4", "vector": [14, 2, 0.4965, 0.007, 2, 0.49, 0.8, 335, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._is_moving", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._is_moving = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "label": "while", "type": "while", "loc": [72, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L45_C4", "vector": [5, 2, 0.6364, 0.2727, 2, 0.49, 0.9, 0, 0, 0, 0, 0, 0, 0, 24], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown() and self._is_moving:\n with self.lock:\n vel_rot = self.velocity_rot.copy()\n cur_pos, cur_rot = self.arm.get_end_effector_pose()\n\n # hacky velocity filter\n xd_act = self.arm.get_controller_state()['xd_act']\n vels.append(xd_act)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L74_C16", "label": "vel_rot = copy()", "type": "assigned_variable", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "vector": [14, 3, 0.5175, 0.007, 3, 0.53, 0.0, 814, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "vel_rot", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " vel_rot = self.velocity_rot.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L75_C12", "label": "cur_pos, cur_rot = get_end_effector_pose()", "type": "assigned_variable", "loc": [75, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "vector": [14, 3, 0.5245, 0.007, 3, 0.53, 0.0, 610, 3, 0, 0, 0, 254, 10, 1], "semantic": {"name": "cur_pos, cur_rot", "arg_names": [], "import_names": [], "rhs_call_name": "get_end_effector_pose", "annotation": ""}, "snippet": " cur_pos, cur_rot = self.arm.get_end_effector_pose()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L78_C12", "label": "xd_act =", "type": "assigned_variable", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "vector": [14, 3, 0.5455, 0.007, 3, 0.53, 0.1, 346, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "xd_act", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xd_act = self.arm.get_controller_state()['xd_act']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L79_C12", "label": "append()", "type": "expression", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "vector": [8, 3, 0.5524, 0.007, 3, 0.53, 0.2, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " vels.append(xd_act)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L80_C12", "label": "popleft()", "type": "expression", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "vector": [8, 3, 0.5594, 0.007, 3, 0.53, 0.3, 285, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "popleft", "arg_names": [], "import_names": [], "rhs_call_name": "popleft", "annotation": ""}, "snippet": " vels.popleft()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L81_C12", "label": "vel_filt =", "type": "assigned_variable", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "vector": [14, 3, 0.5664, 0.007, 3, 0.53, 0.4, 895, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "vel_filt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vel_filt = np.mat(np.mean(vels, 0)).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L82_C12", "label": "x_vel_filt =", "type": "assigned_variable", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "vector": [14, 3, 0.5734, 0.007, 3, 0.53, 0.5, 104, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_vel_filt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_vel_filt = (vel_rot.T * vel_filt[:3,0])[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L83_C12", "label": "roll_vel_filt =", "type": "assigned_variable", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "vector": [14, 3, 0.5804, 0.007, 3, 0.53, 0.6, 744, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "roll_vel_filt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " roll_vel_filt = (vel_rot.T * vel_filt[3:,0])[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L85_C12", "label": "if", "type": "if", "loc": [85, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "vector": [4, 3, 0.6189, 0.0559, 3, 0.53, 0.7, 0, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if is_translation:\n # PI velocity controller for position\n pos_ctrl = pid_ctrl.update_state(pos_vel_des - x_vel_filt)\n pos_des = vel_rot * (np.mat([pos_ctrl, 0, 0]).T + \n np.mat(np.diag([1, 0, 0])) * vel_rot.T * (cur_pos - pos_err) +\n np.mat(np.diag([0, 1, 1])) * vel_rot.T * pos_i_des)\n\n rot_des = rot_i_des # don't change rotation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L87_C16", "label": "pos_ctrl = update_state()", "type": "assigned_variable", "loc": [87, 87], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L85_C12", "vector": [14, 4, 0.6084, 0.007, 4, 0.88, 0.0, 524, 3, 1, 0, 0, 502, 10, 1], "semantic": {"name": "pos_ctrl", "arg_names": [], "import_names": [], "rhs_call_name": "update_state", "annotation": ""}, "snippet": " pos_ctrl = pid_ctrl.update_state(pos_vel_des - x_vel_filt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L88_C16", "label": "pos_des =", "type": "assigned_variable", "loc": [88, 90], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L85_C12", "vector": [14, 4, 0.6224, 0.021, 4, 0.88, 0.5, 942, 4, 0, 0, 0, 0, 0, 5], "semantic": {"name": "pos_des", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos_des = vel_rot * (np.mat([pos_ctrl, 0, 0]).T + \n np.mat(np.diag([1, 0, 0])) * vel_rot.T * (cur_pos - pos_err) +\n np.mat(np.diag([0, 1, 1])) * vel_rot.T * pos_i_des)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L92_C16", "label": "rot_des =", "type": "assigned_variable", "loc": [92, 92], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L85_C12", "vector": [14, 4, 0.6434, 0.007, 4, 0.88, 1.0, 287, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rot_des", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_des = rot_i_des # don't change rotation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L94_C12", "label": "if", "type": "if", "loc": [94, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "vector": [4, 3, 0.7028, 0.0979, 3, 0.53, 0.8, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not is_translation:\n rot_des_vel_frame = np.mat(np.eye(4))\n rot_des_vel_frame[:3,:3] = cur_rot * rot_err * vel_rot\n roll_des_vel_frame, r2, r3 = tf_trans.euler_from_matrix(rot_des_vel_frame)\n\n # PI velocity controller for rotation\n rot_ctrl = pid_ctrl.update_state(rot_vel_des + roll_vel_filt)\n print(roll_vel_filt, rot_vel_des, rot_vel_des - roll_vel_filt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L95_C16", "label": "rot_des_vel_frame = mat()", "type": "assigned_variable", "loc": [95, 95], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L94_C12", "vector": [14, 4, 0.6643, 0.007, 4, 0.07, 0.0, 725, 3, 1, 0, 0, 882, 10, 2], "semantic": {"name": "rot_des_vel_frame", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " rot_des_vel_frame = np.mat(np.eye(4))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L96_C16", "label": "assign", "type": "assigned_variable", "loc": [96, 96], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L94_C12", "vector": [14, 4, 0.6713, 0.007, 4, 0.07, 0.125, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_des_vel_frame[:3,:3] = cur_rot * rot_err * vel_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L97_C16", "label": "roll_des_vel_frame, r2, r3 = euler_from_matrix()", "type": "assigned_variable", "loc": [97, 97], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L94_C12", "vector": [14, 4, 0.6783, 0.007, 4, 0.07, 0.25, 916, 3, 1, 0, 0, 341, 10, 1], "semantic": {"name": "roll_des_vel_frame, r2, r3", "arg_names": [], "import_names": [], "rhs_call_name": "euler_from_matrix", "annotation": ""}, "snippet": " roll_des_vel_frame, r2, r3 = tf_trans.euler_from_matrix(rot_des_vel_frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L100_C16", "label": "rot_ctrl = update_state()", "type": "assigned_variable", "loc": [100, 100], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L94_C12", "vector": [14, 4, 0.6993, 0.007, 4, 0.07, 0.375, 151, 3, 1, 0, 0, 502, 10, 1], "semantic": {"name": "rot_ctrl", "arg_names": [], "import_names": [], "rhs_call_name": "update_state", "annotation": ""}, "snippet": " rot_ctrl = pid_ctrl.update_state(rot_vel_des + roll_vel_filt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L101_C16", "label": "print()", "type": "expression", "loc": [101, 101], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L94_C12", "vector": [8, 4, 0.7063, 0.007, 4, 0.07, 0.5, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(roll_vel_filt, rot_vel_des, rot_vel_des - roll_vel_filt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L103_C16", "label": "roll_ctrl_des =", "type": "assigned_variable", "loc": [103, 103], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L94_C12", "vector": [14, 4, 0.7203, 0.007, 4, 0.07, 0.625, 728, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "roll_ctrl_des", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " roll_ctrl_des = roll_des_vel_frame + rot_ctrl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L104_C16", "label": "r1, pitch_i_des, yaw_i_des = euler_from_matrix()", "type": "assigned_variable", "loc": [104, 104], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L94_C12", "vector": [14, 4, 0.7273, 0.007, 4, 0.07, 0.75, 89, 3, 1, 0, 0, 341, 10, 1], "semantic": {"name": "r1, pitch_i_des, yaw_i_des", "arg_names": [], "import_names": [], "rhs_call_name": "euler_from_matrix", "annotation": ""}, "snippet": " r1, pitch_i_des, yaw_i_des = tf_trans.euler_from_matrix(rot_i_des * vel_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L105_C16", "label": "rot_des =", "type": "assigned_variable", "loc": [105, 105], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L94_C12", "vector": [14, 4, 0.7343, 0.007, 4, 0.07, 0.875, 287, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "rot_des", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_des = np.mat(tf_trans.euler_matrix(roll_ctrl_des, pitch_i_des, yaw_i_des)[:3,:3]) * vel_rot.T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L107_C16", "label": "pos_des =", "type": "assigned_variable", "loc": [107, 107], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L94_C12", "vector": [14, 4, 0.7483, 0.007, 4, 0.07, 1.0, 942, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos_des", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos_des = pos_i_des # don't change translation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L109_C12", "label": "set_ep()", "type": "expression", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "vector": [8, 3, 0.7622, 0.007, 3, 0.53, 0.9, 547, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_ep", "arg_names": [], "import_names": [], "rhs_call_name": "set_ep", "annotation": ""}, "snippet": " self.arm.set_ep((pos_des, rot_des), 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L110_C12", "label": "sleep()", "type": "expression", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "vector": [8, 3, 0.7692, 0.007, 3, 0.53, 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_99298:Expr_L111_C8", "label": "set_ep()", "type": "expression", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L45_C4", "vector": [8, 2, 0.7762, 0.007, 2, 0.49, 1.0, 547, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "set_ep", "arg_names": [], "import_names": [], "rhs_call_name": "set_ep", "annotation": ""}, "snippet": " self.arm.set_ep(self.arm.get_ep(), 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L113_C4", "label": "stop_moving", "type": "function", "loc": [113, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:ClassDef_L31_C0", "vector": [2, 1, 0.7937, 0.014, 1, 0.39, 1.0, 744, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "stop_moving", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop_moving(self):\n self._is_moving = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L114_C8", "label": "self._is_moving =", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L113_C4", "vector": [14, 2, 0.7972, 0.007, 2, 0.16, 0.0, 335, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._is_moving", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._is_moving = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L116_C0", "label": "main", "type": "function", "loc": [116, 139], "level": 0, "parent": null, "vector": [2, 0, 0.8916, 0.1678, 0, 0.66, 0.9565, 624, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n rospy.init_node(\"arm_cart_vel_control\")\n if True:\n ctrl_switcher = ControllerSwitcher()\n ctrl_switcher.carefree_switch('r', '%s_arm_controller', \n '$(find hrl_pr2_arms)/params/joint_traj_params_electric.yaml')\n rospy.sleep(0.5)\n ctrl_switcher.carefree_switch('r', '%s_joint_controller_low', "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L117_C4", "label": "init_node()", "type": "expression", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L116_C0", "vector": [8, 1, 0.8182, 0.007, 1, 0.13, 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(\"arm_cart_vel_control\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L118_C4", "label": "if", "type": "if", "loc": [118, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L116_C0", "vector": [4, 1, 0.8671, 0.0909, 1, 0.13, 0.1429, 0, 1, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if True:\n ctrl_switcher = ControllerSwitcher()\n ctrl_switcher.carefree_switch('r', '%s_arm_controller', \n '$(find hrl_pr2_arms)/params/joint_traj_params_electric.yaml')\n rospy.sleep(0.5)\n ctrl_switcher.carefree_switch('r', '%s_joint_controller_low', \n '$(find hrl_pr2_arms)/params/joint_traj_params_electric_low.yaml')\n r_arm_js = create_pr2_arm('r', PR2ArmJointTrajectory, controller_name='%s_joint_controller_low')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L119_C8", "label": "ctrl_switcher = ControllerSwitcher()", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L118_C4", "vector": [14, 2, 0.8322, 0.007, 2, 0.86, 0.0, 220, 3, 0, 0, 0, 961, 10, 1], "semantic": {"name": "ctrl_switcher", "arg_names": [], "import_names": [], "rhs_call_name": "ControllerSwitcher", "annotation": ""}, "snippet": " ctrl_switcher = ControllerSwitcher()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L120_C8", "label": "carefree_switch()", "type": "expression", "loc": [120, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L118_C4", "vector": [8, 2, 0.8427, 0.014, 2, 0.86, 0.125, 300, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "carefree_switch", "arg_names": [], "import_names": [], "rhs_call_name": "carefree_switch", "annotation": ""}, "snippet": " ctrl_switcher.carefree_switch('r', '%s_arm_controller', \n '$(find hrl_pr2_arms)/params/joint_traj_params_electric.yaml')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L122_C8", "label": "sleep()", "type": "expression", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L118_C4", "vector": [8, 2, 0.8531, 0.007, 2, 0.86, 0.25, 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_99298:Expr_L123_C8", "label": "carefree_switch()", "type": "expression", "loc": [123, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L118_C4", "vector": [8, 2, 0.8636, 0.014, 2, 0.86, 0.375, 300, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "carefree_switch", "arg_names": [], "import_names": [], "rhs_call_name": "carefree_switch", "annotation": ""}, "snippet": " ctrl_switcher.carefree_switch('r', '%s_joint_controller_low', \n '$(find hrl_pr2_arms)/params/joint_traj_params_electric_low.yaml')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L125_C8", "label": "r_arm_js = create_pr2_arm()", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L118_C4", "vector": [14, 2, 0.8741, 0.007, 2, 0.86, 0.5, 965, 3, 3, 0, 0, 318, 10, 1], "semantic": {"name": "r_arm_js", "arg_names": [], "import_names": [], "rhs_call_name": "create_pr2_arm", "annotation": ""}, "snippet": " r_arm_js = create_pr2_arm('r', PR2ArmJointTrajectory, controller_name='%s_joint_controller_low')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L126_C8", "label": "q =", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L118_C4", "vector": [14, 2, 0.8811, 0.007, 2, 0.86, 0.625, 516, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q = [-0.34781704, 0.27341079, -1.75392154, -2.08626393, -3.43756314, -1.82146607, -1.85187734]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L127_C8", "label": "set_ep()", "type": "expression", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L118_C4", "vector": [8, 2, 0.8881, 0.007, 2, 0.86, 0.75, 547, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_ep", "arg_names": [], "import_names": [], "rhs_call_name": "set_ep", "annotation": ""}, "snippet": " r_arm_js.set_ep(q, 3) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L128_C8", "label": "sleep()", "type": "expression", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L118_C4", "vector": [8, 2, 0.8951, 0.007, 2, 0.86, 0.875, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(6)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L129_C8", "label": "carefree_switch()", "type": "expression", "loc": [129, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L118_C4", "vector": [8, 2, 0.9056, 0.014, 2, 0.86, 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": " ctrl_switcher.carefree_switch('r', '%s_cart_low_rfh',\n '$(find kelsey_sandbox)/params/j_transpose_low_rfh.yaml')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L132_C4", "label": "r_arm = create_pr2_arm()", "type": "assigned_variable", "loc": [132, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L116_C0", "vector": [14, 1, 0.9231, 0.007, 1, 0.13, 0.2857, 315, 3, 2, 0, 0, 318, 10, 1], "semantic": {"name": "r_arm", "arg_names": [], "import_names": [], "rhs_call_name": "create_pr2_arm", "annotation": ""}, "snippet": " r_arm = create_pr2_arm('r', PR2ArmCartesianPostureBase)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L133_C4", "label": "set_posture()", "type": "expression", "loc": [133, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L116_C0", "vector": [8, 1, 0.9301, 0.007, 1, 0.13, 0.4286, 300, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_posture", "arg_names": [], "import_names": [], "rhs_call_name": "set_posture", "annotation": ""}, "snippet": " r_arm.set_posture()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L134_C4", "label": "sleep()", "type": "expression", "loc": [134, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L116_C0", "vector": [8, 1, 0.9371, 0.007, 1, 0.13, 0.5714, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(0.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L135_C4", "label": "vel_ctrl = PR2ArmCartVelocityController()", "type": "assigned_variable", "loc": [135, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L116_C0", "vector": [14, 1, 0.9441, 0.007, 1, 0.13, 0.7143, 202, 3, 1, 0, 0, 3, 10, 1], "semantic": {"name": "vel_ctrl", "arg_names": [], "import_names": [], "rhs_call_name": "PR2ArmCartVelocityController", "annotation": ""}, "snippet": " vel_ctrl = PR2ArmCartVelocityController(r_arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L138_C4", "label": "vel_frame =", "type": "assigned_variable", "loc": [138, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L116_C0", "vector": [14, 1, 0.965, 0.007, 1, 0.13, 0.8571, 321, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "vel_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vel_frame = tf_trans.euler_matrix(0, 0, np.pi/2)[:3,:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L139_C4", "label": "move_velocity()", "type": "expression", "loc": [139, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L116_C0", "vector": [8, 1, 0.972, 0.007, 1, 0.13, 1.0, 94, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "move_velocity", "arg_names": [], "import_names": [], "rhs_call_name": "move_velocity", "annotation": ""}, "snippet": " vel_ctrl.move_velocity(velocity_rot=vel_frame, velocity=0.10, is_translation=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L142_C0", "label": "if", "type": "if", "loc": [142, 143], "level": 0, "parent": null, "vector": [4, 0, 0.9965, 0.014, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L143_C4", "label": "main()", "type": "expression", "loc": [143, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L142_C0", "vector": [8, 1, 1.0, 0.007, 1, 0.9, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99298:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L34_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L35_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L34_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L46_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L74_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L85_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L87_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L85_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L88_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L85_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L92_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L94_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L94_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L95_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L94_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L96_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L94_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L97_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L94_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L100_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L94_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L101_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L94_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L103_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L94_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L104_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L94_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L105_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L94_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L107_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:While_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Assign_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:FunctionDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99298:If_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99298:Expr_L143_C4"}]
#!/usr/bin/python import numpy as np import functools import roslib roslib.load_manifest('hrl_pr2_arms') roslib.load_manifest('smach_ros') roslib.load_manifest('costmap_services') import rospy import smach import smach_ros from std_msgs.msg import Bool, Int8 from hrl_pr2_arms.pr2_arm import create_pr2_arm, PR2ArmJointTrajectory from costmap_services.python_client import CostmapServices from pr2_viz_servo import PR2VisualServoAR outcomes_spa = ['succeeded','preempted','aborted'] #viz_servo_goals = { # "r_pr2_ar_pose_marker" : [0.57226345, 0.32838129, -1.15480113], # "l_pr2_ar_pose_marker" : [0.57903398, 0.44215034, -0.76362254]} #"l_pr2_ar_pose_marker" : [0.59739709, 0.39469539, -0.7088098]} class ServoStates: BEGIN_FIND_TAG = 1 FOUND_TAG = 2 TIMEOUT_FIND_TAG = 3 BEGIN_SERVO = 4 SUCCESS_SERVO = 5 ARM_COLLISION = 6 LASER_COLLISION = 7 LOST_TAG = 8 USER_PREEMPT = 9 class ArmCollisionDetection(smach.State): def __init__(self, min_l_torques=[-5.]*7, min_r_torques=[-5.]*7, max_l_torques=[5.]*7, max_r_torques=[5.]*7): smach.State.__init__(self, outcomes=['collision', 'preempted', 'aborted']) self.min_l_tor = np.array(min_l_torques) self.min_r_tor = np.array(min_r_torques) self.max_l_tor = np.array(max_l_torques) self.max_r_tor = np.array(max_r_torques) self.l_arm = create_pr2_arm('l', PR2ArmJointTrajectory, timeout=0) self.r_arm = create_pr2_arm('r', PR2ArmJointTrajectory, timeout=0) def execute(self, userdata): r = rospy.Rate(20) while not rospy.is_shutdown(): l_tor = self.l_arm.get_joint_efforts() r_tor = self.r_arm.get_joint_efforts() if np.any(l_tor < self.min_l_tor): print "Collision detected on left arm with torque:", l_tor print "Minimum torques:", self.min_l_tor return 'collision' if np.any(l_tor > self.max_l_tor): print "Collision detected on left arm with torque:", l_tor print "Maximum torques:", self.max_l_tor return 'collision' if np.any(r_tor < self.min_r_tor): print "Collision detected on right arm with torque:", r_tor print "Minimum torques:", self.min_r_tor return 'collision' if np.any(r_tor > self.max_r_tor): print "Collision detected on right arm with torque:", r_tor print "Minimum torques:", self.max_r_tor return 'collision' if self.preempt_requested(): self.service_preempt() return 'preempted' r.sleep() return 'aborted' class LaserCollisionDetection(smach.State): def __init__(self): smach.State.__init__(self, outcomes=['collision', 'preempted', 'aborted']) self.cs = CostmapServices(accum=3) def execute(self, userdata): r = rospy.Rate(20) while not rospy.is_shutdown(): vx, vy, vtheta = 0., 0., 0. #TODO REMOVE score = self.cs.scoreTraj_PosHyst(vx, vy, vtheta) # TODO if score < 0: print "Base laser detected a collision." return 'collision' if self.preempt_requested(): self.service_preempt() return 'preempted' r.sleep() return 'aborted' def build_cc_servoing(viz_servos): def term_cb(outcome_map): return True def out_cb(outcome_map): if outcome_map['ARM_COLLISION_DETECTION'] == 'collision': return 'arm_collision' if outcome_map['LASER_COLLISION_DETECTION'] == 'collision': return 'laser_collision' if outcome_map['USER_PREEMPT_DETECTION'] == 'true': return 'user_preempted' if outcome_map['USER_PREEMPT_DETECTION'] == 'false': return 'aborted' return outcome_map['SERVOING'] cc_servoing = smach.Concurrence( outcomes=outcomes_spa+ ['arm_collision', 'laser_collision', 'lost_tag', 'user_preempted'], input_keys=['goal_ar_pose', 'initial_ar_pose', 'servo_topic'], default_outcome='aborted', child_termination_cb=term_cb, outcome_cb=out_cb) with cc_servoing: smach.Concurrence.add('SERVOING', ServoARTagState(viz_servos)) smach.Concurrence.add('ARM_COLLISION_DETECTION', ArmCollisionDetection()) smach.Concurrence.add('LASER_COLLISION_DETECTION', LaserCollisionDetection()) smach.Concurrence.add('USER_PREEMPT_DETECTION', BoolTopicState("/pr2_ar_servo/preempt")) return cc_servoing class BoolTopicState(smach.State): def __init__(self, topic, rate=20): smach.State.__init__(self, outcomes=['true', 'false', 'preempted', 'aborted']) self.rate = rate self.ui_list = rospy.Subscriber(topic, Bool, self.ui_cb) def ui_cb(self, msg): self.bool_msg = msg.data self.got_msg = True def execute(self, userdata): self.got_msg = False r = rospy.Rate(self.rate) while not rospy.is_shutdown(): if self.got_msg: if self.bool_msg: return 'true' else: return 'false' if self.preempt_requested(): self.service_preempt() return 'preempted' r.sleep() return 'aborted' class PublishState(smach.State): def __init__(self, topic, msg_type, msg): smach.State.__init__(self, outcomes=['succeeded']) self.pub = rospy.Publisher(topic, msg_type) self.msg = msg def execute(self, userdata): self.pub.publish(self.msg) return 'succeeded' class FindARTagState(smach.State): def __init__(self, viz_servos, viz_servo_goals, timeout=6.): smach.State.__init__(self, outcomes=['found_tag', 'timeout', 'preempted', 'aborted'], output_keys=['initial_ar_pose', 'goal_ar_pose', 'servo_topic']) self.viz_servos = viz_servos self.viz_servo_goals = viz_servo_goals self.timeout = timeout def execute(self, userdata): # This is just a mess. # Figure this out and rewrite it... def check_preempt(event): if self.preempt_requested(): self.service_preempt() for topic in self.viz_servos: self.viz_servos[topic].request_preempt() preempt_timer = rospy.Timer(rospy.Duration(0.1), check_preempt) self.outcome_dict = {} def call_find_ar_tag(te, viz_servo, fart_state, topic): mean_ar, outcome = viz_servo.find_ar_tag(self.timeout) self.outcome_dict[topic] = (mean_ar, outcome) if outcome == "found_tag": self.request_preempt() for topic in self.viz_servos: call_find_ar_tag_filled = functools.partial(call_find_ar_tag, viz_servo=self.viz_servos[topic], fart_state=self, topic=topic) rospy.Timer(rospy.Duration(0.01), call_find_ar_tag_filled, oneshot=True) while not rospy.is_shutdown(): if self.preempt_requested() or len(self.outcome_dict) == len(self.viz_servos): break rospy.sleep(0.05) outcome = "timeout" for topic in self.outcome_dict: if self.outcome_dict[topic][1] == "found_tag": userdata['initial_ar_pose'] = self.outcome_dict[topic][0] userdata['goal_ar_pose'] = self.viz_servo_goals[topic] userdata['servo_topic'] = topic outcome = "found_tag" # FIXME I should be shot for these lines: FIXME if topic == "r_pr2_ar_pose_marker": rospy.set_param("/shaving_side", 'r') else: rospy.set_param("/shaving_side", 'l') ################################################## break preempt_timer.shutdown() return outcome class ServoARTagState(smach.State): def __init__(self, viz_servos): smach.State.__init__(self, outcomes=['lost_tag'] + outcomes_spa, input_keys=['goal_ar_pose', 'initial_ar_pose', 'servo_topic']) self.viz_servos = viz_servos def execute(self, userdata): if 'initial_ar_pose' in userdata: initial_ar_pose = userdata.initial_ar_pose else: rospy.logerr("Initial AR pose should be in userdata") initial_ar_pose = None servo_topic = userdata['servo_topic'] def check_preempt(event): if self.preempt_requested(): self.service_preempt() self.viz_servos[servo_topic].request_preempt() preempt_timer = rospy.Timer(rospy.Duration(0.1), check_preempt) self.viz_servos[servo_topic].preempt_requested = False outcome = self.viz_servos[servo_topic].servo_to_tag(pose_goal=userdata.goal_ar_pose, initial_ar_pose=initial_ar_pose) preempt_timer.shutdown() return outcome def build_full_sm(viz_servo_goals): find_tag_timeout = 6. viz_servos = {} for viz_servo_topic in viz_servo_goals: viz_servos[viz_servo_topic] = PR2VisualServoAR(viz_servo_topic) sm_pr2_servoing = smach.StateMachine(outcomes=outcomes_spa, input_keys=['goal_ar_pose', 'initial_ar_pose']) with sm_pr2_servoing: smach.StateMachine.add('UI_FIND_TAG_WAIT', BoolTopicState("/pr2_ar_servo/find_tag"), transitions={'true' : 'BEGIN_FIND_TAG', 'false' : 'aborted'}) smach.StateMachine.add('BEGIN_FIND_TAG', PublishState("/pr2_ar_servo/state_feedback", Int8, Int8(ServoStates.BEGIN_FIND_TAG)), transitions={'succeeded' : 'FIND_AR_TAG'}) smach.StateMachine.add('FIND_AR_TAG', FindARTagState(viz_servos, viz_servo_goals, timeout=find_tag_timeout), transitions={'found_tag' : 'FOUND_TAG', 'timeout' : 'TIMEOUT_FIND_TAG'}) smach.StateMachine.add('FOUND_TAG', PublishState("/pr2_ar_servo/state_feedback", Int8, Int8(ServoStates.FOUND_TAG)), transitions={'succeeded' : 'UI_SERVO_WAIT'}) smach.StateMachine.add('TIMEOUT_FIND_TAG', PublishState("/pr2_ar_servo/state_feedback", Int8, Int8(ServoStates.TIMEOUT_FIND_TAG)), transitions={'succeeded' : 'UI_FIND_TAG_WAIT'}) smach.StateMachine.add('UI_SERVO_WAIT', BoolTopicState("/pr2_ar_servo/tag_confirm"), transitions={'true' : 'BEGIN_SERVO', 'false' : 'UI_FIND_TAG_WAIT'}) smach.StateMachine.add('BEGIN_SERVO', PublishState("/pr2_ar_servo/state_feedback", Int8, Int8(ServoStates.BEGIN_SERVO)), transitions={'succeeded' : 'CC_SERVOING'}) smach.StateMachine.add('CC_SERVOING', build_cc_servoing(viz_servos), transitions={'arm_collision' : 'ARM_COLLISION', 'laser_collision' : 'LASER_COLLISION', 'user_preempted' : 'USER_PREEMPT', 'lost_tag' : 'LOST_TAG', 'succeeded' : 'SUCCESS_SERVO'}) smach.StateMachine.add('SUCCESS_SERVO', PublishState("/pr2_ar_servo/state_feedback", Int8, Int8(ServoStates.SUCCESS_SERVO)), transitions={'succeeded' : 'UI_FIND_TAG_WAIT'}) smach.StateMachine.add('ARM_COLLISION', PublishState("/pr2_ar_servo/state_feedback", Int8, Int8(ServoStates.ARM_COLLISION)), transitions={'succeeded' : 'UI_FIND_TAG_WAIT'}) smach.StateMachine.add('LASER_COLLISION', PublishState("/pr2_ar_servo/state_feedback", Int8, Int8(ServoStates.LASER_COLLISION)), transitions={'succeeded' : 'UI_FIND_TAG_WAIT'}) smach.StateMachine.add('LOST_TAG', PublishState("/pr2_ar_servo/state_feedback", Int8, Int8(ServoStates.LOST_TAG)), transitions={'succeeded' : 'UI_FIND_TAG_WAIT'}) smach.StateMachine.add('USER_PREEMPT', PublishState("/pr2_ar_servo/state_feedback", Int8, Int8(ServoStates.USER_PREEMPT)), transitions={'succeeded' : 'UI_FIND_TAG_WAIT'}) return sm_pr2_servoing def build_test_sm(): viz_servo = PR2VisualServoAR("r_pr2_ar_pose_marker") sm_only_servo = smach.StateMachine(outcomes=['lost_tag'] + outcomes_spa, input_keys=['goal_ar_pose', 'initial_ar_pose']) with sm_only_servo: smach.StateMachine.add('ONLY_SERVO', ServoARTagState(viz_servo)) return sm_only_servo def main(): rospy.init_node("sm_pr2_servoing") userdata = smach.user_data.UserData() # old testing #userdata['goal_ar_pose'] = [ 0.57160106, -0.4300153 , -1.70840111] # both sides spot? userdata['goal_ar_pose'] = [ 0.57226345, 0.32838129, -1.15480113] viz_servo_goals = rospy.get_param("~ar_servo_poses", {}) print viz_servo_goals if True: sm_pr2_servoing = build_full_sm(viz_servo_goals) sis = smach_ros.IntrospectionServer('pr2_servo', sm_pr2_servoing, 'UI_FIND_TAG_WAIT') sis.start() sm_pr2_servoing.execute(userdata) sis.stop() else: sm_test = build_test_sm() rospy.sleep(4) sm_test.execute(userdata) if __name__ == "__main__": main()
ajibawa-2023/Python-Code-Large/train/row_99299
222
362
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0083, 0.0028, 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_99299:Import_L4_C0", "label": "functools import functools", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.011, 0.0028, 0, 0.66, 0.04, 711, 0, 1, 0, 0, 711, 0, 0], "semantic": {"name": "functools", "arg_names": [], "import_names": ["functools"], "rhs_call_name": "", "annotation": ""}, "snippet": "import functools"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Import_L6_C0", "label": "roslib import roslib", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0166, 0.0028, 0, 0.66, 0.08, 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_99299:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0193, 0.0028, 0, 0.66, 0.12, 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_99299:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0221, 0.0028, 0, 0.66, 0.16, 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('smach_ros')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L9_C0", "label": "load_manifest()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0249, 0.0028, 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('costmap_services')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Import_L10_C0", "label": "rospy import rospy", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0276, 0.0028, 0, 0.66, 0.24, 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_99299:Import_L11_C0", "label": "smach import smach", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0304, 0.0028, 0, 0.66, 0.28, 345, 0, 1, 0, 0, 345, 0, 0], "semantic": {"name": "smach", "arg_names": [], "import_names": ["smach"], "rhs_call_name": "", "annotation": ""}, "snippet": "import smach"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Import_L12_C0", "label": "smach_ros import smach_ros", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0331, 0.0028, 0, 0.66, 0.32, 716, 0, 1, 0, 0, 716, 0, 0], "semantic": {"name": "smach_ros", "arg_names": [], "import_names": ["smach_ros"], "rhs_call_name": "", "annotation": ""}, "snippet": "import smach_ros"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:ImportFrom_L13_C0", "label": "from std_msgs.msg import Bool, Int8", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0359, 0.0028, 0, 0.66, 0.36, 366, 0, 2, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Bool", "Int8"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Bool, Int8"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:ImportFrom_L15_C0", "label": "from hrl_pr2_arms.pr2_arm import create_pr2_arm, PR2ArmJointTrajectory", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0414, 0.0028, 0, 0.66, 0.4, 253, 0, 2, 0, 0, 253, 0, 0], "semantic": {"name": "hrl_pr2_arms.pr2_arm", "arg_names": [], "import_names": ["create_pr2_arm", "PR2ArmJointTrajectory"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_pr2_arms.pr2_arm import create_pr2_arm, PR2ArmJointTrajectory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:ImportFrom_L16_C0", "label": "from costmap_services.python_client import CostmapServices", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0442, 0.0028, 0, 0.66, 0.44, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "costmap_services.python_client", "arg_names": [], "import_names": ["CostmapServices"], "rhs_call_name": "", "annotation": ""}, "snippet": "from costmap_services.python_client import CostmapServices"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:ImportFrom_L17_C0", "label": "from pr2_viz_servo import PR2VisualServoAR", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.047, 0.0028, 0, 0.66, 0.48, 417, 0, 1, 0, 0, 417, 0, 0], "semantic": {"name": "pr2_viz_servo", "arg_names": [], "import_names": ["PR2VisualServoAR"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_viz_servo import PR2VisualServoAR"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L19_C0", "label": "outcomes_spa =", "type": "assigned_variable", "loc": [19, 19], "level": 0, "parent": null, "vector": [14, 0, 0.0525, 0.0028, 0, 0.66, 0.52, 588, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "outcomes_spa", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "outcomes_spa = ['succeeded','preempted','aborted']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L26_C0", "label": "ServoStates", "type": "class", "loc": [26, 35], "level": 0, "parent": null, "vector": [3, 0, 0.0843, 0.0276, 0, 0.66, 0.56, 537, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ServoStates", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ServoStates:\n BEGIN_FIND_TAG = 1\n FOUND_TAG = 2\n TIMEOUT_FIND_TAG = 3\n BEGIN_SERVO = 4\n SUCCESS_SERVO = 5\n ARM_COLLISION = 6\n LASER_COLLISION = 7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L27_C4", "label": "BEGIN_FIND_TAG =", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L26_C0", "vector": [14, 1, 0.0746, 0.0028, 1, 0.23, 0.0, 151, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "BEGIN_FIND_TAG", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " BEGIN_FIND_TAG = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L28_C4", "label": "FOUND_TAG =", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L26_C0", "vector": [14, 1, 0.0773, 0.0028, 1, 0.23, 0.125, 827, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FOUND_TAG", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " FOUND_TAG = 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L29_C4", "label": "TIMEOUT_FIND_TAG =", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L26_C0", "vector": [14, 1, 0.0801, 0.0028, 1, 0.23, 0.25, 595, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "TIMEOUT_FIND_TAG", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " TIMEOUT_FIND_TAG = 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L30_C4", "label": "BEGIN_SERVO =", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L26_C0", "vector": [14, 1, 0.0829, 0.0028, 1, 0.23, 0.375, 434, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "BEGIN_SERVO", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " BEGIN_SERVO = 4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L31_C4", "label": "SUCCESS_SERVO =", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L26_C0", "vector": [14, 1, 0.0856, 0.0028, 1, 0.23, 0.5, 142, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "SUCCESS_SERVO", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " SUCCESS_SERVO = 5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L32_C4", "label": "ARM_COLLISION =", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L26_C0", "vector": [14, 1, 0.0884, 0.0028, 1, 0.23, 0.625, 395, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "ARM_COLLISION", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ARM_COLLISION = 6"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L33_C4", "label": "LASER_COLLISION =", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L26_C0", "vector": [14, 1, 0.0912, 0.0028, 1, 0.23, 0.75, 916, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "LASER_COLLISION", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " LASER_COLLISION = 7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L34_C4", "label": "LOST_TAG =", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L26_C0", "vector": [14, 1, 0.0939, 0.0028, 1, 0.23, 0.875, 26, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "LOST_TAG", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " LOST_TAG = 8"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L35_C4", "label": "USER_PREEMPT =", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L26_C0", "vector": [14, 1, 0.0967, 0.0028, 1, 0.23, 1.0, 901, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "USER_PREEMPT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " USER_PREEMPT = 9"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L37_C0", "label": "ArmCollisionDetection", "type": "class", "loc": [37, 74], "level": 0, "parent": null, "vector": [3, 0, 0.1533, 0.105, 0, 0.66, 0.6, 533, 0, 2, 0, 0, 892, 0, 26], "semantic": {"name": "ArmCollisionDetection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ArmCollisionDetection(smach.State):\n def __init__(self, min_l_torques=[-5.]*7, min_r_torques=[-5.]*7,\n max_l_torques=[5.]*7, max_r_torques=[5.]*7):\n smach.State.__init__(self, outcomes=['collision', 'preempted', 'aborted'])\n self.min_l_tor = np.array(min_l_torques)\n self.min_r_tor = np.array(min_r_torques)\n self.max_l_tor = np.array(max_l_torques)\n self.max_r_tor = np.array(max_r_torques)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L38_C4", "label": "__init__", "type": "function", "loc": [38, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L37_C0", "vector": [2, 1, 0.116, 0.0249, 1, 0.0, 0.0, 555, 0, 5, 0, 0, 0, 0, 7], "semantic": {"name": "__init__", "arg_names": ["self", "min_l_torques", "min_r_torques", "max_l_torques", "max_r_torques"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, min_l_torques=[-5.]*7, min_r_torques=[-5.]*7,\n max_l_torques=[5.]*7, max_r_torques=[5.]*7):\n smach.State.__init__(self, outcomes=['collision', 'preempted', 'aborted'])\n self.min_l_tor = np.array(min_l_torques)\n self.min_r_tor = np.array(min_r_torques)\n self.max_l_tor = np.array(max_l_torques)\n self.max_r_tor = np.array(max_r_torques)\n self.l_arm = create_pr2_arm('l', PR2ArmJointTrajectory, timeout=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L40_C8", "label": "__init__()", "type": "expression", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L38_C4", "vector": [8, 2, 0.1105, 0.0028, 2, 0.49, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " smach.State.__init__(self, outcomes=['collision', 'preempted', 'aborted'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L41_C8", "label": "self.min_l_tor = array()", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L38_C4", "vector": [14, 2, 0.1133, 0.0028, 2, 0.49, 0.1667, 943, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "self.min_l_tor", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " self.min_l_tor = np.array(min_l_torques)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L42_C8", "label": "self.min_r_tor = array()", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L38_C4", "vector": [14, 2, 0.116, 0.0028, 2, 0.49, 0.3333, 237, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "self.min_r_tor", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " self.min_r_tor = np.array(min_r_torques)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L43_C8", "label": "self.max_l_tor = array()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L38_C4", "vector": [14, 2, 0.1188, 0.0028, 2, 0.49, 0.5, 21, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "self.max_l_tor", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " self.max_l_tor = np.array(max_l_torques)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L44_C8", "label": "self.max_r_tor = array()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L38_C4", "vector": [14, 2, 0.1215, 0.0028, 2, 0.49, 0.6667, 45, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "self.max_r_tor", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " self.max_r_tor = np.array(max_r_torques)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L45_C8", "label": "self.l_arm = create_pr2_arm()", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L38_C4", "vector": [14, 2, 0.1243, 0.0028, 2, 0.49, 0.8333, 509, 3, 3, 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 = create_pr2_arm('l', PR2ArmJointTrajectory, timeout=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L46_C8", "label": "self.r_arm = create_pr2_arm()", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L38_C4", "vector": [14, 2, 0.1271, 0.0028, 2, 0.49, 1.0, 958, 3, 3, 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 = create_pr2_arm('r', PR2ArmJointTrajectory, timeout=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L48_C4", "label": "execute", "type": "function", "loc": [48, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L37_C0", "vector": [2, 1, 0.1685, 0.0746, 1, 0.0, 1.0, 569, 0, 2, 1, 0, 0, 0, 19], "semantic": {"name": "execute", "arg_names": ["self", "userdata"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute(self, userdata):\n r = rospy.Rate(20)\n while not rospy.is_shutdown():\n l_tor = self.l_arm.get_joint_efforts()\n r_tor = self.r_arm.get_joint_efforts()\n if np.any(l_tor < self.min_l_tor):\n print(\"Collision detected on left arm with torque:\", l_tor)\n print(\"Minimum torques:\", self.min_l_tor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L49_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L48_C4", "vector": [14, 2, 0.1354, 0.0028, 2, 0.63, 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(20)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L50_C8", "label": "while", "type": "while", "loc": [50, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L48_C4", "vector": [5, 2, 0.1699, 0.0663, 2, 0.63, 0.5, 0, 0, 0, 0, 0, 0, 0, 18], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n l_tor = self.l_arm.get_joint_efforts()\n r_tor = self.r_arm.get_joint_efforts()\n if np.any(l_tor < self.min_l_tor):\n print(\"Collision detected on left arm with torque:\", l_tor)\n print(\"Minimum torques:\", self.min_l_tor)\n return 'collision'\n if np.any(l_tor > self.max_l_tor):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L51_C12", "label": "l_tor = get_joint_efforts()", "type": "assigned_variable", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L50_C8", "vector": [14, 3, 0.1409, 0.0028, 3, 0.07, 0.0, 622, 3, 0, 0, 0, 228, 10, 1], "semantic": {"name": "l_tor", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_efforts", "annotation": ""}, "snippet": " l_tor = self.l_arm.get_joint_efforts()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L52_C12", "label": "r_tor = get_joint_efforts()", "type": "assigned_variable", "loc": [52, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L50_C8", "vector": [14, 3, 0.1436, 0.0028, 3, 0.07, 0.1429, 813, 3, 0, 0, 0, 228, 10, 1], "semantic": {"name": "r_tor", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_efforts", "annotation": ""}, "snippet": " r_tor = self.r_arm.get_joint_efforts()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L53_C12", "label": "if", "type": "if", "loc": [53, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L50_C8", "vector": [4, 3, 0.1506, 0.011, 3, 0.07, 0.2857, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.any(l_tor < self.min_l_tor):\n print(\"Collision detected on left arm with torque:\", l_tor)\n print(\"Minimum torques:\", self.min_l_tor)\n return 'collision'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L54_C16", "label": "print()", "type": "expression", "loc": [54, 54], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L53_C12", "vector": [8, 4, 0.1492, 0.0028, 4, 0.63, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Collision detected on left arm with torque:\", l_tor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L55_C16", "label": "print()", "type": "expression", "loc": [55, 55], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L53_C12", "vector": [8, 4, 0.1519, 0.0028, 4, 0.63, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Minimum torques:\", self.min_l_tor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L56_C16", "label": "return", "type": "return", "loc": [56, 56], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L53_C12", "vector": [13, 4, 0.1547, 0.0028, 4, 0.63, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'collision'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L57_C12", "label": "if", "type": "if", "loc": [57, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L50_C8", "vector": [4, 3, 0.1616, 0.011, 3, 0.07, 0.4286, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.any(l_tor > self.max_l_tor):\n print(\"Collision detected on left arm with torque:\", l_tor)\n print(\"Maximum torques:\", self.max_l_tor)\n return 'collision'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L58_C16", "label": "print()", "type": "expression", "loc": [58, 58], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L57_C12", "vector": [8, 4, 0.1602, 0.0028, 4, 0.35, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Collision detected on left arm with torque:\", l_tor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L59_C16", "label": "print()", "type": "expression", "loc": [59, 59], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L57_C12", "vector": [8, 4, 0.163, 0.0028, 4, 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(\"Maximum torques:\", self.max_l_tor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L60_C16", "label": "return", "type": "return", "loc": [60, 60], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L57_C12", "vector": [13, 4, 0.1657, 0.0028, 4, 0.35, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'collision'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L61_C12", "label": "if", "type": "if", "loc": [61, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L50_C8", "vector": [4, 3, 0.1727, 0.011, 3, 0.07, 0.5714, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.any(r_tor < self.min_r_tor):\n print(\"Collision detected on right arm with torque:\", r_tor)\n print(\"Minimum torques:\", self.min_r_tor)\n return 'collision'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L62_C16", "label": "print()", "type": "expression", "loc": [62, 62], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L61_C12", "vector": [8, 4, 0.1713, 0.0028, 4, 0.77, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Collision detected on right arm with torque:\", r_tor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L63_C16", "label": "print()", "type": "expression", "loc": [63, 63], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L61_C12", "vector": [8, 4, 0.174, 0.0028, 4, 0.77, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Minimum torques:\", self.min_r_tor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L64_C16", "label": "return", "type": "return", "loc": [64, 64], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L61_C12", "vector": [13, 4, 0.1768, 0.0028, 4, 0.77, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'collision'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L65_C12", "label": "if", "type": "if", "loc": [65, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L50_C8", "vector": [4, 3, 0.1837, 0.011, 3, 0.07, 0.7143, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.any(r_tor > self.max_r_tor):\n print(\"Collision detected on right arm with torque:\", r_tor)\n print(\"Minimum torques:\", self.max_r_tor)\n return 'collision'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L66_C16", "label": "print()", "type": "expression", "loc": [66, 66], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L65_C12", "vector": [8, 4, 0.1823, 0.0028, 4, 0.42, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Collision detected on right arm with torque:\", r_tor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L67_C16", "label": "print()", "type": "expression", "loc": [67, 67], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L65_C12", "vector": [8, 4, 0.1851, 0.0028, 4, 0.42, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Minimum torques:\", self.max_r_tor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L68_C16", "label": "return", "type": "return", "loc": [68, 68], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L65_C12", "vector": [13, 4, 0.1878, 0.0028, 4, 0.42, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'collision'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L70_C12", "label": "if", "type": "if", "loc": [70, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L50_C8", "vector": [4, 3, 0.1961, 0.0083, 3, 0.07, 0.8571, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.preempt_requested():\n self.service_preempt()\n return 'preempted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L71_C16", "label": "service_preempt()", "type": "expression", "loc": [71, 71], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L70_C12", "vector": [8, 4, 0.1961, 0.0028, 4, 0.98, 0.0, 528, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "service_preempt", "arg_names": [], "import_names": [], "rhs_call_name": "service_preempt", "annotation": ""}, "snippet": " self.service_preempt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L72_C16", "label": "return", "type": "return", "loc": [72, 72], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L70_C12", "vector": [13, 4, 0.1989, 0.0028, 4, 0.98, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'preempted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L73_C12", "label": "sleep()", "type": "expression", "loc": [73, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L50_C8", "vector": [8, 3, 0.2017, 0.0028, 3, 0.07, 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_99299:Return_L74_C8", "label": "return", "type": "return", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L48_C4", "vector": [13, 2, 0.2044, 0.0028, 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 'aborted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L76_C0", "label": "LaserCollisionDetection", "type": "class", "loc": [76, 93], "level": 0, "parent": null, "vector": [3, 0, 0.2334, 0.0497, 0, 0.66, 0.64, 162, 0, 2, 0, 0, 892, 0, 9], "semantic": {"name": "LaserCollisionDetection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class LaserCollisionDetection(smach.State):\n def __init__(self):\n smach.State.__init__(self, outcomes=['collision', 'preempted', 'aborted'])\n self.cs = CostmapServices(accum=3)\n\n def execute(self, userdata):\n r = rospy.Rate(20)\n while not rospy.is_shutdown():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L77_C4", "label": "__init__", "type": "function", "loc": [77, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L76_C0", "vector": [2, 1, 0.2155, 0.0083, 1, 0.61, 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 smach.State.__init__(self, outcomes=['collision', 'preempted', 'aborted'])\n self.cs = CostmapServices(accum=3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L78_C8", "label": "__init__()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L77_C4", "vector": [8, 2, 0.2155, 0.0028, 2, 0.5, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " smach.State.__init__(self, outcomes=['collision', 'preempted', 'aborted'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L79_C8", "label": "self.cs = CostmapServices()", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L77_C4", "vector": [14, 2, 0.2182, 0.0028, 2, 0.5, 1.0, 23, 3, 1, 0, 0, 974, 10, 1], "semantic": {"name": "self.cs", "arg_names": [], "import_names": [], "rhs_call_name": "CostmapServices", "annotation": ""}, "snippet": " self.cs = CostmapServices(accum=3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L81_C4", "label": "execute", "type": "function", "loc": [81, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L76_C0", "vector": [2, 1, 0.2403, 0.0359, 1, 0.61, 1.0, 569, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "execute", "arg_names": ["self", "userdata"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute(self, userdata):\n r = rospy.Rate(20)\n while not rospy.is_shutdown():\n vx, vy, vtheta = 0., 0., 0. #TODO REMOVE\n score = self.cs.scoreTraj_PosHyst(vx, vy, vtheta) # TODO\n if score < 0:\n print(\"Base laser detected a collision.\")\n return 'collision'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L82_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L81_C4", "vector": [14, 2, 0.2265, 0.0028, 2, 0.82, 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(20)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L83_C8", "label": "while", "type": "while", "loc": [83, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L81_C4", "vector": [5, 2, 0.2417, 0.0276, 2, 0.82, 0.5, 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 vx, vy, vtheta = 0., 0., 0. #TODO REMOVE\n score = self.cs.scoreTraj_PosHyst(vx, vy, vtheta) # TODO\n if score < 0:\n print(\"Base laser detected a collision.\")\n return 'collision'\n if self.preempt_requested():\n self.service_preempt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L84_C12", "label": "vx, vy, vtheta =", "type": "assigned_variable", "loc": [84, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L83_C8", "vector": [14, 3, 0.232, 0.0028, 3, 0.31, 0.0, 335, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "vx, vy, vtheta", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vx, vy, vtheta = 0., 0., 0. #TODO REMOVE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L85_C12", "label": "score = scoreTraj_PosHyst()", "type": "assigned_variable", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L83_C8", "vector": [14, 3, 0.2348, 0.0028, 3, 0.31, 0.25, 34, 3, 3, 0, 0, 26, 10, 1], "semantic": {"name": "score", "arg_names": [], "import_names": [], "rhs_call_name": "scoreTraj_PosHyst", "annotation": ""}, "snippet": " score = self.cs.scoreTraj_PosHyst(vx, vy, vtheta) # TODO"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L86_C12", "label": "if", "type": "if", "loc": [86, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L83_C8", "vector": [4, 3, 0.2403, 0.0083, 3, 0.31, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if score < 0:\n print(\"Base laser detected a collision.\")\n return 'collision'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L87_C16", "label": "print()", "type": "expression", "loc": [87, 87], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L86_C12", "vector": [8, 4, 0.2403, 0.0028, 4, 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(\"Base laser detected a collision.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L88_C16", "label": "return", "type": "return", "loc": [88, 88], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L86_C12", "vector": [13, 4, 0.2431, 0.0028, 4, 0.45, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'collision'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L89_C12", "label": "if", "type": "if", "loc": [89, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L83_C8", "vector": [4, 3, 0.2486, 0.0083, 3, 0.31, 0.75, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.preempt_requested():\n self.service_preempt()\n return 'preempted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L90_C16", "label": "service_preempt()", "type": "expression", "loc": [90, 90], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L89_C12", "vector": [8, 4, 0.2486, 0.0028, 4, 0.05, 0.0, 528, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "service_preempt", "arg_names": [], "import_names": [], "rhs_call_name": "service_preempt", "annotation": ""}, "snippet": " self.service_preempt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L91_C16", "label": "return", "type": "return", "loc": [91, 91], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L89_C12", "vector": [13, 4, 0.2514, 0.0028, 4, 0.05, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'preempted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L92_C12", "label": "sleep()", "type": "expression", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L83_C8", "vector": [8, 3, 0.2541, 0.0028, 3, 0.31, 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_99299:Return_L93_C8", "label": "return", "type": "return", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L81_C4", "vector": [13, 2, 0.2569, 0.0028, 2, 0.82, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'aborted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L95_C0", "label": "build_cc_servoing", "type": "function", "loc": [95, 130], "level": 0, "parent": null, "vector": [2, 0, 0.3108, 0.0994, 0, 0.66, 0.68, 919, 0, 1, 1, 0, 0, 0, 9], "semantic": {"name": "build_cc_servoing", "arg_names": ["viz_servos"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def build_cc_servoing(viz_servos):\n def term_cb(outcome_map):\n return True\n def out_cb(outcome_map):\n if outcome_map['ARM_COLLISION_DETECTION'] == 'collision':\n return 'arm_collision'\n if outcome_map['LASER_COLLISION_DETECTION'] == 'collision':\n return 'laser_collision'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L96_C4", "label": "term_cb", "type": "function", "loc": [96, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L95_C0", "vector": [2, 1, 0.2666, 0.0055, 1, 0.77, 0.0, 667, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "term_cb", "arg_names": ["outcome_map"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def term_cb(outcome_map):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L97_C8", "label": "return", "type": "return", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L96_C4", "vector": [13, 2, 0.268, 0.0028, 2, 0.65, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L98_C4", "label": "out_cb", "type": "function", "loc": [98, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L95_C0", "vector": [2, 1, 0.2831, 0.0276, 1, 0.77, 0.3333, 452, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "out_cb", "arg_names": ["outcome_map"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def out_cb(outcome_map):\n if outcome_map['ARM_COLLISION_DETECTION'] == 'collision':\n return 'arm_collision'\n if outcome_map['LASER_COLLISION_DETECTION'] == 'collision':\n return 'laser_collision'\n if outcome_map['USER_PREEMPT_DETECTION'] == 'true':\n return 'user_preempted'\n if outcome_map['USER_PREEMPT_DETECTION'] == 'false':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L99_C8", "label": "if", "type": "if", "loc": [99, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L98_C4", "vector": [4, 2, 0.2749, 0.0055, 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 outcome_map['ARM_COLLISION_DETECTION'] == 'collision':\n return 'arm_collision'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L100_C12", "label": "return", "type": "return", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L99_C8", "vector": [13, 3, 0.2762, 0.0028, 3, 0.04, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'arm_collision'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L101_C8", "label": "if", "type": "if", "loc": [101, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L98_C4", "vector": [4, 2, 0.2804, 0.0055, 2, 0.92, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if outcome_map['LASER_COLLISION_DETECTION'] == 'collision':\n return 'laser_collision'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L102_C12", "label": "return", "type": "return", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L101_C8", "vector": [13, 3, 0.2818, 0.0028, 3, 0.9, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'laser_collision'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L103_C8", "label": "if", "type": "if", "loc": [103, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L98_C4", "vector": [4, 2, 0.2859, 0.0055, 2, 0.92, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if outcome_map['USER_PREEMPT_DETECTION'] == 'true':\n return 'user_preempted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L104_C12", "label": "return", "type": "return", "loc": [104, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L103_C8", "vector": [13, 3, 0.2873, 0.0028, 3, 0.39, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'user_preempted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L105_C8", "label": "if", "type": "if", "loc": [105, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L98_C4", "vector": [4, 2, 0.2914, 0.0055, 2, 0.92, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if outcome_map['USER_PREEMPT_DETECTION'] == 'false':\n return 'aborted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L106_C12", "label": "return", "type": "return", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L105_C8", "vector": [13, 3, 0.2928, 0.0028, 3, 0.43, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'aborted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L107_C8", "label": "return", "type": "return", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L98_C4", "vector": [13, 2, 0.2956, 0.0028, 2, 0.92, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return outcome_map['SERVOING']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L109_C4", "label": "cc_servoing = Concurrence()", "type": "assigned_variable", "loc": [109, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L95_C0", "vector": [14, 1, 0.3094, 0.0193, 1, 0.77, 0.6667, 483, 3, 5, 0, 0, 824, 10, 1], "semantic": {"name": "cc_servoing", "arg_names": [], "import_names": [], "rhs_call_name": "Concurrence", "annotation": ""}, "snippet": " cc_servoing = smach.Concurrence(\n outcomes=outcomes_spa+\n ['arm_collision', 'laser_collision', 'lost_tag', 'user_preempted'],\n input_keys=['goal_ar_pose', 'initial_ar_pose', 'servo_topic'],\n default_outcome='aborted',\n child_termination_cb=term_cb,\n outcome_cb=out_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L118_C8", "label": "add()", "type": "expression", "loc": [118, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L95_C0", "vector": [8, 1, 0.3273, 0.0055, 1, 0.77, 0.0, 241, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.Concurrence.add('SERVOING',\n ServoARTagState(viz_servos))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L121_C8", "label": "add()", "type": "expression", "loc": [121, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L95_C0", "vector": [8, 1, 0.3356, 0.0055, 1, 0.77, 0.3333, 241, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.Concurrence.add('ARM_COLLISION_DETECTION',\n ArmCollisionDetection())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L124_C8", "label": "add()", "type": "expression", "loc": [124, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L95_C0", "vector": [8, 1, 0.3439, 0.0055, 1, 0.77, 0.6667, 241, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.Concurrence.add('LASER_COLLISION_DETECTION',\n LaserCollisionDetection())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L127_C8", "label": "add()", "type": "expression", "loc": [127, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L95_C0", "vector": [8, 1, 0.3522, 0.0055, 1, 0.77, 1.0, 241, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.Concurrence.add('USER_PREEMPT_DETECTION',\n BoolTopicState(\"/pr2_ar_servo/preempt\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L130_C4", "label": "return", "type": "return", "loc": [130, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L95_C0", "vector": [13, 1, 0.3591, 0.0028, 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 cc_servoing"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L132_C0", "label": "BoolTopicState", "type": "class", "loc": [132, 155], "level": 0, "parent": null, "vector": [3, 0, 0.3964, 0.0663, 0, 0.66, 0.72, 594, 0, 3, 0, 0, 892, 0, 7], "semantic": {"name": "BoolTopicState", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class BoolTopicState(smach.State):\n def __init__(self, topic, rate=20):\n smach.State.__init__(self, outcomes=['true', 'false', 'preempted', 'aborted'])\n self.rate = rate\n self.ui_list = rospy.Subscriber(topic, Bool, self.ui_cb)\n \n def ui_cb(self, msg):\n self.bool_msg = msg.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L133_C4", "label": "__init__", "type": "function", "loc": [133, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L132_C0", "vector": [2, 1, 0.3715, 0.011, 1, 0.63, 0.0, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "topic", "rate"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, topic, rate=20):\n smach.State.__init__(self, outcomes=['true', 'false', 'preempted', 'aborted'])\n self.rate = rate\n self.ui_list = rospy.Subscriber(topic, Bool, self.ui_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L134_C8", "label": "__init__()", "type": "expression", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L133_C4", "vector": [8, 2, 0.3702, 0.0028, 2, 0.08, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " smach.State.__init__(self, outcomes=['true', 'false', 'preempted', 'aborted'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L135_C8", "label": "self.rate =", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L133_C4", "vector": [14, 2, 0.3729, 0.0028, 2, 0.08, 0.5, 6, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rate = rate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L136_C8", "label": "self.ui_list = Subscriber()", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L133_C4", "vector": [14, 2, 0.3757, 0.0028, 2, 0.08, 1.0, 697, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "self.ui_list", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " self.ui_list = rospy.Subscriber(topic, Bool, self.ui_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L138_C4", "label": "ui_cb", "type": "function", "loc": [138, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L132_C0", "vector": [2, 1, 0.384, 0.0083, 1, 0.63, 0.5, 337, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "ui_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def ui_cb(self, msg):\n self.bool_msg = msg.data\n self.got_msg = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L139_C8", "label": "self.bool_msg =", "type": "assigned_variable", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L138_C4", "vector": [14, 2, 0.384, 0.0028, 2, 0.1, 0.0, 712, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.bool_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.bool_msg = msg.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L140_C8", "label": "self.got_msg =", "type": "assigned_variable", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L138_C4", "vector": [14, 2, 0.3867, 0.0028, 2, 0.1, 1.0, 920, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.got_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.got_msg = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L142_C4", "label": "execute", "type": "function", "loc": [142, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L132_C0", "vector": [2, 1, 0.4102, 0.0387, 1, 0.63, 1.0, 569, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "execute", "arg_names": ["self", "userdata"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute(self, userdata):\n self.got_msg = False\n r = rospy.Rate(self.rate)\n while not rospy.is_shutdown():\n if self.got_msg:\n if self.bool_msg:\n return 'true'\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L143_C8", "label": "self.got_msg =", "type": "assigned_variable", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L142_C4", "vector": [14, 2, 0.395, 0.0028, 2, 0.25, 0.0, 920, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.got_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.got_msg = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L144_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L142_C4", "vector": [14, 2, 0.3978, 0.0028, 2, 0.25, 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(self.rate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L145_C8", "label": "while", "type": "while", "loc": [145, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L142_C4", "vector": [5, 2, 0.413, 0.0276, 2, 0.25, 0.6667, 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 self.got_msg:\n if self.bool_msg:\n return 'true'\n else:\n return 'false'\n if self.preempt_requested():\n self.service_preempt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L146_C12", "label": "if", "type": "if", "loc": [146, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L145_C8", "vector": [4, 3, 0.4088, 0.0138, 3, 0.98, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.got_msg:\n if self.bool_msg:\n return 'true'\n else:\n return 'false'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L147_C16", "label": "if", "type": "if", "loc": [147, 150], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L146_C12", "vector": [4, 4, 0.4102, 0.011, 4, 0.42, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.bool_msg:\n return 'true'\n else:\n return 'false'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L148_C20", "label": "return", "type": "return", "loc": [148, 148], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L147_C16", "vector": [13, 5, 0.4088, 0.0028, 5, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'true'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L150_C20", "label": "return", "type": "return", "loc": [150, 150], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L147_C16", "vector": [13, 5, 0.4144, 0.0028, 5, 0.66, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'false'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L151_C12", "label": "if", "type": "if", "loc": [151, 153], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L145_C8", "vector": [4, 3, 0.4199, 0.0083, 3, 0.98, 0.5, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.preempt_requested():\n self.service_preempt()\n return 'preempted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L152_C16", "label": "service_preempt()", "type": "expression", "loc": [152, 152], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L151_C12", "vector": [8, 4, 0.4199, 0.0028, 4, 0.93, 0.0, 528, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "service_preempt", "arg_names": [], "import_names": [], "rhs_call_name": "service_preempt", "annotation": ""}, "snippet": " self.service_preempt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L153_C16", "label": "return", "type": "return", "loc": [153, 153], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L151_C12", "vector": [13, 4, 0.4227, 0.0028, 4, 0.93, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'preempted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L154_C12", "label": "sleep()", "type": "expression", "loc": [154, 154], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L145_C8", "vector": [8, 3, 0.4254, 0.0028, 3, 0.98, 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_99299:Return_L155_C8", "label": "return", "type": "return", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L142_C4", "vector": [13, 2, 0.4282, 0.0028, 2, 0.25, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'aborted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L157_C0", "label": "PublishState", "type": "class", "loc": [157, 165], "level": 0, "parent": null, "vector": [3, 0, 0.4448, 0.0249, 0, 0.66, 0.76, 679, 0, 2, 0, 0, 892, 0, 3], "semantic": {"name": "PublishState", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PublishState(smach.State):\n def __init__(self, topic, msg_type, msg):\n smach.State.__init__(self, outcomes=['succeeded'])\n self.pub = rospy.Publisher(topic, msg_type)\n self.msg = msg\n\n def execute(self, userdata):\n self.pub.publish(self.msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L158_C4", "label": "__init__", "type": "function", "loc": [158, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L157_C0", "vector": [2, 1, 0.4406, 0.011, 1, 0.32, 0.0, 555, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "topic", "msg_type", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, topic, msg_type, msg):\n smach.State.__init__(self, outcomes=['succeeded'])\n self.pub = rospy.Publisher(topic, msg_type)\n self.msg = msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L159_C8", "label": "__init__()", "type": "expression", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L158_C4", "vector": [8, 2, 0.4392, 0.0028, 2, 0.9, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " smach.State.__init__(self, outcomes=['succeeded'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L160_C8", "label": "self.pub = Publisher()", "type": "assigned_variable", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L158_C4", "vector": [14, 2, 0.442, 0.0028, 2, 0.9, 0.5, 86, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.pub = rospy.Publisher(topic, msg_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L161_C8", "label": "self.msg =", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L158_C4", "vector": [14, 2, 0.4448, 0.0028, 2, 0.9, 1.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_99299:FunctionDef_L163_C4", "label": "execute", "type": "function", "loc": [163, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L157_C0", "vector": [2, 1, 0.453, 0.0083, 1, 0.32, 1.0, 569, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "execute", "arg_names": ["self", "userdata"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute(self, userdata):\n self.pub.publish(self.msg)\n return 'succeeded'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L164_C8", "label": "publish()", "type": "expression", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L163_C4", "vector": [8, 2, 0.453, 0.0028, 2, 0.07, 0.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.pub.publish(self.msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L165_C8", "label": "return", "type": "return", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L163_C4", "vector": [13, 2, 0.4558, 0.0028, 2, 0.07, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'succeeded'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L167_C0", "label": "FindARTagState", "type": "class", "loc": [167, 218], "level": 0, "parent": null, "vector": [3, 0, 0.5318, 0.1436, 0, 0.66, 0.8, 775, 0, 4, 0, 0, 892, 0, 19], "semantic": {"name": "FindARTagState", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FindARTagState(smach.State):\n def __init__(self, viz_servos, viz_servo_goals, timeout=6.):\n smach.State.__init__(self, \n outcomes=['found_tag', 'timeout', 'preempted', 'aborted'],\n output_keys=['initial_ar_pose', 'goal_ar_pose', 'servo_topic'])\n self.viz_servos = viz_servos\n self.viz_servo_goals = viz_servo_goals\n self.timeout = timeout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L168_C4", "label": "__init__", "type": "function", "loc": [168, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L167_C0", "vector": [2, 1, 0.4724, 0.0193, 1, 0.38, 0.0, 555, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "viz_servos", "viz_servo_goals", "timeout"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, viz_servos, viz_servo_goals, timeout=6.):\n smach.State.__init__(self, \n outcomes=['found_tag', 'timeout', 'preempted', 'aborted'],\n output_keys=['initial_ar_pose', 'goal_ar_pose', 'servo_topic'])\n self.viz_servos = viz_servos\n self.viz_servo_goals = viz_servo_goals\n self.timeout = timeout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L169_C8", "label": "__init__()", "type": "expression", "loc": [169, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L168_C4", "vector": [8, 2, 0.4696, 0.0083, 2, 0.14, 0.0, 555, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " smach.State.__init__(self, \n outcomes=['found_tag', 'timeout', 'preempted', 'aborted'],\n output_keys=['initial_ar_pose', 'goal_ar_pose', 'servo_topic'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L172_C8", "label": "self.viz_servos =", "type": "assigned_variable", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L168_C4", "vector": [14, 2, 0.4751, 0.0028, 2, 0.14, 0.3333, 84, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.viz_servos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.viz_servos = viz_servos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L173_C8", "label": "self.viz_servo_goals =", "type": "assigned_variable", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L168_C4", "vector": [14, 2, 0.4779, 0.0028, 2, 0.14, 0.6667, 708, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.viz_servo_goals", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.viz_servo_goals = viz_servo_goals"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L174_C8", "label": "self.timeout =", "type": "assigned_variable", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L168_C4", "vector": [14, 2, 0.4807, 0.0028, 2, 0.14, 1.0, 621, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.timeout", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.timeout = timeout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L176_C4", "label": "execute", "type": "function", "loc": [176, 218], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L167_C0", "vector": [2, 1, 0.5442, 0.1188, 1, 0.38, 1.0, 569, 0, 2, 1, 0, 0, 0, 18], "semantic": {"name": "execute", "arg_names": ["self", "userdata"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute(self, userdata):\n # This is just a mess.\n # Figure this out and rewrite it...\n def check_preempt(event):\n if self.preempt_requested():\n self.service_preempt()\n for topic in self.viz_servos:\n self.viz_servos[topic].request_preempt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L179_C8", "label": "check_preempt", "type": "function", "loc": [179, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L176_C4", "vector": [2, 2, 0.5, 0.0138, 2, 0.52, 0.0, 795, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "check_preempt", "arg_names": ["event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_preempt(event):\n if self.preempt_requested():\n self.service_preempt()\n for topic in self.viz_servos:\n self.viz_servos[topic].request_preempt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L180_C12", "label": "if", "type": "if", "loc": [180, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L179_C8", "vector": [4, 3, 0.5014, 0.011, 3, 0.73, 0.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.preempt_requested():\n self.service_preempt()\n for topic in self.viz_servos:\n self.viz_servos[topic].request_preempt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L181_C16", "label": "service_preempt()", "type": "expression", "loc": [181, 181], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L180_C12", "vector": [8, 4, 0.5, 0.0028, 4, 0.74, 0.0, 528, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "service_preempt", "arg_names": [], "import_names": [], "rhs_call_name": "service_preempt", "annotation": ""}, "snippet": " self.service_preempt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:For_L182_C16", "label": "for topic", "type": "for", "loc": [182, 183], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L180_C12", "vector": [6, 4, 0.5041, 0.0055, 4, 0.74, 1.0, 225, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "topic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for topic in self.viz_servos:\n self.viz_servos[topic].request_preempt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L183_C20", "label": "request_preempt()", "type": "expression", "loc": [183, 183], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:For_L182_C16", "vector": [8, 5, 0.5055, 0.0028, 5, 0.47, 0.0, 186, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "request_preempt", "arg_names": [], "import_names": [], "rhs_call_name": "request_preempt", "annotation": ""}, "snippet": " self.viz_servos[topic].request_preempt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L185_C8", "label": "preempt_timer = Timer()", "type": "assigned_variable", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L176_C4", "vector": [14, 2, 0.511, 0.0028, 2, 0.52, 0.1111, 732, 3, 2, 0, 0, 771, 10, 2], "semantic": {"name": "preempt_timer", "arg_names": [], "import_names": [], "rhs_call_name": "Timer", "annotation": ""}, "snippet": " preempt_timer = rospy.Timer(rospy.Duration(0.1), check_preempt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L186_C8", "label": "self.outcome_dict =", "type": "assigned_variable", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L176_C4", "vector": [14, 2, 0.5138, 0.0028, 2, 0.52, 0.2222, 647, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.outcome_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.outcome_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L187_C8", "label": "call_find_ar_tag", "type": "function", "loc": [187, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L176_C4", "vector": [2, 2, 0.5221, 0.0138, 2, 0.52, 0.3333, 521, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "call_find_ar_tag", "arg_names": ["te", "viz_servo", "fart_state", "topic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def call_find_ar_tag(te, viz_servo, fart_state, topic):\n mean_ar, outcome = viz_servo.find_ar_tag(self.timeout)\n self.outcome_dict[topic] = (mean_ar, outcome)\n if outcome == \"found_tag\":\n self.request_preempt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L188_C12", "label": "mean_ar, outcome = find_ar_tag()", "type": "assigned_variable", "loc": [188, 188], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L187_C8", "vector": [14, 3, 0.5193, 0.0028, 3, 0.18, 0.0, 974, 3, 1, 0, 0, 245, 10, 1], "semantic": {"name": "mean_ar, outcome", "arg_names": [], "import_names": [], "rhs_call_name": "find_ar_tag", "annotation": ""}, "snippet": " mean_ar, outcome = viz_servo.find_ar_tag(self.timeout)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L189_C12", "label": "assign", "type": "assigned_variable", "loc": [189, 189], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L187_C8", "vector": [14, 3, 0.5221, 0.0028, 3, 0.18, 0.5, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.outcome_dict[topic] = (mean_ar, outcome)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L190_C12", "label": "if", "type": "if", "loc": [190, 191], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L187_C8", "vector": [4, 3, 0.5262, 0.0055, 3, 0.18, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if outcome == \"found_tag\":\n self.request_preempt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L191_C16", "label": "request_preempt()", "type": "expression", "loc": [191, 191], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L190_C12", "vector": [8, 4, 0.5276, 0.0028, 4, 0.79, 0.0, 186, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "request_preempt", "arg_names": [], "import_names": [], "rhs_call_name": "request_preempt", "annotation": ""}, "snippet": " self.request_preempt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:For_L192_C8", "label": "for topic", "type": "for", "loc": [192, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L176_C4", "vector": [6, 2, 0.5373, 0.0166, 2, 0.52, 0.4444, 225, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "topic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for topic in self.viz_servos:\n call_find_ar_tag_filled = functools.partial(call_find_ar_tag, \n viz_servo=self.viz_servos[topic],\n fart_state=self,\n topic=topic)\n rospy.Timer(rospy.Duration(0.01), call_find_ar_tag_filled, oneshot=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L193_C12", "label": "call_find_ar_tag_filled = partial()", "type": "assigned_variable", "loc": [193, 196], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:For_L192_C8", "vector": [14, 3, 0.5373, 0.011, 3, 0.89, 0.0, 221, 3, 4, 0, 0, 365, 10, 1], "semantic": {"name": "call_find_ar_tag_filled", "arg_names": [], "import_names": [], "rhs_call_name": "partial", "annotation": ""}, "snippet": " call_find_ar_tag_filled = functools.partial(call_find_ar_tag, \n viz_servo=self.viz_servos[topic],\n fart_state=self,\n topic=topic)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L197_C12", "label": "Timer()", "type": "expression", "loc": [197, 197], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:For_L192_C8", "vector": [8, 3, 0.5442, 0.0028, 3, 0.89, 1.0, 771, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "Timer", "arg_names": [], "import_names": [], "rhs_call_name": "Timer", "annotation": ""}, "snippet": " rospy.Timer(rospy.Duration(0.01), call_find_ar_tag_filled, oneshot=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L198_C8", "label": "while", "type": "while", "loc": [198, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L176_C4", "vector": [5, 2, 0.5511, 0.011, 2, 0.52, 0.5556, 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 if self.preempt_requested() or len(self.outcome_dict) == len(self.viz_servos):\n break\n rospy.sleep(0.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L199_C12", "label": "if", "type": "if", "loc": [199, 200], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L198_C8", "vector": [4, 3, 0.5511, 0.0055, 3, 0.62, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.preempt_requested() or len(self.outcome_dict) == len(self.viz_servos):\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L201_C12", "label": "sleep()", "type": "expression", "loc": [201, 201], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L198_C8", "vector": [8, 3, 0.5552, 0.0028, 3, 0.62, 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_99299:Assign_L202_C8", "label": "outcome =", "type": "assigned_variable", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L176_C4", "vector": [14, 2, 0.558, 0.0028, 2, 0.52, 0.6667, 805, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "outcome", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " outcome = \"timeout\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:For_L203_C8", "label": "for topic", "type": "for", "loc": [203, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L176_C4", "vector": [6, 2, 0.5773, 0.0359, 2, 0.52, 0.7778, 225, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "topic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for topic in self.outcome_dict:\n if self.outcome_dict[topic][1] == \"found_tag\":\n userdata['initial_ar_pose'] = self.outcome_dict[topic][0]\n userdata['goal_ar_pose'] = self.viz_servo_goals[topic]\n userdata['servo_topic'] = topic\n outcome = \"found_tag\"\n # FIXME I should be shot for these lines: FIXME\n if topic == \"r_pr2_ar_pose_marker\":"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L204_C12", "label": "if", "type": "if", "loc": [204, 215], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:For_L203_C8", "vector": [4, 3, 0.5787, 0.0331, 3, 0.7, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.outcome_dict[topic][1] == \"found_tag\":\n userdata['initial_ar_pose'] = self.outcome_dict[topic][0]\n userdata['goal_ar_pose'] = self.viz_servo_goals[topic]\n userdata['servo_topic'] = topic\n outcome = \"found_tag\"\n # FIXME I should be shot for these lines: FIXME\n if topic == \"r_pr2_ar_pose_marker\":\n rospy.set_param(\"/shaving_side\", 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L205_C16", "label": "assign", "type": "assigned_variable", "loc": [205, 205], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L204_C12", "vector": [14, 4, 0.5663, 0.0028, 4, 0.37, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " userdata['initial_ar_pose'] = self.outcome_dict[topic][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L206_C16", "label": "assign", "type": "assigned_variable", "loc": [206, 206], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L204_C12", "vector": [14, 4, 0.5691, 0.0028, 4, 0.37, 0.25, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " userdata['goal_ar_pose'] = self.viz_servo_goals[topic]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L207_C16", "label": "assign", "type": "assigned_variable", "loc": [207, 207], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L204_C12", "vector": [14, 4, 0.5718, 0.0028, 4, 0.37, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " userdata['servo_topic'] = topic"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L208_C16", "label": "outcome =", "type": "assigned_variable", "loc": [208, 208], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L204_C12", "vector": [14, 4, 0.5746, 0.0028, 4, 0.37, 0.75, 805, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "outcome", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " outcome = \"found_tag\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L210_C16", "label": "if", "type": "if", "loc": [210, 213], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L204_C12", "vector": [4, 4, 0.5843, 0.011, 4, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if topic == \"r_pr2_ar_pose_marker\":\n rospy.set_param(\"/shaving_side\", 'r')\n else:\n rospy.set_param(\"/shaving_side\", 'l')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L211_C20", "label": "set_param()", "type": "expression", "loc": [211, 211], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L210_C16", "vector": [8, 5, 0.5829, 0.0028, 5, 0.02, 0.0, 696, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_param", "arg_names": [], "import_names": [], "rhs_call_name": "set_param", "annotation": ""}, "snippet": " rospy.set_param(\"/shaving_side\", 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L213_C20", "label": "set_param()", "type": "expression", "loc": [213, 213], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L210_C16", "vector": [8, 5, 0.5884, 0.0028, 5, 0.02, 1.0, 696, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_param", "arg_names": [], "import_names": [], "rhs_call_name": "set_param", "annotation": ""}, "snippet": " rospy.set_param(\"/shaving_side\", 'l')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L217_C8", "label": "shutdown()", "type": "expression", "loc": [217, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L176_C4", "vector": [8, 2, 0.5994, 0.0028, 2, 0.52, 0.8889, 322, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "shutdown", "arg_names": [], "import_names": [], "rhs_call_name": "shutdown", "annotation": ""}, "snippet": " preempt_timer.shutdown()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L218_C8", "label": "return", "type": "return", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L176_C4", "vector": [13, 2, 0.6022, 0.0028, 2, 0.52, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return outcome"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L220_C0", "label": "ServoARTagState", "type": "class", "loc": [220, 245], "level": 0, "parent": null, "vector": [3, 0, 0.6423, 0.0718, 0, 0.66, 0.84, 612, 0, 3, 0, 0, 892, 0, 9], "semantic": {"name": "ServoARTagState", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ServoARTagState(smach.State):\n def __init__(self, viz_servos):\n smach.State.__init__(self, \n outcomes=['lost_tag'] + outcomes_spa,\n input_keys=['goal_ar_pose', 'initial_ar_pose', 'servo_topic'])\n self.viz_servos = viz_servos\n\n def execute(self, userdata):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L221_C4", "label": "__init__", "type": "function", "loc": [221, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L220_C0", "vector": [2, 1, 0.616, 0.0138, 1, 0.83, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "viz_servos"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, viz_servos):\n smach.State.__init__(self, \n outcomes=['lost_tag'] + outcomes_spa,\n input_keys=['goal_ar_pose', 'initial_ar_pose', 'servo_topic'])\n self.viz_servos = viz_servos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L222_C8", "label": "__init__()", "type": "expression", "loc": [222, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L221_C4", "vector": [8, 2, 0.616, 0.0083, 2, 0.01, 0.0, 555, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " smach.State.__init__(self, \n outcomes=['lost_tag'] + outcomes_spa,\n input_keys=['goal_ar_pose', 'initial_ar_pose', 'servo_topic'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L225_C8", "label": "self.viz_servos =", "type": "assigned_variable", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L221_C4", "vector": [14, 2, 0.6215, 0.0028, 2, 0.01, 1.0, 84, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.viz_servos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.viz_servos = viz_servos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L227_C4", "label": "execute", "type": "function", "loc": [227, 245], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L220_C0", "vector": [2, 1, 0.6519, 0.0525, 1, 0.83, 1.0, 569, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "execute", "arg_names": ["self", "userdata"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute(self, userdata):\n if 'initial_ar_pose' in userdata:\n initial_ar_pose = userdata.initial_ar_pose\n else:\n rospy.logerr(\"Initial AR pose should be in userdata\")\n initial_ar_pose = None\n\n servo_topic = userdata['servo_topic']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L228_C8", "label": "if", "type": "if", "loc": [228, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L227_C4", "vector": [4, 2, 0.6354, 0.0138, 2, 0.18, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'initial_ar_pose' in userdata:\n initial_ar_pose = userdata.initial_ar_pose\n else:\n rospy.logerr(\"Initial AR pose should be in userdata\")\n initial_ar_pose = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L229_C12", "label": "initial_ar_pose =", "type": "assigned_variable", "loc": [229, 229], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L228_C8", "vector": [14, 3, 0.6326, 0.0028, 3, 0.52, 0.0, 795, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "initial_ar_pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " initial_ar_pose = userdata.initial_ar_pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L231_C12", "label": "logerr()", "type": "expression", "loc": [231, 231], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L228_C8", "vector": [8, 3, 0.6381, 0.0028, 3, 0.52, 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(\"Initial AR pose should be in userdata\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L232_C12", "label": "initial_ar_pose =", "type": "assigned_variable", "loc": [232, 232], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L228_C8", "vector": [14, 3, 0.6409, 0.0028, 3, 0.52, 1.0, 795, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "initial_ar_pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " initial_ar_pose = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L234_C8", "label": "servo_topic =", "type": "assigned_variable", "loc": [234, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L227_C4", "vector": [14, 2, 0.6464, 0.0028, 2, 0.18, 0.1429, 421, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "servo_topic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " servo_topic = userdata['servo_topic']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L235_C8", "label": "check_preempt", "type": "function", "loc": [235, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L227_C4", "vector": [2, 2, 0.6533, 0.011, 2, 0.18, 0.2857, 795, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "check_preempt", "arg_names": ["event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_preempt(event):\n if self.preempt_requested():\n self.service_preempt()\n self.viz_servos[servo_topic].request_preempt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L236_C12", "label": "if", "type": "if", "loc": [236, 238], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L235_C8", "vector": [4, 3, 0.6547, 0.0083, 3, 0.62, 0.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.preempt_requested():\n self.service_preempt()\n self.viz_servos[servo_topic].request_preempt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L237_C16", "label": "service_preempt()", "type": "expression", "loc": [237, 237], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L236_C12", "vector": [8, 4, 0.6547, 0.0028, 4, 0.65, 0.0, 528, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "service_preempt", "arg_names": [], "import_names": [], "rhs_call_name": "service_preempt", "annotation": ""}, "snippet": " self.service_preempt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L238_C16", "label": "request_preempt()", "type": "expression", "loc": [238, 238], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L236_C12", "vector": [8, 4, 0.6575, 0.0028, 4, 0.65, 1.0, 186, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "request_preempt", "arg_names": [], "import_names": [], "rhs_call_name": "request_preempt", "annotation": ""}, "snippet": " self.viz_servos[servo_topic].request_preempt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L240_C8", "label": "preempt_timer = Timer()", "type": "assigned_variable", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L227_C4", "vector": [14, 2, 0.663, 0.0028, 2, 0.18, 0.4286, 732, 3, 2, 0, 0, 771, 10, 2], "semantic": {"name": "preempt_timer", "arg_names": [], "import_names": [], "rhs_call_name": "Timer", "annotation": ""}, "snippet": " preempt_timer = rospy.Timer(rospy.Duration(0.1), check_preempt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L241_C8", "label": "self.viz_servos[servo_topic].preempt_requested =", "type": "assigned_variable", "loc": [241, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L227_C4", "vector": [14, 2, 0.6657, 0.0028, 2, 0.18, 0.5714, 386, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.viz_servos[servo_topic].preempt_requested", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.viz_servos[servo_topic].preempt_requested = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L242_C8", "label": "outcome = servo_to_tag()", "type": "assigned_variable", "loc": [242, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L227_C4", "vector": [14, 2, 0.6699, 0.0055, 2, 0.18, 0.7143, 805, 3, 2, 0, 0, 123, 10, 1], "semantic": {"name": "outcome", "arg_names": [], "import_names": [], "rhs_call_name": "servo_to_tag", "annotation": ""}, "snippet": " outcome = self.viz_servos[servo_topic].servo_to_tag(pose_goal=userdata.goal_ar_pose,\n initial_ar_pose=initial_ar_pose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L244_C8", "label": "shutdown()", "type": "expression", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L227_C4", "vector": [8, 2, 0.674, 0.0028, 2, 0.18, 0.8571, 322, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "shutdown", "arg_names": [], "import_names": [], "rhs_call_name": "shutdown", "annotation": ""}, "snippet": " preempt_timer.shutdown()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L245_C8", "label": "return", "type": "return", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L227_C4", "vector": [13, 2, 0.6768, 0.0028, 2, 0.18, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return outcome"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "label": "build_full_sm", "type": "function", "loc": [247, 326], "level": 0, "parent": null, "vector": [2, 0, 0.7914, 0.221, 0, 0.66, 0.88, 254, 0, 1, 1, 0, 0, 0, 37], "semantic": {"name": "build_full_sm", "arg_names": ["viz_servo_goals"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def build_full_sm(viz_servo_goals):\n find_tag_timeout = 6.\n\n viz_servos = {}\n for viz_servo_topic in viz_servo_goals:\n viz_servos[viz_servo_topic] = PR2VisualServoAR(viz_servo_topic)\n\n sm_pr2_servoing = smach.StateMachine(outcomes=outcomes_spa,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L248_C4", "label": "find_tag_timeout =", "type": "assigned_variable", "loc": [248, 248], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "vector": [14, 1, 0.6851, 0.0028, 1, 0.69, 0.0, 389, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "find_tag_timeout", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " find_tag_timeout = 6."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L250_C4", "label": "viz_servos =", "type": "assigned_variable", "loc": [250, 250], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "vector": [14, 1, 0.6906, 0.0028, 1, 0.69, 0.25, 255, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "viz_servos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " viz_servos = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:For_L251_C4", "label": "for viz_servo_topic", "type": "for", "loc": [251, 252], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "vector": [6, 1, 0.6948, 0.0055, 1, 0.69, 0.5, 405, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "viz_servo_topic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for viz_servo_topic in viz_servo_goals:\n viz_servos[viz_servo_topic] = PR2VisualServoAR(viz_servo_topic)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L252_C8", "label": " = PR2VisualServoAR()", "type": "assigned_variable", "loc": [252, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:For_L251_C4", "vector": [14, 2, 0.6961, 0.0028, 2, 0.16, 0.0, 0, 3, 1, 0, 0, 968, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "PR2VisualServoAR", "annotation": ""}, "snippet": " viz_servos[viz_servo_topic] = PR2VisualServoAR(viz_servo_topic)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L254_C4", "label": "sm_pr2_servoing = StateMachine()", "type": "assigned_variable", "loc": [254, 255], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "vector": [14, 1, 0.703, 0.0055, 1, 0.69, 0.75, 190, 3, 2, 0, 0, 174, 10, 1], "semantic": {"name": "sm_pr2_servoing", "arg_names": [], "import_names": [], "rhs_call_name": "StateMachine", "annotation": ""}, "snippet": " sm_pr2_servoing = smach.StateMachine(outcomes=outcomes_spa,\n input_keys=['goal_ar_pose', 'initial_ar_pose'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L258_C8", "label": "add()", "type": "expression", "loc": [258, 261], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "vector": [8, 1, 0.7169, 0.011, 1, 0.69, 0.0, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add('UI_FIND_TAG_WAIT',\n BoolTopicState(\"/pr2_ar_servo/find_tag\"),\n transitions={'true' : 'BEGIN_FIND_TAG',\n 'false' : 'aborted'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L263_C8", "label": "add()", "type": "expression", "loc": [263, 266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "vector": [8, 1, 0.7307, 0.011, 1, 0.69, 0.0833, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add('BEGIN_FIND_TAG',\n PublishState(\"/pr2_ar_servo/state_feedback\",\n Int8, Int8(ServoStates.BEGIN_FIND_TAG)),\n transitions={'succeeded' : 'FIND_AR_TAG'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L268_C8", "label": "add()", "type": "expression", "loc": [268, 271], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "vector": [8, 1, 0.7445, 0.011, 1, 0.69, 0.1667, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add('FIND_AR_TAG',\n FindARTagState(viz_servos, viz_servo_goals, timeout=find_tag_timeout),\n transitions={'found_tag' : 'FOUND_TAG',\n 'timeout' : 'TIMEOUT_FIND_TAG'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L273_C8", "label": "add()", "type": "expression", "loc": [273, 276], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "vector": [8, 1, 0.7583, 0.011, 1, 0.69, 0.25, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add('FOUND_TAG',\n PublishState(\"/pr2_ar_servo/state_feedback\",\n Int8, Int8(ServoStates.FOUND_TAG)),\n transitions={'succeeded' : 'UI_SERVO_WAIT'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L278_C8", "label": "add()", "type": "expression", "loc": [278, 281], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "vector": [8, 1, 0.7721, 0.011, 1, 0.69, 0.3333, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add('TIMEOUT_FIND_TAG',\n PublishState(\"/pr2_ar_servo/state_feedback\",\n Int8, Int8(ServoStates.TIMEOUT_FIND_TAG)),\n transitions={'succeeded' : 'UI_FIND_TAG_WAIT'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L283_C8", "label": "add()", "type": "expression", "loc": [283, 286], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "vector": [8, 1, 0.7859, 0.011, 1, 0.69, 0.4167, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add('UI_SERVO_WAIT',\n BoolTopicState(\"/pr2_ar_servo/tag_confirm\"),\n transitions={'true' : 'BEGIN_SERVO',\n 'false' : 'UI_FIND_TAG_WAIT'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L288_C8", "label": "add()", "type": "expression", "loc": [288, 291], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "vector": [8, 1, 0.7997, 0.011, 1, 0.69, 0.5, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add('BEGIN_SERVO',\n PublishState(\"/pr2_ar_servo/state_feedback\",\n Int8, Int8(ServoStates.BEGIN_SERVO)),\n transitions={'succeeded' : 'CC_SERVOING'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L293_C8", "label": "add()", "type": "expression", "loc": [293, 299], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "vector": [8, 1, 0.8177, 0.0193, 1, 0.69, 0.5833, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add('CC_SERVOING', \n build_cc_servoing(viz_servos),\n transitions={'arm_collision' : 'ARM_COLLISION',\n 'laser_collision' : 'LASER_COLLISION',\n 'user_preempted' : 'USER_PREEMPT',\n 'lost_tag' : 'LOST_TAG',\n 'succeeded' : 'SUCCESS_SERVO'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L301_C8", "label": "add()", "type": "expression", "loc": [301, 304], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "vector": [8, 1, 0.8356, 0.011, 1, 0.69, 0.6667, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add('SUCCESS_SERVO',\n PublishState(\"/pr2_ar_servo/state_feedback\",\n Int8, Int8(ServoStates.SUCCESS_SERVO)),\n transitions={'succeeded' : 'UI_FIND_TAG_WAIT'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L306_C8", "label": "add()", "type": "expression", "loc": [306, 309], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "vector": [8, 1, 0.8494, 0.011, 1, 0.69, 0.75, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add('ARM_COLLISION',\n PublishState(\"/pr2_ar_servo/state_feedback\",\n Int8, Int8(ServoStates.ARM_COLLISION)),\n transitions={'succeeded' : 'UI_FIND_TAG_WAIT'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L311_C8", "label": "add()", "type": "expression", "loc": [311, 314], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "vector": [8, 1, 0.8633, 0.011, 1, 0.69, 0.8333, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add('LASER_COLLISION',\n PublishState(\"/pr2_ar_servo/state_feedback\",\n Int8, Int8(ServoStates.LASER_COLLISION)),\n transitions={'succeeded' : 'UI_FIND_TAG_WAIT'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L316_C8", "label": "add()", "type": "expression", "loc": [316, 319], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "vector": [8, 1, 0.8771, 0.011, 1, 0.69, 0.9167, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add('LOST_TAG',\n PublishState(\"/pr2_ar_servo/state_feedback\",\n Int8, Int8(ServoStates.LOST_TAG)),\n transitions={'succeeded' : 'UI_FIND_TAG_WAIT'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L321_C8", "label": "add()", "type": "expression", "loc": [321, 324], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "vector": [8, 1, 0.8909, 0.011, 1, 0.69, 1.0, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add('USER_PREEMPT',\n PublishState(\"/pr2_ar_servo/state_feedback\",\n Int8, Int8(ServoStates.USER_PREEMPT)),\n transitions={'succeeded' : 'UI_FIND_TAG_WAIT'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L326_C4", "label": "return", "type": "return", "loc": [326, 326], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "vector": [13, 1, 0.9006, 0.0028, 1, 0.69, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sm_pr2_servoing"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L328_C0", "label": "build_test_sm", "type": "function", "loc": [328, 336], "level": 0, "parent": null, "vector": [2, 0, 0.9171, 0.0249, 0, 0.66, 0.92, 963, 0, 0, 1, 0, 0, 0, 4], "semantic": {"name": "build_test_sm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def build_test_sm():\n viz_servo = PR2VisualServoAR(\"r_pr2_ar_pose_marker\")\n \n sm_only_servo = smach.StateMachine(outcomes=['lost_tag'] + outcomes_spa,\n input_keys=['goal_ar_pose', 'initial_ar_pose'])\n with sm_only_servo:\n smach.StateMachine.add('ONLY_SERVO',\n ServoARTagState(viz_servo))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L329_C4", "label": "viz_servo = PR2VisualServoAR()", "type": "assigned_variable", "loc": [329, 329], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L328_C0", "vector": [14, 1, 0.9088, 0.0028, 1, 0.86, 0.0, 476, 3, 1, 0, 0, 968, 10, 1], "semantic": {"name": "viz_servo", "arg_names": [], "import_names": [], "rhs_call_name": "PR2VisualServoAR", "annotation": ""}, "snippet": " viz_servo = PR2VisualServoAR(\"r_pr2_ar_pose_marker\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L331_C4", "label": "sm_only_servo = StateMachine()", "type": "assigned_variable", "loc": [331, 332], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L328_C0", "vector": [14, 1, 0.9157, 0.0055, 1, 0.86, 0.5, 273, 3, 2, 0, 0, 174, 10, 1], "semantic": {"name": "sm_only_servo", "arg_names": [], "import_names": [], "rhs_call_name": "StateMachine", "annotation": ""}, "snippet": " sm_only_servo = smach.StateMachine(outcomes=['lost_tag'] + outcomes_spa,\n input_keys=['goal_ar_pose', 'initial_ar_pose'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L334_C8", "label": "add()", "type": "expression", "loc": [334, 335], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L328_C0", "vector": [8, 1, 0.924, 0.0055, 1, 0.86, 0.0, 241, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add('ONLY_SERVO',\n ServoARTagState(viz_servo))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L336_C4", "label": "return", "type": "return", "loc": [336, 336], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L328_C0", "vector": [13, 1, 0.9282, 0.0028, 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 sm_only_servo"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L338_C0", "label": "main", "type": "function", "loc": [338, 359], "level": 0, "parent": null, "vector": [2, 0, 0.9627, 0.0608, 0, 0.66, 0.96, 624, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n rospy.init_node(\"sm_pr2_servoing\")\n userdata = smach.user_data.UserData()\n\n # old testing\n #userdata['goal_ar_pose'] = [ 0.57160106, -0.4300153 , -1.70840111]\n\n # both sides spot?"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L339_C4", "label": "init_node()", "type": "expression", "loc": [339, 339], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L338_C0", "vector": [8, 1, 0.9365, 0.0028, 1, 0.79, 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(\"sm_pr2_servoing\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L340_C4", "label": "userdata = UserData()", "type": "assigned_variable", "loc": [340, 340], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L338_C0", "vector": [14, 1, 0.9392, 0.0028, 1, 0.79, 0.2, 7, 3, 0, 0, 0, 315, 10, 1], "semantic": {"name": "userdata", "arg_names": [], "import_names": [], "rhs_call_name": "UserData", "annotation": ""}, "snippet": " userdata = smach.user_data.UserData()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L346_C4", "label": "assign", "type": "assigned_variable", "loc": [346, 346], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L338_C0", "vector": [14, 1, 0.9558, 0.0028, 1, 0.79, 0.4, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " userdata['goal_ar_pose'] = [ 0.57226345, 0.32838129, -1.15480113]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L347_C4", "label": "viz_servo_goals = get_param()", "type": "assigned_variable", "loc": [347, 347], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L338_C0", "vector": [14, 1, 0.9586, 0.0028, 1, 0.79, 0.6, 136, 3, 2, 0, 0, 427, 10, 1], "semantic": {"name": "viz_servo_goals", "arg_names": [], "import_names": [], "rhs_call_name": "get_param", "annotation": ""}, "snippet": " viz_servo_goals = rospy.get_param(\"~ar_servo_poses\", {})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L348_C4", "label": "print()", "type": "expression", "loc": [348, 348], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L338_C0", "vector": [8, 1, 0.9613, 0.0028, 1, 0.79, 0.8, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(viz_servo_goals)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L350_C4", "label": "if", "type": "if", "loc": [350, 359], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L338_C0", "vector": [4, 1, 0.9793, 0.0276, 1, 0.79, 1.0, 0, 1, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if True:\n sm_pr2_servoing = build_full_sm(viz_servo_goals)\n sis = smach_ros.IntrospectionServer('pr2_servo', sm_pr2_servoing, 'UI_FIND_TAG_WAIT')\n sis.start()\n sm_pr2_servoing.execute(userdata)\n sis.stop()\n else:\n sm_test = build_test_sm()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L351_C8", "label": "sm_pr2_servoing = build_full_sm()", "type": "assigned_variable", "loc": [351, 351], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L350_C4", "vector": [14, 2, 0.9696, 0.0028, 2, 0.12, 0.0, 190, 3, 1, 0, 0, 254, 10, 1], "semantic": {"name": "sm_pr2_servoing", "arg_names": [], "import_names": [], "rhs_call_name": "build_full_sm", "annotation": ""}, "snippet": " sm_pr2_servoing = build_full_sm(viz_servo_goals)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L352_C8", "label": "sis = IntrospectionServer()", "type": "assigned_variable", "loc": [352, 352], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L350_C4", "vector": [14, 2, 0.9724, 0.0028, 2, 0.12, 0.1429, 608, 3, 3, 0, 0, 702, 10, 1], "semantic": {"name": "sis", "arg_names": [], "import_names": [], "rhs_call_name": "IntrospectionServer", "annotation": ""}, "snippet": " sis = smach_ros.IntrospectionServer('pr2_servo', sm_pr2_servoing, 'UI_FIND_TAG_WAIT')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L353_C8", "label": "start()", "type": "expression", "loc": [353, 353], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L350_C4", "vector": [8, 2, 0.9751, 0.0028, 2, 0.12, 0.2857, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " sis.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L354_C8", "label": "execute()", "type": "expression", "loc": [354, 354], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L350_C4", "vector": [8, 2, 0.9779, 0.0028, 2, 0.12, 0.4286, 569, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " sm_pr2_servoing.execute(userdata)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L355_C8", "label": "stop()", "type": "expression", "loc": [355, 355], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L350_C4", "vector": [8, 2, 0.9807, 0.0028, 2, 0.12, 0.5714, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " sis.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L357_C8", "label": "sm_test = build_test_sm()", "type": "assigned_variable", "loc": [357, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L350_C4", "vector": [14, 2, 0.9862, 0.0028, 2, 0.12, 0.7143, 109, 3, 0, 0, 0, 963, 10, 1], "semantic": {"name": "sm_test", "arg_names": [], "import_names": [], "rhs_call_name": "build_test_sm", "annotation": ""}, "snippet": " sm_test = build_test_sm()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L358_C8", "label": "sleep()", "type": "expression", "loc": [358, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L350_C4", "vector": [8, 2, 0.989, 0.0028, 2, 0.12, 0.8571, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L359_C8", "label": "execute()", "type": "expression", "loc": [359, 359], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L350_C4", "vector": [8, 2, 0.9917, 0.0028, 2, 0.12, 1.0, 569, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " sm_test.execute(userdata)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L361_C0", "label": "if", "type": "if", "loc": [361, 362], "level": 0, "parent": null, "vector": [4, 0, 0.9986, 0.0055, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L362_C4", "label": "main()", "type": "expression", "loc": [362, 362], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L361_C0", "vector": [8, 1, 1.0, 0.0028, 1, 0.44, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L53_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L54_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L53_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L55_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L53_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L56_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L57_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L58_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L57_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L59_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L57_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L60_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L61_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L62_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L61_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L63_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L61_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L64_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L65_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L66_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L65_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L67_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L65_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L68_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L70_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L70_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L71_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L70_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L72_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L86_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L87_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L86_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L88_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L89_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L90_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L89_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L91_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L101_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L103_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L104_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L145_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L146_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L146_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L147_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L147_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L148_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L147_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L150_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L145_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L151_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L151_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L152_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L151_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L153_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L145_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L154_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L167_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L167_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L180_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L180_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L181_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L180_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:For_L182_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:For_L182_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L183_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L187_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L188_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L187_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L189_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L187_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L190_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L190_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L191_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:For_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:For_L192_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L193_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:For_L192_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L197_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L198_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L199_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:While_L198_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L201_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:For_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:For_L203_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L204_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L204_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L205_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L204_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L206_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L204_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L207_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L204_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L208_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L204_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L210_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L210_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L211_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L210_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L213_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L220_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L221_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L221_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:ClassDef_L220_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L227_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L227_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L228_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L229_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L228_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L231_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L228_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L232_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L227_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L227_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L235_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L236_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L236_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L237_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L236_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L238_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L227_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L227_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L227_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L227_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L227_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L248_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L250_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:For_L251_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:For_L251_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L254_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L288_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L293_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L301_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L311_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L316_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L321_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L247_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L326_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L328_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L329_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L328_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L331_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L328_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L334_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L328_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Return_L336_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L339_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L340_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L346_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L347_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L348_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:FunctionDef_L338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L350_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L350_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L351_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L350_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L352_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L350_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L353_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L350_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L354_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L350_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L355_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L350_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Assign_L357_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L350_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L358_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L350_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L359_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99299:If_L361_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99299:Expr_L362_C4"}]
#! /usr/bin/python import sys import numpy as np import roslib; roslib.load_manifest("hrl_pr2_arms") import rospy import tf.transformations as tf_trans from hrl_pr2_arms.pr2_arm import PR2Arm, create_pr2_arm from hrl_pr2_arms.pr2_arm import PR2ArmJointTrajectory, PR2ArmJTranspose from hrl_pr2_arms.pr2_arm import PR2ArmJInverse, PR2ArmJTransposeTask from spheroid_space import SpheroidSpace def main(): rospy.init_node("pr2_arm_test") arm = sys.argv[1] jnt_arm = create_pr2_arm(arm, arm_type=PR2ArmJointTrajectory) kin = jnt_arm.kinematics ellipse_rot = np.mat([[-1., 0., 0.], [0., -1., 0.], [0., 0., 1.]]) sspace = SpheroidSpace(0.15, np.mat([0.78, -0.18, 0.1]).T, ellipse_rot) uvp = np.array([1.0, np.pi/2, 0.0]) uvp_delta = np.array([0.0, 0.6, 0.6]) pos, rot = sspace.spheroidal_to_pose(uvp + uvp_delta) print pos, rot #q_ik = kin.IK_search(pos, rot) q_ik = kin.IK(pos, rot, jnt_arm.get_joint_angles()) if q_ik is not None: jnt_arm.set_ep(q_ik, 5) else: print "IK failure" if __name__ == "__main__": main()
ajibawa-2023/Python-Code-Large/train/row_99300
27
39
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99300:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0256, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99300:Import_L4_C0", "label": "numpy import np", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1026, 0.0256, 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_99300:Import_L6_C0", "label": "roslib import roslib", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1538, 0.0256, 0, 0.66, 0.1818, 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_arms\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99300:Expr_L6_C15", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.1538, 0.0256, 0, 0.66, 0.2727, 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_arms\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99300:Import_L7_C0", "label": "rospy import rospy", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1795, 0.0256, 0, 0.66, 0.3636, 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_99300:Import_L8_C0", "label": "tf.transformations import tf_trans", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.2051, 0.0256, 0, 0.66, 0.4545, 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_99300:ImportFrom_L10_C0", "label": "from hrl_pr2_arms.pr2_arm import PR2Arm, create_pr2_arm", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.2564, 0.0256, 0, 0.66, 0.5455, 253, 0, 2, 0, 0, 253, 0, 0], "semantic": {"name": "hrl_pr2_arms.pr2_arm", "arg_names": [], "import_names": ["PR2Arm", "create_pr2_arm"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_pr2_arms.pr2_arm import PR2Arm, create_pr2_arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99300:ImportFrom_L11_C0", "label": "from hrl_pr2_arms.pr2_arm import PR2ArmJointTrajectory, PR2ArmJTranspose", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.2821, 0.0256, 0, 0.66, 0.6364, 253, 0, 2, 0, 0, 253, 0, 0], "semantic": {"name": "hrl_pr2_arms.pr2_arm", "arg_names": [], "import_names": ["PR2ArmJointTrajectory", "PR2ArmJTranspose"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_pr2_arms.pr2_arm import PR2ArmJointTrajectory, PR2ArmJTranspose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99300:ImportFrom_L12_C0", "label": "from hrl_pr2_arms.pr2_arm import PR2ArmJInverse, PR2ArmJTransposeTask", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.3077, 0.0256, 0, 0.66, 0.7273, 253, 0, 2, 0, 0, 253, 0, 0], "semantic": {"name": "hrl_pr2_arms.pr2_arm", "arg_names": [], "import_names": ["PR2ArmJInverse", "PR2ArmJTransposeTask"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_pr2_arms.pr2_arm import PR2ArmJInverse, PR2ArmJTransposeTask"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99300:ImportFrom_L14_C0", "label": "from spheroid_space import SpheroidSpace", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.359, 0.0256, 0, 0.66, 0.8182, 746, 0, 1, 0, 0, 746, 0, 0], "semantic": {"name": "spheroid_space", "arg_names": [], "import_names": ["SpheroidSpace"], "rhs_call_name": "", "annotation": ""}, "snippet": "from spheroid_space import SpheroidSpace"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "label": "main", "type": "function", "loc": [16, 36], "level": 0, "parent": null, "vector": [2, 0, 0.6667, 0.5385, 0, 0.66, 0.9091, 624, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n rospy.init_node(\"pr2_arm_test\")\n arm = sys.argv[1]\n jnt_arm = create_pr2_arm(arm, arm_type=PR2ArmJointTrajectory)\n kin = jnt_arm.kinematics\n\n ellipse_rot = np.mat([[-1., 0., 0.], [0., -1., 0.], [0., 0., 1.]])\n sspace = SpheroidSpace(0.15, np.mat([0.78, -0.18, 0.1]).T, ellipse_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99300:Expr_L17_C4", "label": "init_node()", "type": "expression", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "vector": [8, 1, 0.4359, 0.0256, 1, 0.69, 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(\"pr2_arm_test\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99300:Assign_L18_C4", "label": "arm =", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "vector": [14, 1, 0.4615, 0.0256, 1, 0.69, 0.0909, 413, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99300:Assign_L19_C4", "label": "jnt_arm = create_pr2_arm()", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "vector": [14, 1, 0.4872, 0.0256, 1, 0.69, 0.1818, 944, 3, 2, 0, 0, 318, 10, 1], "semantic": {"name": "jnt_arm", "arg_names": [], "import_names": [], "rhs_call_name": "create_pr2_arm", "annotation": ""}, "snippet": " jnt_arm = create_pr2_arm(arm, arm_type=PR2ArmJointTrajectory)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99300:Assign_L20_C4", "label": "kin =", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "vector": [14, 1, 0.5128, 0.0256, 1, 0.69, 0.2727, 464, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "kin", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kin = jnt_arm.kinematics"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99300:Assign_L22_C4", "label": "ellipse_rot = mat()", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "vector": [14, 1, 0.5641, 0.0256, 1, 0.69, 0.3636, 256, 3, 1, 0, 0, 882, 10, 1], "semantic": {"name": "ellipse_rot", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " ellipse_rot = np.mat([[-1., 0., 0.], [0., -1., 0.], [0., 0., 1.]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99300:Assign_L23_C4", "label": "sspace = SpheroidSpace()", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "vector": [14, 1, 0.5897, 0.0256, 1, 0.69, 0.4545, 794, 3, 3, 0, 0, 883, 10, 2], "semantic": {"name": "sspace", "arg_names": [], "import_names": [], "rhs_call_name": "SpheroidSpace", "annotation": ""}, "snippet": " sspace = SpheroidSpace(0.15, np.mat([0.78, -0.18, 0.1]).T, ellipse_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99300:Assign_L25_C4", "label": "uvp = array()", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "vector": [14, 1, 0.641, 0.0256, 1, 0.69, 0.5455, 224, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "uvp", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " uvp = np.array([1.0, np.pi/2, 0.0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99300:Assign_L26_C4", "label": "uvp_delta = array()", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "vector": [14, 1, 0.6667, 0.0256, 1, 0.69, 0.6364, 151, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "uvp_delta", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " uvp_delta = np.array([0.0, 0.6, 0.6])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99300:Assign_L27_C4", "label": "pos, rot = spheroidal_to_pose()", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "vector": [14, 1, 0.6923, 0.0256, 1, 0.69, 0.7273, 298, 3, 1, 0, 0, 57, 10, 1], "semantic": {"name": "pos, rot", "arg_names": [], "import_names": [], "rhs_call_name": "spheroidal_to_pose", "annotation": ""}, "snippet": " pos, rot = sspace.spheroidal_to_pose(uvp + uvp_delta)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99300:Expr_L28_C4", "label": "print()", "type": "expression", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "vector": [8, 1, 0.7179, 0.0256, 1, 0.69, 0.8182, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(pos, rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99300:Assign_L31_C4", "label": "q_ik = IK()", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "vector": [14, 1, 0.7949, 0.0256, 1, 0.69, 0.9091, 859, 3, 3, 0, 0, 719, 10, 2], "semantic": {"name": "q_ik", "arg_names": [], "import_names": [], "rhs_call_name": "IK", "annotation": ""}, "snippet": " q_ik = kin.IK(pos, rot, jnt_arm.get_joint_angles())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99300:If_L33_C4", "label": "if", "type": "if", "loc": [33, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "vector": [4, 1, 0.8846, 0.1026, 1, 0.69, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if q_ik is not None:\n jnt_arm.set_ep(q_ik, 5)\n else:\n print(\"IK failure\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99300:Expr_L34_C8", "label": "set_ep()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99300:If_L33_C4", "vector": [8, 2, 0.8718, 0.0256, 2, 0.18, 0.0, 547, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_ep", "arg_names": [], "import_names": [], "rhs_call_name": "set_ep", "annotation": ""}, "snippet": " jnt_arm.set_ep(q_ik, 5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99300:Expr_L36_C8", "label": "print()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99300:If_L33_C4", "vector": [8, 2, 0.9231, 0.0256, 2, 0.18, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"IK failure\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99300:If_L38_C0", "label": "if", "type": "if", "loc": [38, 39], "level": 0, "parent": null, "vector": [4, 0, 0.9872, 0.0513, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99300:Expr_L39_C4", "label": "main()", "type": "expression", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99300:If_L38_C0", "vector": [8, 1, 1.0, 0.0256, 1, 0.49, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99300:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99300:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99300:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99300:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99300:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99300:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99300:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99300:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99300:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99300:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99300:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99300:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99300:If_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99300:If_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99300:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99300:If_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99300:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99300:If_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99300:Expr_L39_C4"}]
#! /usr/bin/python import numpy as np import roslib roslib.load_manifest("rospy") roslib.load_manifest("std_msgs") roslib.load_manifest("hrl_pr2_arms") import rospy from std_msgs.msg import String import tf.transformations as tf_trans from hrl_pr2_arms.pr2_arm import create_pr2_arm, PR2ArmJointTrajectory, PR2ArmCartesianPostureBase from arm_cart_vel_control import PR2ArmCartVelocityController from hrl_pr2_arms.pr2_controller_switcher import ControllerSwitcher MOVE_BUTTONS = {'translate_up' : (True, tf_trans.euler_matrix(0, -np.pi/2, 0)[:3,:3]), 'translate_down' : (True, tf_trans.euler_matrix(0, np.pi/2, 0)[:3,:3]), 'translate_left' : (True, tf_trans.euler_matrix(0, 0, np.pi/2)[:3,:3]), 'translate_right' : (True, tf_trans.euler_matrix(0, 0, -np.pi/2)[:3,:3]), 'translate_in' : (True, tf_trans.euler_matrix(0, 0, np.pi)[:3,:3]), 'translate_out' : (True, tf_trans.euler_matrix(0, 0, 0)[:3,:3]), 'rotate_x_pos' : (False, tf_trans.euler_matrix(0, 0, 0)[:3,:3]), 'rotate_x_neg' : (False, tf_trans.euler_matrix(0, 0, np.pi)[:3,:3]), 'rotate_y_pos' : (False, tf_trans.euler_matrix(0, 0, np.pi/2)[:3,:3]), 'rotate_y_neg' : (False, tf_trans.euler_matrix(0, 0, -np.pi/2)[:3,:3]), 'rotate_z_pos' : (False, tf_trans.euler_matrix(0, -np.pi/2, 0)[:3,:3]), 'rotate_z_neg' : (False, tf_trans.euler_matrix(0, np.pi/2, 0)[:3,:3])} MONITOR_RATE = 20. MOVE_STATE_TOPIC = "/arm_control_gui/move_state" LOAD_ARM_TOPIC = "/arm_control_gui/load_arm" class ArmCartCtrlBackend(object): def __init__(self, r_arm, l_arm, monitor_rate, misses_allowed=5): self.misses_allowed = misses_allowed self.is_move_connected = False self.last_move_time = 0. self.misses = 0 self.current_arm = "l" self.arm_switch = False self.topic_cmd = "" self.active_cmd = "" self.r_vel_ctrl = PR2ArmCartVelocityController(r_arm) self.l_vel_ctrl = PR2ArmCartVelocityController(l_arm) self.trans_vel = 0.01 self.rot_vel = 0.10 rospy.Subscriber(MOVE_STATE_TOPIC, String, self.move_state_cb) rospy.Subscriber(LOAD_ARM_TOPIC, String, self.load_arm_cb) def move_state_cb(self, msg): self.is_move_connected = True self.last_move_time = rospy.get_time() self.misses = 0 self.topic_cmd = msg.data def load_arm_cb(self, msg): new_arm = msg.data if self.current_arm != new_arm: self.arm_switch = True def check_arm_switched(self): if self.arm_switch: self.arm_switch = False return True return False def check_move_state(self): if rospy.get_time() - self.last_move_time > 1. / MONITOR_RATE: self.misses += 1 if self.misses > self.misses_allowed: self.is_move_connected = False return self.is_move_connected def backend_loop(self): #vel_frame = tf_trans.euler_matrix(0, -np.pi/2, 0)[:3,:3] #vel_ctrl.move_velocity(velocity_rot=vel_frame, velocity=0.005, is_translation=False) vel_ctrl = self.r_vel_ctrl r = rospy.Rate(MONITOR_RATE) while not rospy.is_shutdown(): if self.check_move_state(): if self.topic_cmd != self.active_cmd and self.topic_cmd in MOVE_BUTTONS: self.active_cmd = self.topic_cmd is_translation, vel_frame = MOVE_BUTTONS[self.topic_cmd] if is_translation: vel_val = self.trans_vel else: vel_val = self.rot_vel def move_vel_thread(te): vel_ctrl.move_velocity(velocity_rot=vel_frame, velocity=vel_val, is_translation=is_translation) move_vel_timer = rospy.Timer(rospy.Duration(0.05), move_vel_thread, oneshot=True) if self.topic_cmd == "": self.active_cmd = "" vel_ctrl.stop_moving() else: vel_ctrl.stop_moving() r.sleep() def main(): rospy.init_node("arm_cart_control_backend") ctrl_switcher = ControllerSwitcher() if False: ctrl_switcher.carefree_switch('r', '%s_arm_controller', '$(find hrl_pr2_arms)/params/joint_traj_params_electric.yaml') rospy.sleep(0.5) ctrl_switcher.carefree_switch('r', '%s_joint_controller_low', '$(find hrl_pr2_arms)/params/joint_traj_params_electric_low.yaml') r_arm_js = create_pr2_arm('r', PR2ArmJointTrajectory, controller_name='%s_joint_controller_low') q = [-0.34781704, 0.27341079, -1.75392154, -2.08626393, -3.43756314, -1.82146607, -1.85187734] r_arm_js.set_ep(q, 3) rospy.sleep(6) ctrl_switcher.carefree_switch('r', '%s_cart_low_rfh', '$(find kelsey_sandbox)/params/j_transpose_low_rfh.yaml') r_arm = create_pr2_arm('r', PR2ArmCartesianPostureBase, controller_name='%s_cart_low_rfh') r_arm.set_posture() rospy.sleep(0.2) l_arm = None #l_arm = create_pr2_arm('l', PR2ArmCartesianPostureBase) #l_arm.set_posture() rospy.sleep(0.2) cart_ctrl = ArmCartCtrlBackend(r_arm, l_arm, MONITOR_RATE) cart_ctrl.backend_loop() if __name__ == "__main__": main()
ajibawa-2023/Python-Code-Large/train/row_99301
90
132
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0227, 0.0076, 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_99301:Import_L5_C0", "label": "roslib import roslib", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0379, 0.0076, 0, 0.66, 0.0588, 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_99301:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0455, 0.0076, 0, 0.66, 0.1176, 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_99301:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.053, 0.0076, 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": "roslib.load_manifest(\"std_msgs\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0606, 0.0076, 0, 0.66, 0.2353, 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_99301:Import_L9_C0", "label": "rospy import rospy", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0682, 0.0076, 0, 0.66, 0.2941, 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_99301:ImportFrom_L10_C0", "label": "from std_msgs.msg import String", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0758, 0.0076, 0, 0.66, 0.3529, 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_99301:Import_L11_C0", "label": "tf.transformations import tf_trans", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0076, 0, 0.66, 0.4118, 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_99301:ImportFrom_L13_C0", "label": "from hrl_pr2_arms.pr2_arm import create_pr2_arm, PR2ArmJointTrajectory, PR2ArmCartesianPostureBase", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0985, 0.0076, 0, 0.66, 0.4706, 253, 0, 3, 0, 0, 253, 0, 0], "semantic": {"name": "hrl_pr2_arms.pr2_arm", "arg_names": [], "import_names": ["create_pr2_arm", "PR2ArmJointTrajectory", "PR2ArmCartesianPostureBase"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_pr2_arms.pr2_arm import create_pr2_arm, PR2ArmJointTrajectory, PR2ArmCartesianPostureBase"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:ImportFrom_L14_C0", "label": "from arm_cart_vel_control import PR2ArmCartVelocityController", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.1061, 0.0076, 0, 0.66, 0.5294, 544, 0, 1, 0, 0, 544, 0, 0], "semantic": {"name": "arm_cart_vel_control", "arg_names": [], "import_names": ["PR2ArmCartVelocityController"], "rhs_call_name": "", "annotation": ""}, "snippet": "from arm_cart_vel_control import PR2ArmCartVelocityController"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:ImportFrom_L15_C0", "label": "from hrl_pr2_arms.pr2_controller_switcher import ControllerSwitcher", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1136, 0.0076, 0, 0.66, 0.5882, 395, 0, 1, 0, 0, 395, 0, 0], "semantic": {"name": "hrl_pr2_arms.pr2_controller_switcher", "arg_names": [], "import_names": ["ControllerSwitcher"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_pr2_arms.pr2_controller_switcher import ControllerSwitcher"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L17_C0", "label": "MOVE_BUTTONS =", "type": "assigned_variable", "loc": [17, 28], "level": 0, "parent": null, "vector": [14, 0, 0.1705, 0.0909, 0, 0.66, 0.6471, 431, 0, 0, 0, 0, 0, 6, 12], "semantic": {"name": "MOVE_BUTTONS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MOVE_BUTTONS = {'translate_up' : (True, tf_trans.euler_matrix(0, -np.pi/2, 0)[:3,:3]), \n 'translate_down' : (True, tf_trans.euler_matrix(0, np.pi/2, 0)[:3,:3]), \n 'translate_left' : (True, tf_trans.euler_matrix(0, 0, np.pi/2)[:3,:3]), \n 'translate_right' : (True, tf_trans.euler_matrix(0, 0, -np.pi/2)[:3,:3]), \n 'translate_in' : (True, tf_trans.euler_matrix(0, 0, np.pi)[:3,:3]), \n 'translate_out' : (True, tf_trans.euler_matrix(0, 0, 0)[:3,:3]),\n 'rotate_x_pos' : (False, tf_trans.euler_matrix(0, 0, 0)[:3,:3]),\n 'rotate_x_neg' : (False, tf_trans.euler_matrix(0, 0, np.pi)[:3,:3]),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L30_C0", "label": "MONITOR_RATE =", "type": "assigned_variable", "loc": [30, 30], "level": 0, "parent": null, "vector": [14, 0, 0.2273, 0.0076, 0, 0.66, 0.7059, 438, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "MONITOR_RATE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONITOR_RATE = 20."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L31_C0", "label": "MOVE_STATE_TOPIC =", "type": "assigned_variable", "loc": [31, 31], "level": 0, "parent": null, "vector": [14, 0, 0.2348, 0.0076, 0, 0.66, 0.7647, 153, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MOVE_STATE_TOPIC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MOVE_STATE_TOPIC = \"/arm_control_gui/move_state\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L32_C0", "label": "LOAD_ARM_TOPIC =", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 0.2424, 0.0076, 0, 0.66, 0.8235, 484, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "LOAD_ARM_TOPIC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LOAD_ARM_TOPIC = \"/arm_control_gui/load_arm\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:ClassDef_L34_C0", "label": "ArmCartCtrlBackend", "type": "class", "loc": [34, 103], "level": 0, "parent": null, "vector": [3, 0, 0.5189, 0.5303, 0, 0.66, 0.8824, 412, 0, 7, 0, 0, 186, 0, 15], "semantic": {"name": "ArmCartCtrlBackend", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ArmCartCtrlBackend(object):\n def __init__(self, r_arm, l_arm, monitor_rate, misses_allowed=5):\n self.misses_allowed = misses_allowed\n self.is_move_connected = False\n self.last_move_time = 0.\n self.misses = 0\n self.current_arm = \"l\"\n self.arm_switch = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "label": "__init__", "type": "function", "loc": [35, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:ClassDef_L34_C0", "vector": [2, 1, 0.3258, 0.1288, 1, 0.12, 0.0, 555, 0, 5, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "r_arm", "l_arm", "monitor_rate", "misses_allowed"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, r_arm, l_arm, monitor_rate, misses_allowed=5):\n self.misses_allowed = misses_allowed\n self.is_move_connected = False\n self.last_move_time = 0.\n self.misses = 0\n self.current_arm = \"l\"\n self.arm_switch = False\n self.topic_cmd = \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L36_C8", "label": "self.misses_allowed =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "vector": [14, 2, 0.2727, 0.0076, 2, 0.35, 0.0, 859, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.misses_allowed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.misses_allowed = misses_allowed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L37_C8", "label": "self.is_move_connected =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "vector": [14, 2, 0.2803, 0.0076, 2, 0.35, 0.0769, 515, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_move_connected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_move_connected = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L38_C8", "label": "self.last_move_time =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "vector": [14, 2, 0.2879, 0.0076, 2, 0.35, 0.1538, 413, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.last_move_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.last_move_time = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L39_C8", "label": "self.misses =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "vector": [14, 2, 0.2955, 0.0076, 2, 0.35, 0.2308, 829, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.misses", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.misses = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L40_C8", "label": "self.current_arm =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "vector": [14, 2, 0.303, 0.0076, 2, 0.35, 0.3077, 950, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.current_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_arm = \"l\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L41_C8", "label": "self.arm_switch =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "vector": [14, 2, 0.3106, 0.0076, 2, 0.35, 0.3846, 550, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.arm_switch", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_switch = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L42_C8", "label": "self.topic_cmd =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "vector": [14, 2, 0.3182, 0.0076, 2, 0.35, 0.4615, 217, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.topic_cmd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.topic_cmd = \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L43_C8", "label": "self.active_cmd =", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "vector": [14, 2, 0.3258, 0.0076, 2, 0.35, 0.5385, 811, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.active_cmd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.active_cmd = \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L45_C8", "label": "self.r_vel_ctrl = PR2ArmCartVelocityController()", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "vector": [14, 2, 0.3409, 0.0076, 2, 0.35, 0.6154, 20, 3, 1, 0, 0, 3, 10, 1], "semantic": {"name": "self.r_vel_ctrl", "arg_names": [], "import_names": [], "rhs_call_name": "PR2ArmCartVelocityController", "annotation": ""}, "snippet": " self.r_vel_ctrl = PR2ArmCartVelocityController(r_arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L46_C8", "label": "self.l_vel_ctrl = PR2ArmCartVelocityController()", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "vector": [14, 2, 0.3485, 0.0076, 2, 0.35, 0.6923, 90, 3, 1, 0, 0, 3, 10, 1], "semantic": {"name": "self.l_vel_ctrl", "arg_names": [], "import_names": [], "rhs_call_name": "PR2ArmCartVelocityController", "annotation": ""}, "snippet": " self.l_vel_ctrl = PR2ArmCartVelocityController(l_arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L47_C8", "label": "self.trans_vel =", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "vector": [14, 2, 0.3561, 0.0076, 2, 0.35, 0.7692, 811, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.trans_vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.trans_vel = 0.01"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L48_C8", "label": "self.rot_vel =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "vector": [14, 2, 0.3636, 0.0076, 2, 0.35, 0.8462, 912, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.rot_vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rot_vel = 0.10"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L50_C8", "label": "Subscriber()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "vector": [8, 2, 0.3788, 0.0076, 2, 0.35, 0.9231, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber(MOVE_STATE_TOPIC, String, self.move_state_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L51_C8", "label": "Subscriber()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "vector": [8, 2, 0.3864, 0.0076, 2, 0.35, 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(LOAD_ARM_TOPIC, String, self.load_arm_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L53_C4", "label": "move_state_cb", "type": "function", "loc": [53, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:ClassDef_L34_C0", "vector": [2, 1, 0.4167, 0.0379, 1, 0.12, 0.2, 29, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "move_state_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_state_cb(self, msg):\n self.is_move_connected = True\n self.last_move_time = rospy.get_time()\n self.misses = 0\n self.topic_cmd = msg.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L54_C8", "label": "self.is_move_connected =", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L53_C4", "vector": [14, 2, 0.4091, 0.0076, 2, 0.64, 0.0, 515, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_move_connected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_move_connected = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L55_C8", "label": "self.last_move_time = get_time()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L53_C4", "vector": [14, 2, 0.4167, 0.0076, 2, 0.64, 0.3333, 413, 3, 0, 0, 0, 164, 10, 1], "semantic": {"name": "self.last_move_time", "arg_names": [], "import_names": [], "rhs_call_name": "get_time", "annotation": ""}, "snippet": " self.last_move_time = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L56_C8", "label": "self.misses =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L53_C4", "vector": [14, 2, 0.4242, 0.0076, 2, 0.64, 0.6667, 829, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.misses", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.misses = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L57_C8", "label": "self.topic_cmd =", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L53_C4", "vector": [14, 2, 0.4318, 0.0076, 2, 0.64, 1.0, 217, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.topic_cmd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.topic_cmd = msg.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L59_C4", "label": "load_arm_cb", "type": "function", "loc": [59, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:ClassDef_L34_C0", "vector": [2, 1, 0.4583, 0.0303, 1, 0.12, 0.4, 446, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "load_arm_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def load_arm_cb(self, msg):\n new_arm = msg.data\n if self.current_arm != new_arm:\n self.arm_switch = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L60_C8", "label": "new_arm =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L59_C4", "vector": [14, 2, 0.4545, 0.0076, 2, 0.83, 0.0, 317, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "new_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_arm = msg.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L61_C8", "label": "if", "type": "if", "loc": [61, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L59_C4", "vector": [4, 2, 0.4659, 0.0152, 2, 0.83, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.current_arm != new_arm:\n self.arm_switch = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L62_C12", "label": "self.arm_switch =", "type": "assigned_variable", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L61_C8", "vector": [14, 3, 0.4697, 0.0076, 3, 0.71, 0.0, 550, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.arm_switch", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_switch = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L64_C4", "label": "check_arm_switched", "type": "function", "loc": [64, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:ClassDef_L34_C0", "vector": [2, 1, 0.5, 0.0379, 1, 0.12, 0.6, 477, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "check_arm_switched", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_arm_switched(self):\n if self.arm_switch:\n self.arm_switch = False\n return True\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L65_C8", "label": "if", "type": "if", "loc": [65, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L64_C4", "vector": [4, 2, 0.5, 0.0227, 2, 0.38, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.arm_switch:\n self.arm_switch = False\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L66_C12", "label": "self.arm_switch =", "type": "assigned_variable", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L65_C8", "vector": [14, 3, 0.5, 0.0076, 3, 0.94, 0.0, 550, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.arm_switch", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_switch = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Return_L67_C12", "label": "return", "type": "return", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L65_C8", "vector": [13, 3, 0.5076, 0.0076, 3, 0.94, 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_99301:Return_L68_C8", "label": "return", "type": "return", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L64_C4", "vector": [13, 2, 0.5152, 0.0076, 2, 0.38, 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_99301:FunctionDef_L70_C4", "label": "check_move_state", "type": "function", "loc": [70, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:ClassDef_L34_C0", "vector": [2, 1, 0.5492, 0.0455, 1, 0.12, 0.8, 313, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "check_move_state", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_move_state(self):\n if rospy.get_time() - self.last_move_time > 1. / MONITOR_RATE:\n self.misses += 1\n if self.misses > self.misses_allowed:\n self.is_move_connected = False\n return self.is_move_connected"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L71_C8", "label": "if", "type": "if", "loc": [71, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L70_C4", "vector": [4, 2, 0.5492, 0.0303, 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 rospy.get_time() - self.last_move_time > 1. / MONITOR_RATE:\n self.misses += 1\n if self.misses > self.misses_allowed:\n self.is_move_connected = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L73_C12", "label": "if", "type": "if", "loc": [73, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L71_C8", "vector": [4, 3, 0.5568, 0.0152, 3, 0.11, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.misses > self.misses_allowed:\n self.is_move_connected = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L74_C16", "label": "self.is_move_connected =", "type": "assigned_variable", "loc": [74, 74], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L73_C12", "vector": [14, 4, 0.5606, 0.0076, 4, 0.4, 0.0, 515, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_move_connected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_move_connected = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Return_L75_C8", "label": "return", "type": "return", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L70_C4", "vector": [13, 2, 0.5682, 0.0076, 2, 0.55, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.is_move_connected"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L77_C4", "label": "backend_loop", "type": "function", "loc": [77, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:ClassDef_L34_C0", "vector": [2, 1, 0.6818, 0.2045, 1, 0.12, 1.0, 879, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "backend_loop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def backend_loop(self):\n #vel_frame = tf_trans.euler_matrix(0, -np.pi/2, 0)[:3,:3]\n #vel_ctrl.move_velocity(velocity_rot=vel_frame, velocity=0.005, is_translation=False)\n \n vel_ctrl = self.r_vel_ctrl\n r = rospy.Rate(MONITOR_RATE)\n while not rospy.is_shutdown():\n if self.check_move_state():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L81_C8", "label": "vel_ctrl =", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L77_C4", "vector": [14, 2, 0.6136, 0.0076, 2, 0.72, 0.0, 202, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vel_ctrl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vel_ctrl = self.r_vel_ctrl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L82_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L77_C4", "vector": [14, 2, 0.6212, 0.0076, 2, 0.72, 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(MONITOR_RATE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:While_L83_C8", "label": "while", "type": "while", "loc": [83, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L77_C4", "vector": [5, 2, 0.7045, 0.1591, 2, 0.72, 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 if self.check_move_state():\n if self.topic_cmd != self.active_cmd and self.topic_cmd in MOVE_BUTTONS:\n self.active_cmd = self.topic_cmd\n is_translation, vel_frame = MOVE_BUTTONS[self.topic_cmd]\n if is_translation:\n vel_val = self.trans_vel\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L84_C12", "label": "if", "type": "if", "loc": [84, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:While_L83_C8", "vector": [4, 3, 0.7008, 0.1364, 3, 0.21, 0.0, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.check_move_state():\n if self.topic_cmd != self.active_cmd and self.topic_cmd in MOVE_BUTTONS:\n self.active_cmd = self.topic_cmd\n is_translation, vel_frame = MOVE_BUTTONS[self.topic_cmd]\n if is_translation:\n vel_val = self.trans_vel\n else:\n vel_val = self.rot_vel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L85_C16", "label": "if", "type": "if", "loc": [85, 96], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L84_C12", "vector": [4, 4, 0.6856, 0.0909, 4, 0.55, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.topic_cmd != self.active_cmd and self.topic_cmd in MOVE_BUTTONS:\n self.active_cmd = self.topic_cmd\n is_translation, vel_frame = MOVE_BUTTONS[self.topic_cmd]\n if is_translation:\n vel_val = self.trans_vel\n else:\n vel_val = self.rot_vel\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L86_C20", "label": "self.active_cmd =", "type": "assigned_variable", "loc": [86, 86], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L85_C16", "vector": [14, 5, 0.6515, 0.0076, 5, 0.19, 0.0, 811, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.active_cmd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.active_cmd = self.topic_cmd"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L87_C20", "label": "is_translation, vel_frame =", "type": "assigned_variable", "loc": [87, 87], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L85_C16", "vector": [14, 5, 0.6591, 0.0076, 5, 0.19, 0.25, 620, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "is_translation, vel_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_translation, vel_frame = MOVE_BUTTONS[self.topic_cmd]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L88_C20", "label": "if", "type": "if", "loc": [88, 91], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L85_C16", "vector": [4, 5, 0.678, 0.0303, 5, 0.19, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if is_translation:\n vel_val = self.trans_vel\n else:\n vel_val = self.rot_vel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L89_C24", "label": "vel_val =", "type": "assigned_variable", "loc": [89, 89], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L88_C20", "vector": [14, 6, 0.6742, 0.0076, 6, 0.59, 0.0, 247, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vel_val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vel_val = self.trans_vel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L91_C24", "label": "vel_val =", "type": "assigned_variable", "loc": [91, 91], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L88_C20", "vector": [14, 6, 0.6894, 0.0076, 6, 0.59, 1.0, 247, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vel_val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vel_val = self.rot_vel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L93_C20", "label": "move_vel_thread", "type": "function", "loc": [93, 95], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L85_C16", "vector": [2, 5, 0.7121, 0.0227, 5, 0.19, 0.75, 530, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "move_vel_thread", "arg_names": ["te"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_vel_thread(te):\n vel_ctrl.move_velocity(velocity_rot=vel_frame, velocity=vel_val, \n is_translation=is_translation)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L94_C24", "label": "move_velocity()", "type": "expression", "loc": [94, 95], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L93_C20", "vector": [8, 6, 0.7159, 0.0152, 6, 0.56, 0.0, 94, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "move_velocity", "arg_names": [], "import_names": [], "rhs_call_name": "move_velocity", "annotation": ""}, "snippet": " vel_ctrl.move_velocity(velocity_rot=vel_frame, velocity=vel_val, \n is_translation=is_translation)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L96_C20", "label": "move_vel_timer = Timer()", "type": "assigned_variable", "loc": [96, 96], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L85_C16", "vector": [14, 5, 0.7273, 0.0076, 5, 0.19, 1.0, 140, 3, 3, 0, 0, 771, 10, 2], "semantic": {"name": "move_vel_timer", "arg_names": [], "import_names": [], "rhs_call_name": "Timer", "annotation": ""}, "snippet": " move_vel_timer = rospy.Timer(rospy.Duration(0.05), move_vel_thread, oneshot=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L97_C16", "label": "if", "type": "if", "loc": [97, 99], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L84_C12", "vector": [4, 4, 0.7424, 0.0227, 4, 0.55, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.topic_cmd == \"\":\n self.active_cmd = \"\"\n vel_ctrl.stop_moving()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L98_C20", "label": "self.active_cmd =", "type": "assigned_variable", "loc": [98, 98], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L97_C16", "vector": [14, 5, 0.7424, 0.0076, 5, 0.54, 0.0, 811, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.active_cmd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.active_cmd = \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L99_C20", "label": "stop_moving()", "type": "expression", "loc": [99, 99], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L97_C16", "vector": [8, 5, 0.75, 0.0076, 5, 0.54, 1.0, 744, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop_moving", "arg_names": [], "import_names": [], "rhs_call_name": "stop_moving", "annotation": ""}, "snippet": " vel_ctrl.stop_moving()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L101_C16", "label": "stop_moving()", "type": "expression", "loc": [101, 101], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L84_C12", "vector": [8, 4, 0.7652, 0.0076, 4, 0.55, 1.0, 744, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop_moving", "arg_names": [], "import_names": [], "rhs_call_name": "stop_moving", "annotation": ""}, "snippet": " vel_ctrl.stop_moving()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L103_C12", "label": "sleep()", "type": "expression", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:While_L83_C8", "vector": [8, 3, 0.7803, 0.0076, 3, 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()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L105_C0", "label": "main", "type": "function", "loc": [105, 129], "level": 0, "parent": null, "vector": [2, 0, 0.8864, 0.1894, 0, 0.66, 0.9412, 624, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n rospy.init_node(\"arm_cart_control_backend\")\n ctrl_switcher = ControllerSwitcher()\n if False:\n ctrl_switcher.carefree_switch('r', '%s_arm_controller', \n '$(find hrl_pr2_arms)/params/joint_traj_params_electric.yaml')\n rospy.sleep(0.5)\n ctrl_switcher.carefree_switch('r', '%s_joint_controller_low', "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L106_C4", "label": "init_node()", "type": "expression", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L105_C0", "vector": [8, 1, 0.803, 0.0076, 1, 0.4, 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(\"arm_cart_control_backend\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L107_C4", "label": "ctrl_switcher = ControllerSwitcher()", "type": "assigned_variable", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L105_C0", "vector": [14, 1, 0.8106, 0.0076, 1, 0.4, 0.1, 220, 3, 0, 0, 0, 961, 10, 1], "semantic": {"name": "ctrl_switcher", "arg_names": [], "import_names": [], "rhs_call_name": "ControllerSwitcher", "annotation": ""}, "snippet": " ctrl_switcher = ControllerSwitcher()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L108_C4", "label": "if", "type": "if", "loc": [108, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L105_C0", "vector": [4, 1, 0.8523, 0.0758, 1, 0.4, 0.2, 0, 1, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n ctrl_switcher.carefree_switch('r', '%s_arm_controller', \n '$(find hrl_pr2_arms)/params/joint_traj_params_electric.yaml')\n rospy.sleep(0.5)\n ctrl_switcher.carefree_switch('r', '%s_joint_controller_low', \n '$(find hrl_pr2_arms)/params/joint_traj_params_electric_low.yaml')\n r_arm_js = create_pr2_arm('r', PR2ArmJointTrajectory, controller_name='%s_joint_controller_low')\n q = [-0.34781704, 0.27341079, -1.75392154, -2.08626393, -3.43756314, -1.82146607, -1.85187734]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L109_C8", "label": "carefree_switch()", "type": "expression", "loc": [109, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L108_C4", "vector": [8, 2, 0.8295, 0.0152, 2, 0.38, 0.0, 300, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "carefree_switch", "arg_names": [], "import_names": [], "rhs_call_name": "carefree_switch", "annotation": ""}, "snippet": " ctrl_switcher.carefree_switch('r', '%s_arm_controller', \n '$(find hrl_pr2_arms)/params/joint_traj_params_electric.yaml')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L111_C8", "label": "sleep()", "type": "expression", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L108_C4", "vector": [8, 2, 0.8409, 0.0076, 2, 0.38, 0.1667, 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_99301:Expr_L112_C8", "label": "carefree_switch()", "type": "expression", "loc": [112, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L108_C4", "vector": [8, 2, 0.8523, 0.0152, 2, 0.38, 0.3333, 300, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "carefree_switch", "arg_names": [], "import_names": [], "rhs_call_name": "carefree_switch", "annotation": ""}, "snippet": " ctrl_switcher.carefree_switch('r', '%s_joint_controller_low', \n '$(find hrl_pr2_arms)/params/joint_traj_params_electric_low.yaml')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L114_C8", "label": "r_arm_js = create_pr2_arm()", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L108_C4", "vector": [14, 2, 0.8636, 0.0076, 2, 0.38, 0.5, 965, 3, 3, 0, 0, 318, 10, 1], "semantic": {"name": "r_arm_js", "arg_names": [], "import_names": [], "rhs_call_name": "create_pr2_arm", "annotation": ""}, "snippet": " r_arm_js = create_pr2_arm('r', PR2ArmJointTrajectory, controller_name='%s_joint_controller_low')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L115_C8", "label": "q =", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L108_C4", "vector": [14, 2, 0.8712, 0.0076, 2, 0.38, 0.6667, 516, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q = [-0.34781704, 0.27341079, -1.75392154, -2.08626393, -3.43756314, -1.82146607, -1.85187734]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L116_C8", "label": "set_ep()", "type": "expression", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L108_C4", "vector": [8, 2, 0.8788, 0.0076, 2, 0.38, 0.8333, 547, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_ep", "arg_names": [], "import_names": [], "rhs_call_name": "set_ep", "annotation": ""}, "snippet": " r_arm_js.set_ep(q, 3) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L117_C8", "label": "sleep()", "type": "expression", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L108_C4", "vector": [8, 2, 0.8864, 0.0076, 2, 0.38, 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(6)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L118_C4", "label": "carefree_switch()", "type": "expression", "loc": [118, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L105_C0", "vector": [8, 1, 0.8977, 0.0152, 1, 0.4, 0.3, 300, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "carefree_switch", "arg_names": [], "import_names": [], "rhs_call_name": "carefree_switch", "annotation": ""}, "snippet": " ctrl_switcher.carefree_switch('r', '%s_cart_low_rfh',\n '$(find kelsey_sandbox)/params/j_transpose_low_rfh.yaml')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L121_C4", "label": "r_arm = create_pr2_arm()", "type": "assigned_variable", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L105_C0", "vector": [14, 1, 0.9167, 0.0076, 1, 0.4, 0.4, 315, 3, 3, 0, 0, 318, 10, 1], "semantic": {"name": "r_arm", "arg_names": [], "import_names": [], "rhs_call_name": "create_pr2_arm", "annotation": ""}, "snippet": " r_arm = create_pr2_arm('r', PR2ArmCartesianPostureBase, controller_name='%s_cart_low_rfh')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L122_C4", "label": "set_posture()", "type": "expression", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L105_C0", "vector": [8, 1, 0.9242, 0.0076, 1, 0.4, 0.5, 300, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_posture", "arg_names": [], "import_names": [], "rhs_call_name": "set_posture", "annotation": ""}, "snippet": " r_arm.set_posture()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L123_C4", "label": "sleep()", "type": "expression", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L105_C0", "vector": [8, 1, 0.9318, 0.0076, 1, 0.4, 0.6, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(0.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L124_C4", "label": "l_arm =", "type": "assigned_variable", "loc": [124, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L105_C0", "vector": [14, 1, 0.9394, 0.0076, 1, 0.4, 0.7, 657, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "l_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l_arm = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L127_C4", "label": "sleep()", "type": "expression", "loc": [127, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L105_C0", "vector": [8, 1, 0.9621, 0.0076, 1, 0.4, 0.8, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(0.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L128_C4", "label": "cart_ctrl = ArmCartCtrlBackend()", "type": "assigned_variable", "loc": [128, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L105_C0", "vector": [14, 1, 0.9697, 0.0076, 1, 0.4, 0.9, 719, 3, 3, 0, 0, 412, 10, 1], "semantic": {"name": "cart_ctrl", "arg_names": [], "import_names": [], "rhs_call_name": "ArmCartCtrlBackend", "annotation": ""}, "snippet": " cart_ctrl = ArmCartCtrlBackend(r_arm, l_arm, MONITOR_RATE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L129_C4", "label": "backend_loop()", "type": "expression", "loc": [129, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L105_C0", "vector": [8, 1, 0.9773, 0.0076, 1, 0.4, 1.0, 879, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "backend_loop", "arg_names": [], "import_names": [], "rhs_call_name": "backend_loop", "annotation": ""}, "snippet": " cart_ctrl.backend_loop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L131_C0", "label": "if", "type": "if", "loc": [131, 132], "level": 0, "parent": null, "vector": [4, 0, 0.9962, 0.0152, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L132_C4", "label": "main()", "type": "expression", "loc": [132, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L131_C0", "vector": [8, 1, 1.0, 0.0076, 1, 0.76, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99301:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Return_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Return_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L73_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L74_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Return_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:While_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:While_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L84_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L85_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L85_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L86_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L85_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L87_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L85_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L88_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L88_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L89_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L88_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L91_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L85_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L93_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L93_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L94_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L85_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L96_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L84_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L97_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L97_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L98_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L97_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L99_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L84_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L101_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:While_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Assign_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:FunctionDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99301:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99301:Expr_L132_C4"}]
#! /usr/bin/python import sys import numpy as np import roslib roslib.load_manifest('hrl_pr2_arms') roslib.load_manifest('smach_ros') roslib.load_manifest('actionlib') import rospy import rosbag import smach from smach_ros import SimpleActionState, ServiceState, IntrospectionServer import actionlib import tf import tf.transformations as tf_trans from std_msgs.msg import Bool, Float32 from std_srvs.srv import Empty from geometry_msgs.msg import PoseStamped, Vector3, Pose from actionlib_msgs.msg import GoalStatus from hrl_generic_arms.pose_converter import PoseConverter from hrl_pr2_arms.pr2_arm import create_pr2_arm from hrl_pr2_arms.pr2_arm_hybrid import PR2ArmHybridForce def main(): rospy.init_node("cool_force_demo") from optparse import OptionParser p = OptionParser() p.add_option('-f', '--force_mag', dest="force_mag", default=2, help="Specify force magnitude.") p.add_option('-x', '--max_force', dest="max_force", default=-1, help="Specify max force magnitude.") p.add_option('-c', '--compliance', dest="compliance", default=-1, help="Compliance to maintain.") p.add_option('-t', '--tip_frame', dest="tip_frame", default="/l_gripper_tool_frame", help="Set tip to this frame.") p.add_option('-z', '--zero_sensor', dest="zero_sensor", default=False, action="store_true", help="Just zero the sensor.") p.add_option('-l', '--force_line', dest="force_line", default=False, action="store_true", help="Move in a line with zero force.") p.add_option('-p', '--force_plane', dest="force_plane", default=False, action="store_true", help="Move in a plane with zero force.") p.add_option('-o', '--force_point', dest="force_point", default=False, action="store_true", help="Move about a point with zero torque.") p.add_option('-r', '--force_roll', dest="force_roll", default=False, action="store_true", help="Move the wrist with zero torque.") p.add_option('-a', '--force_all', dest="force_all", default=False, action="store_true", help="All DOF are trying to set zero force.") p.add_option('-n', '--force_none', dest="force_none", default=False, action="store_true", help="Return to position control.") p.add_option('-k', '--kill_controller', dest="kill_controller", default=False, action="store_true", help="Render controller dead.") (opts, args) = p.parse_args() arm = create_pr2_arm('l', PR2ArmHybridForce) rospy.sleep(1) if opts.zero_sensor: arm.zero_sensor() # reset arm arm.set_ep(arm.get_end_effector_pose(), 0) arm.set_force(6 * [0]) fp_trans_major = 3 fp_trans_minor = 1 fp_rot = 0.1 fi_trans_major = 0.002 fi_trans_minor = 0.001 fi_max_trans_major = 10 fi_max_trans_minor = 5 fi_rot = 0 fi_max_rot = 0 pp_trans = 1000 pd_trans_major = 16 pd_trans_minor = 4 pp_rot = 120 pd_rot = 0 if opts.force_line: arm.set_force_max([float(opts.max_force), -1, -1, -1, -1, -1]) arm.set_tip_frame(opts.tip_frame) arm.set_force_gains(p_trans=[fp_trans_major, fp_trans_minor, fp_trans_minor], p_rot=fp_rot, i_trans=[fi_trans_major, fi_trans_minor, fi_trans_minor], i_max_trans=[fi_max_trans_major, fi_max_trans_minor, fi_max_trans_minor], i_rot=fi_rot, i_max_rot=fi_max_rot) arm.set_motion_gains(p_trans=[float(opts.compliance), pp_trans, pp_trans], d_trans=[pd_trans_major, pd_trans_minor, pd_trans_minor], p_rot=pp_rot, d_rot=pd_rot) arm.set_force_directions(['x']) arm.set_force([float(opts.force_mag), 0, 0, 0, 0, 0]) arm.update_gains() return if opts.force_plane: arm.set_force_max([-1, float(opts.max_force), float(opts.max_force), -1, -1, -1, -1]) arm.set_tip_frame(opts.tip_frame) arm.set_force_gains(p_trans=[fp_trans_minor, fp_trans_major, fp_trans_major], p_rot=fp_rot, i_trans=[fi_trans_minor, fi_trans_major, fi_trans_major], i_max_trans=[fi_max_trans_minor, fi_max_trans_major, fi_max_trans_major], i_rot=fi_rot, i_max_rot=fi_max_rot) arm.set_motion_gains(p_trans=[pp_trans, float(opts.compliance), float(opts.compliance)], d_trans=[pd_trans_minor, pd_trans_major, pd_trans_major], p_rot=pp_rot, d_rot=pd_rot) arm.set_force_directions(['y', 'z']) arm.set_force([0, float(opts.force_mag), float(opts.force_mag), 0, 0, 0]) arm.update_gains() return if opts.force_point: arm.set_force_max([-1, -1, -1, -1, -1, -1, -1]) arm.set_tip_frame(opts.tip_frame) arm.set_force_gains(p_trans=[fp_trans_minor, fp_trans_minor, fp_trans_minor], p_rot=0.8, i_trans=[fi_trans_minor, fi_trans_minor, fi_trans_minor], i_max_trans=[fi_max_trans_minor, fi_max_trans_minor, fi_max_trans_minor], i_rot=fi_rot, i_max_rot=fi_max_rot) arm.set_motion_gains(p_trans=[pp_trans, pp_trans, pp_trans], d_trans=[pd_trans_minor, pd_trans_minor, pd_trans_minor], p_rot=pp_rot, d_rot=pd_rot) arm.set_force_directions([0, 0, 0, 1, 1, 1]) arm.set_force([0, 0, 0, float(opts.force_mag), float(opts.force_mag), float(opts.force_mag)]) arm.update_gains() return if opts.force_roll: arm.set_force_max([-1, -1, -1, -1, -1, -1, -1]) arm.set_tip_frame(opts.tip_frame) arm.set_force_gains(p_trans=[fp_trans_minor, fp_trans_minor, fp_trans_minor], p_rot=1.8, i_trans=[fi_trans_minor, fi_trans_minor, fi_trans_minor], i_max_trans=[fi_max_trans_minor, fi_max_trans_minor, fi_max_trans_minor], i_rot=fi_rot, i_max_rot=fi_max_rot) arm.set_motion_gains(p_trans=[pp_trans, pp_trans, pp_trans], d_trans=[pd_trans_minor, pd_trans_minor, pd_trans_minor], p_rot=pp_rot, d_rot=pd_rot) arm.set_force_directions([0, 0, 0, 1, 0, 0]) arm.set_force([0, 0, 0, float(opts.force_mag), 0, 0]) arm.update_gains() return if opts.force_all: arm.set_force_max([-1, -1, -1, -1, -1, -1, -1]) arm.set_tip_frame(opts.tip_frame) arm.set_force_gains(p_trans=6, p_rot=1.8, i_trans=[fi_trans_major, fi_trans_major, fi_trans_major], i_max_trans=[fi_max_trans_major, fi_max_trans_major, fi_max_trans_major], i_rot=fi_rot, i_max_rot=fi_max_rot) arm.set_motion_gains(p_trans=[pp_trans, pp_trans, pp_trans], d_trans=[pd_trans_major, pd_trans_major, pd_trans_major], p_rot=pp_rot, d_rot=pd_rot) arm.set_force_directions([1, 1, 1, 1, 1, 1]) arm.set_force([0, 0, 0, 0, 0, 0]) arm.update_gains() return if opts.force_none: arm.set_force_max([-1, -1, -1, -1, -1, -1, -1]) arm.set_tip_frame(opts.tip_frame) arm.set_force_gains(p_trans=[0, 0, 0], p_rot=0, i_trans=[0, 0, 0], i_max_trans=[0, 0, 0], i_rot=0, i_max_rot=0) arm.set_motion_gains(p_trans=[pp_trans, pp_trans, pp_trans], d_trans=[pd_trans_minor, pd_trans_minor, pd_trans_minor], p_rot=pp_rot, d_rot=pd_rot) arm.set_force_directions([0, 0, 0, 0, 0, 0]) arm.set_force([0, 0, 0, 0, 0, 0]) arm.update_gains() return if opts.kill_controller: arm.set_force_max([-1, -1, -1, -1, -1, -1, -1]) arm.set_tip_frame(opts.tip_frame) arm.set_force_gains(p_trans=[0, 0, 0], p_rot=0, i_trans=[0, 0, 0], i_max_trans=[0, 0, 0], i_rot=0, i_max_rot=0) arm.set_motion_gains(p_trans=0, d_trans=0, p_rot=0, d_rot=0) arm.set_force_directions([0, 0, 0, 0, 0, 0]) arm.set_force([0, 0, 0, 0, 0, 0]) arm.update_gains() return if __name__ == "__main__": main()
ajibawa-2023/Python-Code-Large/train/row_99302
122
189
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0159, 0.0053, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Import_L4_C0", "label": "numpy import np", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0212, 0.0053, 0, 0.66, 0.0476, 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_99302:Import_L6_C0", "label": "roslib import roslib", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0317, 0.0053, 0, 0.66, 0.0952, 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_99302:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.037, 0.0053, 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": "roslib.load_manifest('hrl_pr2_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0423, 0.0053, 0, 0.66, 0.1905, 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('smach_ros')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L9_C0", "label": "load_manifest()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0476, 0.0053, 0, 0.66, 0.2381, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('actionlib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Import_L10_C0", "label": "rospy import rospy", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0529, 0.0053, 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_99302:Import_L11_C0", "label": "rosbag import rosbag", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0582, 0.0053, 0, 0.66, 0.3333, 243, 0, 1, 0, 0, 243, 0, 0], "semantic": {"name": "rosbag", "arg_names": [], "import_names": ["rosbag"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rosbag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Import_L13_C0", "label": "smach import smach", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0688, 0.0053, 0, 0.66, 0.381, 345, 0, 1, 0, 0, 345, 0, 0], "semantic": {"name": "smach", "arg_names": [], "import_names": ["smach"], "rhs_call_name": "", "annotation": ""}, "snippet": "import smach"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:ImportFrom_L14_C0", "label": "from smach_ros import SimpleActionState, ServiceState, IntrospectionServer", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0741, 0.0053, 0, 0.66, 0.4286, 716, 0, 3, 0, 0, 716, 0, 0], "semantic": {"name": "smach_ros", "arg_names": [], "import_names": ["SimpleActionState", "ServiceState", "IntrospectionServer"], "rhs_call_name": "", "annotation": ""}, "snippet": "from smach_ros import SimpleActionState, ServiceState, IntrospectionServer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Import_L15_C0", "label": "actionlib import actionlib", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0794, 0.0053, 0, 0.66, 0.4762, 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_99302:Import_L16_C0", "label": "tf import tf", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0847, 0.0053, 0, 0.66, 0.5238, 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_99302:Import_L17_C0", "label": "tf.transformations import tf_trans", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0899, 0.0053, 0, 0.66, 0.5714, 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_99302:ImportFrom_L18_C0", "label": "from std_msgs.msg import Bool, Float32", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0952, 0.0053, 0, 0.66, 0.619, 366, 0, 2, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Bool", "Float32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Bool, Float32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:ImportFrom_L19_C0", "label": "from std_srvs.srv import Empty", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.1005, 0.0053, 0, 0.66, 0.6667, 261, 0, 1, 0, 0, 261, 0, 0], "semantic": {"name": "std_srvs.srv", "arg_names": [], "import_names": ["Empty"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_srvs.srv import Empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:ImportFrom_L20_C0", "label": "from geometry_msgs.msg import PoseStamped, Vector3, Pose", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.1058, 0.0053, 0, 0.66, 0.7143, 951, 0, 3, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["PoseStamped", "Vector3", "Pose"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import PoseStamped, Vector3, Pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:ImportFrom_L21_C0", "label": "from actionlib_msgs.msg import GoalStatus", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.0053, 0, 0.66, 0.7619, 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_99302:ImportFrom_L23_C0", "label": "from hrl_generic_arms.pose_converter import PoseConverter", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.1217, 0.0053, 0, 0.66, 0.8095, 752, 0, 1, 0, 0, 752, 0, 0], "semantic": {"name": "hrl_generic_arms.pose_converter", "arg_names": [], "import_names": ["PoseConverter"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_generic_arms.pose_converter import PoseConverter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:ImportFrom_L24_C0", "label": "from hrl_pr2_arms.pr2_arm import create_pr2_arm", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.127, 0.0053, 0, 0.66, 0.8571, 253, 0, 1, 0, 0, 253, 0, 0], "semantic": {"name": "hrl_pr2_arms.pr2_arm", "arg_names": [], "import_names": ["create_pr2_arm"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_pr2_arms.pr2_arm import create_pr2_arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:ImportFrom_L25_C0", "label": "from hrl_pr2_arms.pr2_arm_hybrid import PR2ArmHybridForce", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.1323, 0.0053, 0, 0.66, 0.9048, 910, 0, 1, 0, 0, 910, 0, 0], "semantic": {"name": "hrl_pr2_arms.pr2_arm_hybrid", "arg_names": [], "import_names": ["PR2ArmHybridForce"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_pr2_arms.pr2_arm_hybrid import PR2ArmHybridForce"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "label": "main", "type": "function", "loc": [27, 186], "level": 0, "parent": null, "vector": [2, 0, 0.5635, 0.8466, 0, 0.66, 0.9524, 624, 0, 0, 0, 0, 0, 0, 83], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n rospy.init_node(\"cool_force_demo\")\n\n from optparse import OptionParser\n p = OptionParser()\n p.add_option('-f', '--force_mag', dest=\"force_mag\", default=2,\n help=\"Specify force magnitude.\")\n p.add_option('-x', '--max_force', dest=\"max_force\", default=-1,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L28_C4", "label": "init_node()", "type": "expression", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [8, 1, 0.1481, 0.0053, 1, 0.49, 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(\"cool_force_demo\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:ImportFrom_L30_C4", "label": "from optparse import OptionParser", "type": "import", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [1, 1, 0.1587, 0.0053, 1, 0.49, 0.0244, 323, 0, 1, 0, 0, 323, 0, 0], "semantic": {"name": "optparse", "arg_names": [], "import_names": ["OptionParser"], "rhs_call_name": "", "annotation": ""}, "snippet": " from optparse import OptionParser"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L31_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [14, 1, 0.164, 0.0053, 1, 0.49, 0.0488, 491, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "OptionParser", "annotation": ""}, "snippet": " p = OptionParser()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L32_C4", "label": "add_option()", "type": "expression", "loc": [32, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [8, 1, 0.172, 0.0106, 1, 0.49, 0.0732, 176, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-f', '--force_mag', dest=\"force_mag\", default=2,\n help=\"Specify force magnitude.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L34_C4", "label": "add_option()", "type": "expression", "loc": [34, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [8, 1, 0.1825, 0.0106, 1, 0.49, 0.0976, 176, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-x', '--max_force', dest=\"max_force\", default=-1,\n help=\"Specify max force magnitude.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L36_C4", "label": "add_option()", "type": "expression", "loc": [36, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [8, 1, 0.1931, 0.0106, 1, 0.49, 0.122, 176, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-c', '--compliance', dest=\"compliance\", default=-1,\n help=\"Compliance to maintain.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L38_C4", "label": "add_option()", "type": "expression", "loc": [38, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [8, 1, 0.2037, 0.0106, 1, 0.49, 0.1463, 176, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-t', '--tip_frame', dest=\"tip_frame\", default=\"/l_gripper_tool_frame\",\n help=\"Set tip to this frame.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L40_C4", "label": "add_option()", "type": "expression", "loc": [40, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [8, 1, 0.2143, 0.0106, 1, 0.49, 0.1707, 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('-z', '--zero_sensor', dest=\"zero_sensor\", default=False,\n action=\"store_true\", help=\"Just zero the sensor.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L42_C4", "label": "add_option()", "type": "expression", "loc": [42, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [8, 1, 0.2249, 0.0106, 1, 0.49, 0.1951, 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('-l', '--force_line', dest=\"force_line\", default=False,\n action=\"store_true\", help=\"Move in a line with zero force.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L44_C4", "label": "add_option()", "type": "expression", "loc": [44, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [8, 1, 0.2354, 0.0106, 1, 0.49, 0.2195, 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', '--force_plane', dest=\"force_plane\", default=False,\n action=\"store_true\", help=\"Move in a plane with zero force.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L46_C4", "label": "add_option()", "type": "expression", "loc": [46, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [8, 1, 0.246, 0.0106, 1, 0.49, 0.2439, 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('-o', '--force_point', dest=\"force_point\", default=False,\n action=\"store_true\", help=\"Move about a point with zero torque.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L48_C4", "label": "add_option()", "type": "expression", "loc": [48, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [8, 1, 0.2566, 0.0106, 1, 0.49, 0.2683, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-r', '--force_roll', dest=\"force_roll\", default=False,\n action=\"store_true\", help=\"Move the wrist with zero torque.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L50_C4", "label": "add_option()", "type": "expression", "loc": [50, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [8, 1, 0.2672, 0.0106, 1, 0.49, 0.2927, 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('-a', '--force_all', dest=\"force_all\", default=False,\n action=\"store_true\", help=\"All DOF are trying to set zero force.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L52_C4", "label": "add_option()", "type": "expression", "loc": [52, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [8, 1, 0.2778, 0.0106, 1, 0.49, 0.3171, 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', '--force_none', dest=\"force_none\", default=False,\n action=\"store_true\", help=\"Return to position control.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L54_C4", "label": "add_option()", "type": "expression", "loc": [54, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [8, 1, 0.2884, 0.0106, 1, 0.49, 0.3415, 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('-k', '--kill_controller', dest=\"kill_controller\", default=False,\n action=\"store_true\", help=\"Render controller dead.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L56_C4", "label": "opts, args = parse_args()", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [14, 1, 0.2963, 0.0053, 1, 0.49, 0.3659, 616, 3, 0, 0, 0, 187, 10, 1], "semantic": {"name": "opts, args", "arg_names": [], "import_names": [], "rhs_call_name": "parse_args", "annotation": ""}, "snippet": " (opts, args) = p.parse_args()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L58_C4", "label": "arm = create_pr2_arm()", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [14, 1, 0.3069, 0.0053, 1, 0.49, 0.3902, 413, 3, 2, 0, 0, 318, 10, 1], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "create_pr2_arm", "annotation": ""}, "snippet": " arm = create_pr2_arm('l', PR2ArmHybridForce)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L59_C4", "label": "sleep()", "type": "expression", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [8, 1, 0.3122, 0.0053, 1, 0.49, 0.4146, 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_99302:If_L61_C4", "label": "if", "type": "if", "loc": [61, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [4, 1, 0.3254, 0.0106, 1, 0.49, 0.439, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opts.zero_sensor:\n arm.zero_sensor()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L62_C8", "label": "zero_sensor()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L61_C4", "vector": [8, 2, 0.328, 0.0053, 2, 0.12, 0.0, 103, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "zero_sensor", "arg_names": [], "import_names": [], "rhs_call_name": "zero_sensor", "annotation": ""}, "snippet": " arm.zero_sensor()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L65_C4", "label": "set_ep()", "type": "expression", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [8, 1, 0.3439, 0.0053, 1, 0.49, 0.4634, 547, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "set_ep", "arg_names": [], "import_names": [], "rhs_call_name": "set_ep", "annotation": ""}, "snippet": " arm.set_ep(arm.get_end_effector_pose(), 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L66_C4", "label": "set_force()", "type": "expression", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [8, 1, 0.3492, 0.0053, 1, 0.49, 0.4878, 329, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_force", "arg_names": [], "import_names": [], "rhs_call_name": "set_force", "annotation": ""}, "snippet": " arm.set_force(6 * [0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L68_C4", "label": "fp_trans_major =", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [14, 1, 0.3598, 0.0053, 1, 0.49, 0.5122, 797, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "fp_trans_major", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fp_trans_major = 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L69_C4", "label": "fp_trans_minor =", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [14, 1, 0.3651, 0.0053, 1, 0.49, 0.5366, 511, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "fp_trans_minor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fp_trans_minor = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L70_C4", "label": "fp_rot =", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [14, 1, 0.3704, 0.0053, 1, 0.49, 0.561, 255, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "fp_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fp_rot = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L71_C4", "label": "fi_trans_major =", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [14, 1, 0.3757, 0.0053, 1, 0.49, 0.5854, 780, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "fi_trans_major", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fi_trans_major = 0.002"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L72_C4", "label": "fi_trans_minor =", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [14, 1, 0.381, 0.0053, 1, 0.49, 0.6098, 538, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "fi_trans_minor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fi_trans_minor = 0.001"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L73_C4", "label": "fi_max_trans_major =", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [14, 1, 0.3862, 0.0053, 1, 0.49, 0.6341, 960, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "fi_max_trans_major", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fi_max_trans_major = 10"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L74_C4", "label": "fi_max_trans_minor =", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [14, 1, 0.3915, 0.0053, 1, 0.49, 0.6585, 975, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "fi_max_trans_minor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fi_max_trans_minor = 5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L75_C4", "label": "fi_rot =", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [14, 1, 0.3968, 0.0053, 1, 0.49, 0.6829, 898, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "fi_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fi_rot = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L76_C4", "label": "fi_max_rot =", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [14, 1, 0.4021, 0.0053, 1, 0.49, 0.7073, 509, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "fi_max_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fi_max_rot = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L77_C4", "label": "pp_trans =", "type": "assigned_variable", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [14, 1, 0.4074, 0.0053, 1, 0.49, 0.7317, 411, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "pp_trans", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pp_trans = 1000"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L78_C4", "label": "pd_trans_major =", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [14, 1, 0.4127, 0.0053, 1, 0.49, 0.7561, 586, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "pd_trans_major", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pd_trans_major = 16"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L79_C4", "label": "pd_trans_minor =", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [14, 1, 0.418, 0.0053, 1, 0.49, 0.7805, 22, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "pd_trans_minor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pd_trans_minor = 4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L80_C4", "label": "pp_rot =", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [14, 1, 0.4233, 0.0053, 1, 0.49, 0.8049, 774, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "pp_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pp_rot = 120"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L81_C4", "label": "pd_rot =", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [14, 1, 0.4286, 0.0053, 1, 0.49, 0.8293, 671, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "pd_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pd_rot = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L83_C4", "label": "if", "type": "if", "loc": [83, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [4, 1, 0.4735, 0.0741, 1, 0.49, 0.8537, 0, 7, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opts.force_line:\n arm.set_force_max([float(opts.max_force), -1, -1, -1, -1, -1])\n arm.set_tip_frame(opts.tip_frame)\n arm.set_force_gains(p_trans=[fp_trans_major, fp_trans_minor, fp_trans_minor], \n p_rot=fp_rot, i_trans=[fi_trans_major, fi_trans_minor, fi_trans_minor],\n i_max_trans=[fi_max_trans_major, fi_max_trans_minor, fi_max_trans_minor], \n i_rot=fi_rot, i_max_rot=fi_max_rot)\n arm.set_motion_gains(p_trans=[float(opts.compliance), pp_trans, pp_trans], "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L84_C8", "label": "set_force_max()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L83_C4", "vector": [8, 2, 0.4444, 0.0053, 2, 0.07, 0.0, 198, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_force_max", "arg_names": [], "import_names": [], "rhs_call_name": "set_force_max", "annotation": ""}, "snippet": " arm.set_force_max([float(opts.max_force), -1, -1, -1, -1, -1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L85_C8", "label": "set_tip_frame()", "type": "expression", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L83_C4", "vector": [8, 2, 0.4497, 0.0053, 2, 0.07, 0.1429, 819, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_tip_frame", "arg_names": [], "import_names": [], "rhs_call_name": "set_tip_frame", "annotation": ""}, "snippet": " arm.set_tip_frame(opts.tip_frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L86_C8", "label": "set_force_gains()", "type": "expression", "loc": [86, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L83_C4", "vector": [8, 2, 0.463, 0.0212, 2, 0.07, 0.2857, 892, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "set_force_gains", "arg_names": [], "import_names": [], "rhs_call_name": "set_force_gains", "annotation": ""}, "snippet": " arm.set_force_gains(p_trans=[fp_trans_major, fp_trans_minor, fp_trans_minor], \n p_rot=fp_rot, i_trans=[fi_trans_major, fi_trans_minor, fi_trans_minor],\n i_max_trans=[fi_max_trans_major, fi_max_trans_minor, fi_max_trans_minor], \n i_rot=fi_rot, i_max_rot=fi_max_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L90_C8", "label": "set_motion_gains()", "type": "expression", "loc": [90, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L83_C4", "vector": [8, 2, 0.4815, 0.0159, 2, 0.07, 0.4286, 965, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "set_motion_gains", "arg_names": [], "import_names": [], "rhs_call_name": "set_motion_gains", "annotation": ""}, "snippet": " arm.set_motion_gains(p_trans=[float(opts.compliance), pp_trans, pp_trans], \n d_trans=[pd_trans_major, pd_trans_minor, pd_trans_minor],\n p_rot=pp_rot, d_rot=pd_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L93_C8", "label": "set_force_directions()", "type": "expression", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L83_C4", "vector": [8, 2, 0.4921, 0.0053, 2, 0.07, 0.5714, 788, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_force_directions", "arg_names": [], "import_names": [], "rhs_call_name": "set_force_directions", "annotation": ""}, "snippet": " arm.set_force_directions(['x'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L94_C8", "label": "set_force()", "type": "expression", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L83_C4", "vector": [8, 2, 0.4974, 0.0053, 2, 0.07, 0.7143, 329, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_force", "arg_names": [], "import_names": [], "rhs_call_name": "set_force", "annotation": ""}, "snippet": " arm.set_force([float(opts.force_mag), 0, 0, 0, 0, 0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L95_C8", "label": "update_gains()", "type": "expression", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L83_C4", "vector": [8, 2, 0.5026, 0.0053, 2, 0.07, 0.8571, 582, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "update_gains", "arg_names": [], "import_names": [], "rhs_call_name": "update_gains", "annotation": ""}, "snippet": " arm.update_gains()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Return_L96_C8", "label": "return", "type": "return", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L83_C4", "vector": [13, 2, 0.5079, 0.0053, 2, 0.07, 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_99302:If_L98_C4", "label": "if", "type": "if", "loc": [98, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [4, 1, 0.5529, 0.0741, 1, 0.49, 0.878, 0, 7, 0, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opts.force_plane:\n arm.set_force_max([-1, float(opts.max_force), float(opts.max_force), -1, -1, -1, -1])\n arm.set_tip_frame(opts.tip_frame)\n arm.set_force_gains(p_trans=[fp_trans_minor, fp_trans_major, fp_trans_major], \n p_rot=fp_rot, i_trans=[fi_trans_minor, fi_trans_major, fi_trans_major],\n i_max_trans=[fi_max_trans_minor, fi_max_trans_major, fi_max_trans_major], \n i_rot=fi_rot, i_max_rot=fi_max_rot)\n arm.set_motion_gains(p_trans=[pp_trans, float(opts.compliance), float(opts.compliance)], "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L99_C8", "label": "set_force_max()", "type": "expression", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L98_C4", "vector": [8, 2, 0.5238, 0.0053, 2, 0.43, 0.0, 198, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "set_force_max", "arg_names": [], "import_names": [], "rhs_call_name": "set_force_max", "annotation": ""}, "snippet": " arm.set_force_max([-1, float(opts.max_force), float(opts.max_force), -1, -1, -1, -1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L100_C8", "label": "set_tip_frame()", "type": "expression", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L98_C4", "vector": [8, 2, 0.5291, 0.0053, 2, 0.43, 0.1429, 819, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_tip_frame", "arg_names": [], "import_names": [], "rhs_call_name": "set_tip_frame", "annotation": ""}, "snippet": " arm.set_tip_frame(opts.tip_frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L101_C8", "label": "set_force_gains()", "type": "expression", "loc": [101, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L98_C4", "vector": [8, 2, 0.5423, 0.0212, 2, 0.43, 0.2857, 892, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "set_force_gains", "arg_names": [], "import_names": [], "rhs_call_name": "set_force_gains", "annotation": ""}, "snippet": " arm.set_force_gains(p_trans=[fp_trans_minor, fp_trans_major, fp_trans_major], \n p_rot=fp_rot, i_trans=[fi_trans_minor, fi_trans_major, fi_trans_major],\n i_max_trans=[fi_max_trans_minor, fi_max_trans_major, fi_max_trans_major], \n i_rot=fi_rot, i_max_rot=fi_max_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L105_C8", "label": "set_motion_gains()", "type": "expression", "loc": [105, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L98_C4", "vector": [8, 2, 0.5608, 0.0159, 2, 0.43, 0.4286, 965, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "set_motion_gains", "arg_names": [], "import_names": [], "rhs_call_name": "set_motion_gains", "annotation": ""}, "snippet": " arm.set_motion_gains(p_trans=[pp_trans, float(opts.compliance), float(opts.compliance)], \n d_trans=[pd_trans_minor, pd_trans_major, pd_trans_major], \n p_rot=pp_rot, d_rot=pd_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L108_C8", "label": "set_force_directions()", "type": "expression", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L98_C4", "vector": [8, 2, 0.5714, 0.0053, 2, 0.43, 0.5714, 788, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_force_directions", "arg_names": [], "import_names": [], "rhs_call_name": "set_force_directions", "annotation": ""}, "snippet": " arm.set_force_directions(['y', 'z'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L109_C8", "label": "set_force()", "type": "expression", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L98_C4", "vector": [8, 2, 0.5767, 0.0053, 2, 0.43, 0.7143, 329, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "set_force", "arg_names": [], "import_names": [], "rhs_call_name": "set_force", "annotation": ""}, "snippet": " arm.set_force([0, float(opts.force_mag), float(opts.force_mag), 0, 0, 0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L110_C8", "label": "update_gains()", "type": "expression", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L98_C4", "vector": [8, 2, 0.582, 0.0053, 2, 0.43, 0.8571, 582, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "update_gains", "arg_names": [], "import_names": [], "rhs_call_name": "update_gains", "annotation": ""}, "snippet": " arm.update_gains()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Return_L111_C8", "label": "return", "type": "return", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L98_C4", "vector": [13, 2, 0.5873, 0.0053, 2, 0.43, 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_99302:If_L113_C4", "label": "if", "type": "if", "loc": [113, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [4, 1, 0.6323, 0.0741, 1, 0.49, 0.9024, 0, 7, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opts.force_point:\n arm.set_force_max([-1, -1, -1, -1, -1, -1, -1])\n arm.set_tip_frame(opts.tip_frame)\n arm.set_force_gains(p_trans=[fp_trans_minor, fp_trans_minor, fp_trans_minor], \n p_rot=0.8, i_trans=[fi_trans_minor, fi_trans_minor, fi_trans_minor],\n i_max_trans=[fi_max_trans_minor, fi_max_trans_minor, fi_max_trans_minor], \n i_rot=fi_rot, i_max_rot=fi_max_rot)\n arm.set_motion_gains(p_trans=[pp_trans, pp_trans, pp_trans], "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L114_C8", "label": "set_force_max()", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L113_C4", "vector": [8, 2, 0.6032, 0.0053, 2, 0.09, 0.0, 198, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_force_max", "arg_names": [], "import_names": [], "rhs_call_name": "set_force_max", "annotation": ""}, "snippet": " arm.set_force_max([-1, -1, -1, -1, -1, -1, -1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L115_C8", "label": "set_tip_frame()", "type": "expression", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L113_C4", "vector": [8, 2, 0.6085, 0.0053, 2, 0.09, 0.1429, 819, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_tip_frame", "arg_names": [], "import_names": [], "rhs_call_name": "set_tip_frame", "annotation": ""}, "snippet": " arm.set_tip_frame(opts.tip_frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L116_C8", "label": "set_force_gains()", "type": "expression", "loc": [116, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L113_C4", "vector": [8, 2, 0.6217, 0.0212, 2, 0.09, 0.2857, 892, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "set_force_gains", "arg_names": [], "import_names": [], "rhs_call_name": "set_force_gains", "annotation": ""}, "snippet": " arm.set_force_gains(p_trans=[fp_trans_minor, fp_trans_minor, fp_trans_minor], \n p_rot=0.8, i_trans=[fi_trans_minor, fi_trans_minor, fi_trans_minor],\n i_max_trans=[fi_max_trans_minor, fi_max_trans_minor, fi_max_trans_minor], \n i_rot=fi_rot, i_max_rot=fi_max_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L120_C8", "label": "set_motion_gains()", "type": "expression", "loc": [120, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L113_C4", "vector": [8, 2, 0.6402, 0.0159, 2, 0.09, 0.4286, 965, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "set_motion_gains", "arg_names": [], "import_names": [], "rhs_call_name": "set_motion_gains", "annotation": ""}, "snippet": " arm.set_motion_gains(p_trans=[pp_trans, pp_trans, pp_trans], \n d_trans=[pd_trans_minor, pd_trans_minor, pd_trans_minor], \n p_rot=pp_rot, d_rot=pd_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L123_C8", "label": "set_force_directions()", "type": "expression", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L113_C4", "vector": [8, 2, 0.6508, 0.0053, 2, 0.09, 0.5714, 788, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_force_directions", "arg_names": [], "import_names": [], "rhs_call_name": "set_force_directions", "annotation": ""}, "snippet": " arm.set_force_directions([0, 0, 0, 1, 1, 1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L124_C8", "label": "set_force()", "type": "expression", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L113_C4", "vector": [8, 2, 0.6561, 0.0053, 2, 0.09, 0.7143, 329, 3, 1, 0, 0, 0, 0, 4], "semantic": {"name": "set_force", "arg_names": [], "import_names": [], "rhs_call_name": "set_force", "annotation": ""}, "snippet": " arm.set_force([0, 0, 0, float(opts.force_mag), float(opts.force_mag), float(opts.force_mag)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L125_C8", "label": "update_gains()", "type": "expression", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L113_C4", "vector": [8, 2, 0.6614, 0.0053, 2, 0.09, 0.8571, 582, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "update_gains", "arg_names": [], "import_names": [], "rhs_call_name": "update_gains", "annotation": ""}, "snippet": " arm.update_gains()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Return_L126_C8", "label": "return", "type": "return", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L113_C4", "vector": [13, 2, 0.6667, 0.0053, 2, 0.09, 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_99302:If_L128_C4", "label": "if", "type": "if", "loc": [128, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [4, 1, 0.7116, 0.0741, 1, 0.49, 0.9268, 0, 7, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opts.force_roll:\n arm.set_force_max([-1, -1, -1, -1, -1, -1, -1])\n arm.set_tip_frame(opts.tip_frame)\n arm.set_force_gains(p_trans=[fp_trans_minor, fp_trans_minor, fp_trans_minor], \n p_rot=1.8, i_trans=[fi_trans_minor, fi_trans_minor, fi_trans_minor],\n i_max_trans=[fi_max_trans_minor, fi_max_trans_minor, fi_max_trans_minor], \n i_rot=fi_rot, i_max_rot=fi_max_rot)\n arm.set_motion_gains(p_trans=[pp_trans, pp_trans, pp_trans], "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L129_C8", "label": "set_force_max()", "type": "expression", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L128_C4", "vector": [8, 2, 0.6825, 0.0053, 2, 0.76, 0.0, 198, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_force_max", "arg_names": [], "import_names": [], "rhs_call_name": "set_force_max", "annotation": ""}, "snippet": " arm.set_force_max([-1, -1, -1, -1, -1, -1, -1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L130_C8", "label": "set_tip_frame()", "type": "expression", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L128_C4", "vector": [8, 2, 0.6878, 0.0053, 2, 0.76, 0.1429, 819, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_tip_frame", "arg_names": [], "import_names": [], "rhs_call_name": "set_tip_frame", "annotation": ""}, "snippet": " arm.set_tip_frame(opts.tip_frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L131_C8", "label": "set_force_gains()", "type": "expression", "loc": [131, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L128_C4", "vector": [8, 2, 0.7011, 0.0212, 2, 0.76, 0.2857, 892, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "set_force_gains", "arg_names": [], "import_names": [], "rhs_call_name": "set_force_gains", "annotation": ""}, "snippet": " arm.set_force_gains(p_trans=[fp_trans_minor, fp_trans_minor, fp_trans_minor], \n p_rot=1.8, i_trans=[fi_trans_minor, fi_trans_minor, fi_trans_minor],\n i_max_trans=[fi_max_trans_minor, fi_max_trans_minor, fi_max_trans_minor], \n i_rot=fi_rot, i_max_rot=fi_max_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L135_C8", "label": "set_motion_gains()", "type": "expression", "loc": [135, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L128_C4", "vector": [8, 2, 0.7196, 0.0159, 2, 0.76, 0.4286, 965, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "set_motion_gains", "arg_names": [], "import_names": [], "rhs_call_name": "set_motion_gains", "annotation": ""}, "snippet": " arm.set_motion_gains(p_trans=[pp_trans, pp_trans, pp_trans], \n d_trans=[pd_trans_minor, pd_trans_minor, pd_trans_minor], \n p_rot=pp_rot, d_rot=pd_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L138_C8", "label": "set_force_directions()", "type": "expression", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L128_C4", "vector": [8, 2, 0.7302, 0.0053, 2, 0.76, 0.5714, 788, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_force_directions", "arg_names": [], "import_names": [], "rhs_call_name": "set_force_directions", "annotation": ""}, "snippet": " arm.set_force_directions([0, 0, 0, 1, 0, 0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L139_C8", "label": "set_force()", "type": "expression", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L128_C4", "vector": [8, 2, 0.7354, 0.0053, 2, 0.76, 0.7143, 329, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_force", "arg_names": [], "import_names": [], "rhs_call_name": "set_force", "annotation": ""}, "snippet": " arm.set_force([0, 0, 0, float(opts.force_mag), 0, 0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L140_C8", "label": "update_gains()", "type": "expression", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L128_C4", "vector": [8, 2, 0.7407, 0.0053, 2, 0.76, 0.8571, 582, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "update_gains", "arg_names": [], "import_names": [], "rhs_call_name": "update_gains", "annotation": ""}, "snippet": " arm.update_gains()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Return_L141_C8", "label": "return", "type": "return", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L128_C4", "vector": [13, 2, 0.746, 0.0053, 2, 0.76, 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_99302:If_L143_C4", "label": "if", "type": "if", "loc": [143, 156], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [4, 1, 0.791, 0.0741, 1, 0.49, 0.9512, 0, 7, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opts.force_all:\n arm.set_force_max([-1, -1, -1, -1, -1, -1, -1])\n arm.set_tip_frame(opts.tip_frame)\n arm.set_force_gains(p_trans=6, \n p_rot=1.8, i_trans=[fi_trans_major, fi_trans_major, fi_trans_major],\n i_max_trans=[fi_max_trans_major, fi_max_trans_major, fi_max_trans_major], \n i_rot=fi_rot, i_max_rot=fi_max_rot)\n arm.set_motion_gains(p_trans=[pp_trans, pp_trans, pp_trans], "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L144_C8", "label": "set_force_max()", "type": "expression", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L143_C4", "vector": [8, 2, 0.7619, 0.0053, 2, 0.85, 0.0, 198, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_force_max", "arg_names": [], "import_names": [], "rhs_call_name": "set_force_max", "annotation": ""}, "snippet": " arm.set_force_max([-1, -1, -1, -1, -1, -1, -1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L145_C8", "label": "set_tip_frame()", "type": "expression", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L143_C4", "vector": [8, 2, 0.7672, 0.0053, 2, 0.85, 0.1429, 819, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_tip_frame", "arg_names": [], "import_names": [], "rhs_call_name": "set_tip_frame", "annotation": ""}, "snippet": " arm.set_tip_frame(opts.tip_frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L146_C8", "label": "set_force_gains()", "type": "expression", "loc": [146, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L143_C4", "vector": [8, 2, 0.7804, 0.0212, 2, 0.85, 0.2857, 892, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "set_force_gains", "arg_names": [], "import_names": [], "rhs_call_name": "set_force_gains", "annotation": ""}, "snippet": " arm.set_force_gains(p_trans=6, \n p_rot=1.8, i_trans=[fi_trans_major, fi_trans_major, fi_trans_major],\n i_max_trans=[fi_max_trans_major, fi_max_trans_major, fi_max_trans_major], \n i_rot=fi_rot, i_max_rot=fi_max_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L150_C8", "label": "set_motion_gains()", "type": "expression", "loc": [150, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L143_C4", "vector": [8, 2, 0.7989, 0.0159, 2, 0.85, 0.4286, 965, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "set_motion_gains", "arg_names": [], "import_names": [], "rhs_call_name": "set_motion_gains", "annotation": ""}, "snippet": " arm.set_motion_gains(p_trans=[pp_trans, pp_trans, pp_trans], \n d_trans=[pd_trans_major, pd_trans_major, pd_trans_major], \n p_rot=pp_rot, d_rot=pd_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L153_C8", "label": "set_force_directions()", "type": "expression", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L143_C4", "vector": [8, 2, 0.8095, 0.0053, 2, 0.85, 0.5714, 788, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_force_directions", "arg_names": [], "import_names": [], "rhs_call_name": "set_force_directions", "annotation": ""}, "snippet": " arm.set_force_directions([1, 1, 1, 1, 1, 1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L154_C8", "label": "set_force()", "type": "expression", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L143_C4", "vector": [8, 2, 0.8148, 0.0053, 2, 0.85, 0.7143, 329, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_force", "arg_names": [], "import_names": [], "rhs_call_name": "set_force", "annotation": ""}, "snippet": " arm.set_force([0, 0, 0, 0, 0, 0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L155_C8", "label": "update_gains()", "type": "expression", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L143_C4", "vector": [8, 2, 0.8201, 0.0053, 2, 0.85, 0.8571, 582, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "update_gains", "arg_names": [], "import_names": [], "rhs_call_name": "update_gains", "annotation": ""}, "snippet": " arm.update_gains()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Return_L156_C8", "label": "return", "type": "return", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L143_C4", "vector": [13, 2, 0.8254, 0.0053, 2, 0.85, 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_99302:If_L158_C4", "label": "if", "type": "if", "loc": [158, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [4, 1, 0.8704, 0.0741, 1, 0.49, 0.9756, 0, 7, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opts.force_none:\n arm.set_force_max([-1, -1, -1, -1, -1, -1, -1])\n arm.set_tip_frame(opts.tip_frame)\n arm.set_force_gains(p_trans=[0, 0, 0], \n p_rot=0, i_trans=[0, 0, 0],\n i_max_trans=[0, 0, 0], \n i_rot=0, i_max_rot=0)\n arm.set_motion_gains(p_trans=[pp_trans, pp_trans, pp_trans], "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L159_C8", "label": "set_force_max()", "type": "expression", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L158_C4", "vector": [8, 2, 0.8413, 0.0053, 2, 0.16, 0.0, 198, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_force_max", "arg_names": [], "import_names": [], "rhs_call_name": "set_force_max", "annotation": ""}, "snippet": " arm.set_force_max([-1, -1, -1, -1, -1, -1, -1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L160_C8", "label": "set_tip_frame()", "type": "expression", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L158_C4", "vector": [8, 2, 0.8466, 0.0053, 2, 0.16, 0.1429, 819, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_tip_frame", "arg_names": [], "import_names": [], "rhs_call_name": "set_tip_frame", "annotation": ""}, "snippet": " arm.set_tip_frame(opts.tip_frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L161_C8", "label": "set_force_gains()", "type": "expression", "loc": [161, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L158_C4", "vector": [8, 2, 0.8598, 0.0212, 2, 0.16, 0.2857, 892, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "set_force_gains", "arg_names": [], "import_names": [], "rhs_call_name": "set_force_gains", "annotation": ""}, "snippet": " arm.set_force_gains(p_trans=[0, 0, 0], \n p_rot=0, i_trans=[0, 0, 0],\n i_max_trans=[0, 0, 0], \n i_rot=0, i_max_rot=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L165_C8", "label": "set_motion_gains()", "type": "expression", "loc": [165, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L158_C4", "vector": [8, 2, 0.8783, 0.0159, 2, 0.16, 0.4286, 965, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "set_motion_gains", "arg_names": [], "import_names": [], "rhs_call_name": "set_motion_gains", "annotation": ""}, "snippet": " arm.set_motion_gains(p_trans=[pp_trans, pp_trans, pp_trans], \n d_trans=[pd_trans_minor, pd_trans_minor, pd_trans_minor], \n p_rot=pp_rot, d_rot=pd_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L168_C8", "label": "set_force_directions()", "type": "expression", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L158_C4", "vector": [8, 2, 0.8889, 0.0053, 2, 0.16, 0.5714, 788, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_force_directions", "arg_names": [], "import_names": [], "rhs_call_name": "set_force_directions", "annotation": ""}, "snippet": " arm.set_force_directions([0, 0, 0, 0, 0, 0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L169_C8", "label": "set_force()", "type": "expression", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L158_C4", "vector": [8, 2, 0.8942, 0.0053, 2, 0.16, 0.7143, 329, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_force", "arg_names": [], "import_names": [], "rhs_call_name": "set_force", "annotation": ""}, "snippet": " arm.set_force([0, 0, 0, 0, 0, 0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L170_C8", "label": "update_gains()", "type": "expression", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L158_C4", "vector": [8, 2, 0.8995, 0.0053, 2, 0.16, 0.8571, 582, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "update_gains", "arg_names": [], "import_names": [], "rhs_call_name": "update_gains", "annotation": ""}, "snippet": " arm.update_gains()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Return_L171_C8", "label": "return", "type": "return", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L158_C4", "vector": [13, 2, 0.9048, 0.0053, 2, 0.16, 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_99302:If_L173_C4", "label": "if", "type": "if", "loc": [173, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "vector": [4, 1, 0.9497, 0.0741, 1, 0.49, 1.0, 0, 7, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opts.kill_controller:\n arm.set_force_max([-1, -1, -1, -1, -1, -1, -1])\n arm.set_tip_frame(opts.tip_frame)\n arm.set_force_gains(p_trans=[0, 0, 0], \n p_rot=0, i_trans=[0, 0, 0],\n i_max_trans=[0, 0, 0], \n i_rot=0, i_max_rot=0)\n arm.set_motion_gains(p_trans=0, "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L174_C8", "label": "set_force_max()", "type": "expression", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L173_C4", "vector": [8, 2, 0.9206, 0.0053, 2, 0.57, 0.0, 198, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_force_max", "arg_names": [], "import_names": [], "rhs_call_name": "set_force_max", "annotation": ""}, "snippet": " arm.set_force_max([-1, -1, -1, -1, -1, -1, -1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L175_C8", "label": "set_tip_frame()", "type": "expression", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L173_C4", "vector": [8, 2, 0.9259, 0.0053, 2, 0.57, 0.1429, 819, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_tip_frame", "arg_names": [], "import_names": [], "rhs_call_name": "set_tip_frame", "annotation": ""}, "snippet": " arm.set_tip_frame(opts.tip_frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L176_C8", "label": "set_force_gains()", "type": "expression", "loc": [176, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L173_C4", "vector": [8, 2, 0.9392, 0.0212, 2, 0.57, 0.2857, 892, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "set_force_gains", "arg_names": [], "import_names": [], "rhs_call_name": "set_force_gains", "annotation": ""}, "snippet": " arm.set_force_gains(p_trans=[0, 0, 0], \n p_rot=0, i_trans=[0, 0, 0],\n i_max_trans=[0, 0, 0], \n i_rot=0, i_max_rot=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L180_C8", "label": "set_motion_gains()", "type": "expression", "loc": [180, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L173_C4", "vector": [8, 2, 0.9577, 0.0159, 2, 0.57, 0.4286, 965, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "set_motion_gains", "arg_names": [], "import_names": [], "rhs_call_name": "set_motion_gains", "annotation": ""}, "snippet": " arm.set_motion_gains(p_trans=0, \n d_trans=0, \n p_rot=0, d_rot=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L183_C8", "label": "set_force_directions()", "type": "expression", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L173_C4", "vector": [8, 2, 0.9683, 0.0053, 2, 0.57, 0.5714, 788, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_force_directions", "arg_names": [], "import_names": [], "rhs_call_name": "set_force_directions", "annotation": ""}, "snippet": " arm.set_force_directions([0, 0, 0, 0, 0, 0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L184_C8", "label": "set_force()", "type": "expression", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L173_C4", "vector": [8, 2, 0.9735, 0.0053, 2, 0.57, 0.7143, 329, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_force", "arg_names": [], "import_names": [], "rhs_call_name": "set_force", "annotation": ""}, "snippet": " arm.set_force([0, 0, 0, 0, 0, 0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L185_C8", "label": "update_gains()", "type": "expression", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L173_C4", "vector": [8, 2, 0.9788, 0.0053, 2, 0.57, 0.8571, 582, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "update_gains", "arg_names": [], "import_names": [], "rhs_call_name": "update_gains", "annotation": ""}, "snippet": " arm.update_gains()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Return_L186_C8", "label": "return", "type": "return", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L173_C4", "vector": [13, 2, 0.9841, 0.0053, 2, 0.57, 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_99302:If_L188_C0", "label": "if", "type": "if", "loc": [188, 189], "level": 0, "parent": null, "vector": [4, 0, 0.9974, 0.0106, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L189_C4", "label": "main()", "type": "expression", "loc": [189, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L188_C0", "vector": [8, 1, 1.0, 0.0053, 1, 0.93, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:ImportFrom_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Return_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Return_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Return_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Return_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Return_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Return_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Return_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99302:If_L188_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99302:Expr_L189_C4"}]
import rospy import hrl_lib import yaml import os node_name = "overhead_grasping" ARM = 0 # right arm PRESSURE_LIST =["r_finger_periph_pressure", "r_finger_pad_pressure", "l_finger_periph_pressure", "l_finger_pad_pressure"] class FileOperations(): def __init__(self): grep = os.popen("rospack find pr2_overhead_grasping|grep pr2_overhead_grasping") self.package_loc = grep.readlines()[0].rstrip() def load_pickle(self, fn): return hrl_lib.util.load_pickle(self.package_loc + "//pickles//" + fn) def save_pickle(self, p, fn): hrl_lib.util.save_pickle(p, self.package_loc + "//pickles//" + fn) def get_pickle_name(self, fn): return self.package_loc + "//pickles//" + fn def file_exists(self, fn): return os.path.exists(self.package_loc + "//pickles//" + fn) def get_plot_name(self, directory, gfn): filename = (self.package_loc + "//plots//" + directory + "//" + gfn.split(".")[0].split("//")[-1] + ".pdf") return filename def load_coll_times(self, loc): ct_index_fn = (self.package_loc + "//pickles//" + loc + "//collision_times.yaml") stream = file(ct_index_fn, "r") coll_times = yaml.load(stream) return coll_times def save_coll_times(self, coll_times, loc): ct_index_fn = (self.package_loc + "//pickles//" + loc + "//collision_times.yaml") stream = file(ct_index_fn, "w") yaml.dump(coll_times, stream) def load_yaml_file(self, fn): ct_index_fn = (self.package_loc + "//yaml//" + fn) stream = file(ct_index_fn, "r") coll_times = yaml.load(stream) return coll_times def make_directories(self, directory): try: os.mkdir(self.package_loc + "//plots") except: pass try: os.mkdir(self.package_loc + "//plots//" + directory) except: pass try: os.mkdir(self.package_loc + "//pickles") except: pass try: os.mkdir(self.package_loc + "//pickles//collision_data") except: pass try: os.mkdir(self.package_loc + "//pickles//collision_data//" + directory) except: pass try: os.mkdir(self.package_loc + "//arff_files") except: pass try: os.mkdir(self.package_loc + "//pickles//classifiers") except: pass def log(*strs): prstrs = "" for s in strs: prstrs += str(s) + " " rospy.loginfo(node_name + ": " + prstrs) def err(*strs): prstrs = "" for s in strs: prstrs += str(s) + " " rospy.logerr(node_name + ": " + prstrs) def wait_for_key(ki, key='c'): ch = None while not rospy.is_shutdown() and ch != key: ch = ki.getch() rospy.sleep(0.1) log("CONTINUING")
ajibawa-2023/Python-Code-Large/train/row_99304
65
103
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Import_L1_C0", "label": "rospy import rospy", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0097, 0.0097, 0, 0.66, 0.0, 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_99304:Import_L2_C0", "label": "hrl_lib import hrl_lib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0194, 0.0097, 0, 0.66, 0.1, 649, 0, 1, 0, 0, 649, 0, 0], "semantic": {"name": "hrl_lib", "arg_names": [], "import_names": ["hrl_lib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Import_L3_C0", "label": "yaml import yaml", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0291, 0.0097, 0, 0.66, 0.2, 960, 0, 1, 0, 0, 960, 0, 0], "semantic": {"name": "yaml", "arg_names": [], "import_names": ["yaml"], "rhs_call_name": "", "annotation": ""}, "snippet": "import yaml"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Import_L4_C0", "label": "os import os", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0388, 0.0097, 0, 0.66, 0.3, 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_99304:Assign_L5_C0", "label": "node_name =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.0485, 0.0097, 0, 0.66, 0.4, 516, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "node_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "node_name = \"overhead_grasping\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L7_C0", "label": "ARM =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.068, 0.0097, 0, 0.66, 0.5, 674, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "ARM", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ARM = 0 # right arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L9_C0", "label": "PRESSURE_LIST =", "type": "assigned_variable", "loc": [9, 12], "level": 0, "parent": null, "vector": [14, 0, 0.1019, 0.0388, 0, 0.66, 0.6, 225, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "PRESSURE_LIST", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "PRESSURE_LIST =[\"r_finger_periph_pressure\", \n \"r_finger_pad_pressure\", \n \"l_finger_periph_pressure\",\n \"l_finger_pad_pressure\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:ClassDef_L14_C0", "label": "FileOperations", "type": "class", "loc": [14, 83], "level": 0, "parent": null, "vector": [3, 0, 0.4709, 0.6796, 0, 0.66, 0.7, 312, 0, 10, 0, 0, 0, 0, 21], "semantic": {"name": "FileOperations", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FileOperations():\n def __init__(self):\n grep = os.popen(\"rospack find pr2_overhead_grasping|grep pr2_overhead_grasping\")\n self.package_loc = grep.readlines()[0].rstrip()\n \n def load_pickle(self, fn):\n return hrl_lib.util.load_pickle(self.package_loc + \"//pickles//\" + fn)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L15_C4", "label": "__init__", "type": "function", "loc": [15, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:ClassDef_L14_C0", "vector": [2, 1, 0.1553, 0.0291, 1, 0.77, 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 grep = os.popen(\"rospack find pr2_overhead_grasping|grep pr2_overhead_grasping\")\n self.package_loc = grep.readlines()[0].rstrip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L16_C8", "label": "grep = popen()", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L15_C4", "vector": [14, 2, 0.1553, 0.0097, 2, 0.73, 0.0, 21, 3, 1, 0, 0, 221, 10, 1], "semantic": {"name": "grep", "arg_names": [], "import_names": [], "rhs_call_name": "popen", "annotation": ""}, "snippet": " grep = os.popen(\"rospack find pr2_overhead_grasping|grep pr2_overhead_grasping\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L17_C8", "label": "self.package_loc = rstrip()", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L15_C4", "vector": [14, 2, 0.165, 0.0097, 2, 0.73, 1.0, 187, 3, 0, 0, 0, 807, 10, 2], "semantic": {"name": "self.package_loc", "arg_names": [], "import_names": [], "rhs_call_name": "rstrip", "annotation": ""}, "snippet": " self.package_loc = grep.readlines()[0].rstrip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L19_C4", "label": "load_pickle", "type": "function", "loc": [19, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:ClassDef_L14_C0", "vector": [2, 1, 0.1893, 0.0194, 1, 0.77, 0.1111, 65, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "load_pickle", "arg_names": ["self", "fn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def load_pickle(self, fn):\n return hrl_lib.util.load_pickle(self.package_loc + \"//pickles//\" + fn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Return_L20_C8", "label": "return", "type": "return", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L19_C4", "vector": [13, 2, 0.1942, 0.0097, 2, 0.54, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return hrl_lib.util.load_pickle(self.package_loc + \"//pickles//\" + fn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L22_C4", "label": "save_pickle", "type": "function", "loc": [22, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:ClassDef_L14_C0", "vector": [2, 1, 0.2184, 0.0194, 1, 0.77, 0.2222, 390, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": ["self", "p", "fn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def save_pickle(self, p, fn):\n hrl_lib.util.save_pickle(p, self.package_loc + \"//pickles//\" + fn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L23_C8", "label": "save_pickle()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L22_C4", "vector": [8, 2, 0.2233, 0.0097, 2, 0.53, 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": " hrl_lib.util.save_pickle(p, self.package_loc + \"//pickles//\" + fn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L25_C4", "label": "get_pickle_name", "type": "function", "loc": [25, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:ClassDef_L14_C0", "vector": [2, 1, 0.2476, 0.0194, 1, 0.77, 0.3333, 734, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "get_pickle_name", "arg_names": ["self", "fn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_pickle_name(self, fn):\n return self.package_loc + \"//pickles//\" + fn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Return_L26_C8", "label": "return", "type": "return", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L25_C4", "vector": [13, 2, 0.2524, 0.0097, 2, 0.82, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.package_loc + \"//pickles//\" + fn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L28_C4", "label": "file_exists", "type": "function", "loc": [28, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:ClassDef_L14_C0", "vector": [2, 1, 0.2767, 0.0194, 1, 0.77, 0.4444, 840, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "file_exists", "arg_names": ["self", "fn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def file_exists(self, fn):\n return os.path.exists(self.package_loc + \"//pickles//\" + fn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Return_L29_C8", "label": "return", "type": "return", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L28_C4", "vector": [13, 2, 0.2816, 0.0097, 2, 0.7, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return os.path.exists(self.package_loc + \"//pickles//\" + fn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L31_C4", "label": "get_plot_name", "type": "function", "loc": [31, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:ClassDef_L14_C0", "vector": [2, 1, 0.3155, 0.0388, 1, 0.77, 0.5556, 41, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "get_plot_name", "arg_names": ["self", "directory", "gfn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_plot_name(self, directory, gfn):\n filename = (self.package_loc + \"//plots//\" + directory + \"//\" +\n gfn.split(\".\")[0].split(\"//\")[-1] + \".pdf\")\n return filename"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L32_C8", "label": "filename =", "type": "assigned_variable", "loc": [32, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L31_C4", "vector": [14, 2, 0.3155, 0.0194, 2, 0.08, 0.0, 275, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filename = (self.package_loc + \"//plots//\" + directory + \"//\" +\n gfn.split(\".\")[0].split(\"//\")[-1] + \".pdf\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Return_L34_C8", "label": "return", "type": "return", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L31_C4", "vector": [13, 2, 0.3301, 0.0097, 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 filename"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L36_C4", "label": "load_coll_times", "type": "function", "loc": [36, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:ClassDef_L14_C0", "vector": [2, 1, 0.3738, 0.0583, 1, 0.77, 0.6667, 575, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "load_coll_times", "arg_names": ["self", "loc"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def load_coll_times(self, loc):\n ct_index_fn = (self.package_loc + \"//pickles//\" + \n loc + \"//collision_times.yaml\")\n stream = file(ct_index_fn, \"r\")\n coll_times = yaml.load(stream)\n return coll_times"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L37_C8", "label": "ct_index_fn =", "type": "assigned_variable", "loc": [37, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L36_C4", "vector": [14, 2, 0.3641, 0.0194, 2, 0.75, 0.0, 785, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ct_index_fn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ct_index_fn = (self.package_loc + \"//pickles//\" + \n loc + \"//collision_times.yaml\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L39_C8", "label": "stream = file()", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L36_C4", "vector": [14, 2, 0.3786, 0.0097, 2, 0.75, 0.3333, 517, 3, 2, 0, 0, 107, 10, 1], "semantic": {"name": "stream", "arg_names": [], "import_names": [], "rhs_call_name": "file", "annotation": ""}, "snippet": " stream = file(ct_index_fn, \"r\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L40_C8", "label": "coll_times = load()", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L36_C4", "vector": [14, 2, 0.3883, 0.0097, 2, 0.75, 0.6667, 671, 3, 1, 0, 0, 37, 10, 1], "semantic": {"name": "coll_times", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": " coll_times = yaml.load(stream)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Return_L41_C8", "label": "return", "type": "return", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L36_C4", "vector": [13, 2, 0.3981, 0.0097, 2, 0.75, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return coll_times"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L43_C4", "label": "save_coll_times", "type": "function", "loc": [43, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:ClassDef_L14_C0", "vector": [2, 1, 0.4369, 0.0485, 1, 0.77, 0.7778, 152, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "save_coll_times", "arg_names": ["self", "coll_times", "loc"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def save_coll_times(self, coll_times, loc):\n ct_index_fn = (self.package_loc + \"//pickles//\" + \n loc + \"//collision_times.yaml\")\n stream = file(ct_index_fn, \"w\")\n yaml.dump(coll_times, stream)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L44_C8", "label": "ct_index_fn =", "type": "assigned_variable", "loc": [44, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L43_C4", "vector": [14, 2, 0.432, 0.0194, 2, 0.56, 0.0, 785, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ct_index_fn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ct_index_fn = (self.package_loc + \"//pickles//\" + \n loc + \"//collision_times.yaml\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L46_C8", "label": "stream = file()", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L43_C4", "vector": [14, 2, 0.4466, 0.0097, 2, 0.56, 0.5, 517, 3, 2, 0, 0, 107, 10, 1], "semantic": {"name": "stream", "arg_names": [], "import_names": [], "rhs_call_name": "file", "annotation": ""}, "snippet": " stream = file(ct_index_fn, \"w\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L47_C8", "label": "dump()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L43_C4", "vector": [8, 2, 0.4563, 0.0097, 2, 0.56, 1.0, 952, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "dump", "arg_names": [], "import_names": [], "rhs_call_name": "dump", "annotation": ""}, "snippet": " yaml.dump(coll_times, stream)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L49_C4", "label": "load_yaml_file", "type": "function", "loc": [49, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:ClassDef_L14_C0", "vector": [2, 1, 0.4951, 0.0485, 1, 0.77, 0.8889, 537, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "load_yaml_file", "arg_names": ["self", "fn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def load_yaml_file(self, fn):\n ct_index_fn = (self.package_loc + \"//yaml//\" + fn)\n stream = file(ct_index_fn, \"r\")\n coll_times = yaml.load(stream)\n return coll_times"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L50_C8", "label": "ct_index_fn =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L49_C4", "vector": [14, 2, 0.4854, 0.0097, 2, 0.82, 0.0, 785, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ct_index_fn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ct_index_fn = (self.package_loc + \"//yaml//\" + fn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L51_C8", "label": "stream = file()", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L49_C4", "vector": [14, 2, 0.4951, 0.0097, 2, 0.82, 0.3333, 517, 3, 2, 0, 0, 107, 10, 1], "semantic": {"name": "stream", "arg_names": [], "import_names": [], "rhs_call_name": "file", "annotation": ""}, "snippet": " stream = file(ct_index_fn, \"r\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L52_C8", "label": "coll_times = load()", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L49_C4", "vector": [14, 2, 0.5049, 0.0097, 2, 0.82, 0.6667, 671, 3, 1, 0, 0, 37, 10, 1], "semantic": {"name": "coll_times", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": " coll_times = yaml.load(stream)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Return_L53_C8", "label": "return", "type": "return", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L49_C4", "vector": [13, 2, 0.5146, 0.0097, 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 coll_times"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L55_C4", "label": "make_directories", "type": "function", "loc": [55, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:ClassDef_L14_C0", "vector": [2, 1, 0.6699, 0.2816, 1, 0.77, 1.0, 428, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "make_directories", "arg_names": ["self", "directory"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def make_directories(self, directory):\n try:\n os.mkdir(self.package_loc + \"//plots\")\n except:\n pass\n try:\n os.mkdir(self.package_loc + \"//plots//\" + directory)\n except:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L56_C8", "label": "try", "type": "try", "loc": [56, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L55_C4", "vector": [7, 2, 0.5583, 0.0388, 2, 0.74, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n os.mkdir(self.package_loc + \"//plots\")\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L57_C12", "label": "mkdir()", "type": "expression", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L56_C8", "vector": [8, 3, 0.5534, 0.0097, 3, 0.95, 0.0, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": " os.mkdir(self.package_loc + \"//plots\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L60_C8", "label": "try", "type": "try", "loc": [60, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L55_C4", "vector": [7, 2, 0.5971, 0.0388, 2, 0.74, 0.1667, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n os.mkdir(self.package_loc + \"//plots//\" + directory)\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L61_C12", "label": "mkdir()", "type": "expression", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L60_C8", "vector": [8, 3, 0.5922, 0.0097, 3, 0.46, 0.0, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": " os.mkdir(self.package_loc + \"//plots//\" + directory)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L64_C8", "label": "try", "type": "try", "loc": [64, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L55_C4", "vector": [7, 2, 0.6359, 0.0388, 2, 0.74, 0.3333, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n os.mkdir(self.package_loc + \"//pickles\")\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L65_C12", "label": "mkdir()", "type": "expression", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L64_C8", "vector": [8, 3, 0.6311, 0.0097, 3, 0.86, 0.0, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": " os.mkdir(self.package_loc + \"//pickles\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L68_C8", "label": "try", "type": "try", "loc": [68, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L55_C4", "vector": [7, 2, 0.6748, 0.0388, 2, 0.74, 0.5, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n os.mkdir(self.package_loc + \"//pickles//collision_data\")\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L69_C12", "label": "mkdir()", "type": "expression", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L68_C8", "vector": [8, 3, 0.6699, 0.0097, 3, 0.14, 0.0, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": " os.mkdir(self.package_loc + \"//pickles//collision_data\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L72_C8", "label": "try", "type": "try", "loc": [72, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L55_C4", "vector": [7, 2, 0.7136, 0.0388, 2, 0.74, 0.6667, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n os.mkdir(self.package_loc + \"//pickles//collision_data//\" + directory)\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L73_C12", "label": "mkdir()", "type": "expression", "loc": [73, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L72_C8", "vector": [8, 3, 0.7087, 0.0097, 3, 0.52, 0.0, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": " os.mkdir(self.package_loc + \"//pickles//collision_data//\" + directory)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L76_C8", "label": "try", "type": "try", "loc": [76, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L55_C4", "vector": [7, 2, 0.7524, 0.0388, 2, 0.74, 0.8333, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n os.mkdir(self.package_loc + \"//arff_files\")\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L77_C12", "label": "mkdir()", "type": "expression", "loc": [77, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L76_C8", "vector": [8, 3, 0.7476, 0.0097, 3, 0.26, 0.0, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": " os.mkdir(self.package_loc + \"//arff_files\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L80_C8", "label": "try", "type": "try", "loc": [80, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L55_C4", "vector": [7, 2, 0.7913, 0.0388, 2, 0.74, 1.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n os.mkdir(self.package_loc + \"//pickles//classifiers\")\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L81_C12", "label": "mkdir()", "type": "expression", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L80_C8", "vector": [8, 3, 0.7864, 0.0097, 3, 0.33, 0.0, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": " os.mkdir(self.package_loc + \"//pickles//classifiers\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L86_C0", "label": "log", "type": "function", "loc": [86, 90], "level": 0, "parent": null, "vector": [2, 0, 0.8544, 0.0485, 0, 0.66, 0.8, 432, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "log", "arg_names": ["strs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def log(*strs):\n prstrs = \"\"\n for s in strs:\n prstrs += str(s) + \" \"\n rospy.loginfo(node_name + \": \" + prstrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L87_C4", "label": "prstrs =", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L86_C0", "vector": [14, 1, 0.8447, 0.0097, 1, 0.67, 0.0, 747, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "prstrs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prstrs = \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:For_L88_C4", "label": "for s", "type": "for", "loc": [88, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L86_C0", "vector": [6, 1, 0.8592, 0.0194, 1, 0.67, 0.5, 553, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for s in strs:\n prstrs += str(s) + \" \""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L90_C4", "label": "loginfo()", "type": "expression", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L86_C0", "vector": [8, 1, 0.8738, 0.0097, 1, 0.67, 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(node_name + \": \" + prstrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L92_C0", "label": "err", "type": "function", "loc": [92, 96], "level": 0, "parent": null, "vector": [2, 0, 0.9126, 0.0485, 0, 0.66, 0.9, 541, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "err", "arg_names": ["strs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def err(*strs):\n prstrs = \"\"\n for s in strs:\n prstrs += str(s) + \" \"\n rospy.logerr(node_name + \": \" + prstrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L93_C4", "label": "prstrs =", "type": "assigned_variable", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L92_C0", "vector": [14, 1, 0.9029, 0.0097, 1, 0.83, 0.0, 747, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "prstrs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prstrs = \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:For_L94_C4", "label": "for s", "type": "for", "loc": [94, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L92_C0", "vector": [6, 1, 0.9175, 0.0194, 1, 0.83, 0.5, 553, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for s in strs:\n prstrs += str(s) + \" \""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L96_C4", "label": "logerr()", "type": "expression", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L92_C0", "vector": [8, 1, 0.932, 0.0097, 1, 0.83, 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(node_name + \": \" + prstrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L98_C0", "label": "wait_for_key", "type": "function", "loc": [98, 103], "level": 0, "parent": null, "vector": [2, 0, 0.9757, 0.0583, 0, 0.66, 1.0, 736, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "wait_for_key", "arg_names": ["ki", "key"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def wait_for_key(ki, key='c'):\n ch = None\n while not rospy.is_shutdown() and ch != key:\n ch = ki.getch()\n rospy.sleep(0.1)\n log(\"CONTINUING\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L99_C4", "label": "ch =", "type": "assigned_variable", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L98_C0", "vector": [14, 1, 0.9612, 0.0097, 1, 0.62, 0.0, 263, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "ch", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ch = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:While_L100_C4", "label": "while", "type": "while", "loc": [100, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L98_C0", "vector": [5, 1, 0.9806, 0.0291, 1, 0.62, 0.5, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown() and ch != key:\n ch = ki.getch()\n rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L101_C8", "label": "ch = getch()", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:While_L100_C4", "vector": [14, 2, 0.9806, 0.0097, 2, 0.1, 0.0, 263, 3, 0, 0, 0, 32, 10, 1], "semantic": {"name": "ch", "arg_names": [], "import_names": [], "rhs_call_name": "getch", "annotation": ""}, "snippet": " ch = ki.getch()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L102_C8", "label": "sleep()", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:While_L100_C4", "vector": [8, 2, 0.9903, 0.0097, 2, 0.1, 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_99304:Expr_L103_C4", "label": "log()", "type": "expression", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L98_C0", "vector": [8, 1, 1.0, 0.0097, 1, 0.62, 1.0, 432, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": " log(\"CONTINUING\")"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99304:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Return_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Return_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Return_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Return_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Return_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Return_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L56_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L68_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L77_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:Try_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:For_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:For_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:While_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:While_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:While_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99304:FunctionDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99304:Expr_L103_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 Travis Deyle (Healthcare Robotics Lab, Georgia Tech.) import roslib roslib.load_manifest('pr2_overhead_grasping') roslib.load_manifest('tf') roslib.load_manifest('hrl_table_detect') roslib.load_manifest('rfid_behaviors') import rospy import smach from smach_ros import SimpleActionState, ServiceState, IntrospectionServer import actionlib import tf.transformations as tft from rfid_behaviors.srv import HandoffSrv from hrl_table_detect.srv import DetectTableInst, DetectTableInstRequest from pr2_overhead_grasping.msg import OverheadGraspAction, OverheadGraspGoal from pr2_overhead_grasping.msg import OverheadGraspSetupAction, OverheadGraspSetupGoal from pr2_controllers_msgs.msg import SingleJointPositionAction, SingleJointPositionGoal # Overhead grasping requres: # run: hrl_pr2_gains/change_gains_grasp.py # roslaunch pr2_overhead_grasping overhead_grasping_server.launch class NTries(smach.State): def __init__(self, n): smach.State.__init__(self, outcomes=['succeeded', 'aborted']) self.counter = 0 self.n = n def execute(self, userdata): self.counter += 1 if self.counter <= self.n: rospy.logout( 'Executing NTries: On #%d of %d' % (self.counter, self.n)) return 'succeeded' else: return 'aborted' def sm_grasp(): # Create a SMACH state machine sm = smach.StateMachine(outcomes=['succeeded','aborted','preempted']) with sm: # Setup arm pose (out of way for perception) tgoal = SingleJointPositionGoal() tgoal.position = 0.190 # all the way up is 0.200 tgoal.min_duration = rospy.Duration( 2.0 ) tgoal.max_velocity = 1.0 smach.StateMachine.add( 'TORSO_SETUP', SimpleActionState( 'torso_controller/position_joint_action', SingleJointPositionAction, goal = tgoal), transitions = { 'succeeded': 'THREE_TRIES' }) # We will run the grasper at most 3 times. smach.StateMachine.add( 'THREE_TRIES', NTries( 3 ), transitions = {'succeeded':'PERCEIVE_SETUP', 'aborted':'aborted'}) # get hand out of face smach.StateMachine.add( 'PERCEIVE_SETUP', ServiceState( '/rfid_handoff/grasp', HandoffSrv ), transitions = { 'succeeded' : 'PERCEIVE_OBJECT' }) # Setment objects smach.StateMachine.add( 'PERCEIVE_OBJECT', ServiceState( '/obj_segment_inst', DetectTableInst, request = DetectTableInstRequest( 1.0 ), response_slots = ['grasp_points']), # PoseArray transitions = {'succeeded':'GRASP_SETUP'}, remapping = {'grasp_points':'object_poses'}) #output # Setup arm pose (out of way for perception) smach.StateMachine.add( 'GRASP_SETUP', SimpleActionState( 'overhead_grasp_setup', OverheadGraspSetupAction, goal = OverheadGraspSetupGoal( True )), # disable new look transitions = { 'succeeded': 'GRASP' }) # Actually perform grasp of some object in front of robot on table def grasp_goal_cb( userdata, goal ): # grasp_poses is PoseArray in base_link mgp = userdata.grasp_poses.poses[0] ggoal = OverheadGraspGoal() ggoal.is_grasp = True ggoal.grasp_type = OverheadGraspGoal.MANUAL_GRASP ggoal.x = mgp.position.x + 0.05 # Converts base_link -> torso_lift_link (only for x,y) ggoal.y = mgp.position.y o = mgp.orientation r,p,y = tft.euler_from_quaternion(( o.x, o.y, o.z, o.w )) ggoal.rot = y return ggoal smach.StateMachine.add( 'GRASP', SimpleActionState( 'overhead_grasp', OverheadGraspAction, goal_cb = grasp_goal_cb, input_keys = ['grasp_poses']), remapping = {'grasp_poses':'object_poses'}, transitions = { 'succeeded': 'succeeded', 'aborted':'THREE_TRIES' }) return sm if __name__ == '__main__': rospy.init_node('smach_sm_grasp') sm = sm_grasp() sis = IntrospectionServer('Grasping', sm, '/SM_GRASPING') sis.start() outcome = sm.execute() sis.stop()
ajibawa-2023/Python-Code-Large/train/row_99306
56
163
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Import_L31_C0", "label": "roslib import roslib", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.1902, 0.0061, 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_99306:Expr_L32_C0", "label": "load_manifest()", "type": "expression", "loc": [32, 32], "level": 0, "parent": null, "vector": [8, 0, 0.1963, 0.0061, 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_overhead_grasping')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Expr_L33_C0", "label": "load_manifest()", "type": "expression", "loc": [33, 33], "level": 0, "parent": null, "vector": [8, 0, 0.2025, 0.0061, 0, 0.66, 0.1176, 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_99306:Expr_L34_C0", "label": "load_manifest()", "type": "expression", "loc": [34, 34], "level": 0, "parent": null, "vector": [8, 0, 0.2086, 0.0061, 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": "roslib.load_manifest('hrl_table_detect')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Expr_L35_C0", "label": "load_manifest()", "type": "expression", "loc": [35, 35], "level": 0, "parent": null, "vector": [8, 0, 0.2147, 0.0061, 0, 0.66, 0.2353, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('rfid_behaviors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Import_L36_C0", "label": "rospy import rospy", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.2209, 0.0061, 0, 0.66, 0.2941, 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_99306:Import_L38_C0", "label": "smach import smach", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.2331, 0.0061, 0, 0.66, 0.3529, 345, 0, 1, 0, 0, 345, 0, 0], "semantic": {"name": "smach", "arg_names": [], "import_names": ["smach"], "rhs_call_name": "", "annotation": ""}, "snippet": "import smach"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:ImportFrom_L39_C0", "label": "from smach_ros import SimpleActionState, ServiceState, IntrospectionServer", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.2393, 0.0061, 0, 0.66, 0.4118, 716, 0, 3, 0, 0, 716, 0, 0], "semantic": {"name": "smach_ros", "arg_names": [], "import_names": ["SimpleActionState", "ServiceState", "IntrospectionServer"], "rhs_call_name": "", "annotation": ""}, "snippet": "from smach_ros import SimpleActionState, ServiceState, IntrospectionServer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Import_L40_C0", "label": "actionlib import actionlib", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.2454, 0.0061, 0, 0.66, 0.4706, 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_99306:Import_L41_C0", "label": "tf.transformations import tft", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.2515, 0.0061, 0, 0.66, 0.5294, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tft"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tft"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:ImportFrom_L43_C0", "label": "from rfid_behaviors.srv import HandoffSrv", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.2638, 0.0061, 0, 0.66, 0.5882, 647, 0, 1, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["HandoffSrv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import HandoffSrv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:ImportFrom_L44_C0", "label": "from hrl_table_detect.srv import DetectTableInst, DetectTableInstRequest", "type": "import", "loc": [44, 44], "level": 0, "parent": null, "vector": [1, 0, 0.2699, 0.0061, 0, 0.66, 0.6471, 778, 0, 2, 0, 0, 778, 0, 0], "semantic": {"name": "hrl_table_detect.srv", "arg_names": [], "import_names": ["DetectTableInst", "DetectTableInstRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_table_detect.srv import DetectTableInst, DetectTableInstRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:ImportFrom_L45_C0", "label": "from pr2_overhead_grasping.msg import OverheadGraspAction, OverheadGraspGoal", "type": "import", "loc": [45, 45], "level": 0, "parent": null, "vector": [1, 0, 0.2761, 0.0061, 0, 0.66, 0.7059, 920, 0, 2, 0, 0, 920, 0, 0], "semantic": {"name": "pr2_overhead_grasping.msg", "arg_names": [], "import_names": ["OverheadGraspAction", "OverheadGraspGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_overhead_grasping.msg import OverheadGraspAction, OverheadGraspGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:ImportFrom_L46_C0", "label": "from pr2_overhead_grasping.msg import OverheadGraspSetupAction, OverheadGraspSetupGoal", "type": "import", "loc": [46, 46], "level": 0, "parent": null, "vector": [1, 0, 0.2822, 0.0061, 0, 0.66, 0.7647, 920, 0, 2, 0, 0, 920, 0, 0], "semantic": {"name": "pr2_overhead_grasping.msg", "arg_names": [], "import_names": ["OverheadGraspSetupAction", "OverheadGraspSetupGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_overhead_grasping.msg import OverheadGraspSetupAction, OverheadGraspSetupGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:ImportFrom_L47_C0", "label": "from pr2_controllers_msgs.msg import SingleJointPositionAction, SingleJointPositionGoal", "type": "import", "loc": [47, 47], "level": 0, "parent": null, "vector": [1, 0, 0.2883, 0.0061, 0, 0.66, 0.8235, 457, 0, 2, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["SingleJointPositionAction", "SingleJointPositionGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import SingleJointPositionAction, SingleJointPositionGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:ClassDef_L53_C0", "label": "NTries", "type": "class", "loc": [53, 66], "level": 0, "parent": null, "vector": [3, 0, 0.365, 0.0859, 0, 0.66, 0.8824, 738, 0, 2, 0, 0, 892, 0, 2], "semantic": {"name": "NTries", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class NTries(smach.State):\n def __init__(self, n):\n smach.State.__init__(self, outcomes=['succeeded', 'aborted'])\n self.counter = 0\n self.n = n\n\n def execute(self, userdata):\n self.counter += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L54_C4", "label": "__init__", "type": "function", "loc": [54, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:ClassDef_L53_C0", "vector": [2, 1, 0.3405, 0.0245, 1, 0.75, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "n"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, n):\n smach.State.__init__(self, outcomes=['succeeded', 'aborted'])\n self.counter = 0\n self.n = n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Expr_L55_C8", "label": "__init__()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L54_C4", "vector": [8, 2, 0.3374, 0.0061, 2, 0.91, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " smach.State.__init__(self, outcomes=['succeeded', 'aborted'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L56_C8", "label": "self.counter =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L54_C4", "vector": [14, 2, 0.3436, 0.0061, 2, 0.91, 0.5, 785, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.counter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.counter = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L57_C8", "label": "self.n =", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L54_C4", "vector": [14, 2, 0.3497, 0.0061, 2, 0.91, 1.0, 172, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.n = n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L59_C4", "label": "execute", "type": "function", "loc": [59, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:ClassDef_L53_C0", "vector": [2, 1, 0.3834, 0.0491, 1, 0.75, 1.0, 569, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "execute", "arg_names": ["self", "userdata"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute(self, userdata):\n self.counter += 1\n\n if self.counter <= self.n:\n rospy.logout( 'Executing NTries: On #%d of %d' % (self.counter, self.n))\n return 'succeeded'\n else:\n return 'aborted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:If_L62_C8", "label": "if", "type": "if", "loc": [62, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L59_C4", "vector": [4, 2, 0.3926, 0.0307, 2, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.counter <= self.n:\n rospy.logout( 'Executing NTries: On #%d of %d' % (self.counter, self.n))\n return 'succeeded'\n else:\n return 'aborted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Expr_L63_C12", "label": "logout()", "type": "expression", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:If_L62_C8", "vector": [8, 3, 0.3865, 0.0061, 3, 0.19, 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( 'Executing NTries: On #%d of %d' % (self.counter, self.n))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Return_L64_C12", "label": "return", "type": "return", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:If_L62_C8", "vector": [13, 3, 0.3926, 0.0061, 3, 0.19, 0.5, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'succeeded'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Return_L66_C12", "label": "return", "type": "return", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:If_L62_C8", "vector": [13, 3, 0.4049, 0.0061, 3, 0.19, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'aborted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "label": "sm_grasp", "type": "function", "loc": [69, 146], "level": 0, "parent": null, "vector": [2, 0, 0.6595, 0.4785, 0, 0.66, 0.9412, 619, 0, 0, 1, 0, 0, 0, 19], "semantic": {"name": "sm_grasp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def sm_grasp():\n # Create a SMACH state machine\n sm = smach.StateMachine(outcomes=['succeeded','aborted','preempted'])\n\n with sm:\n # Setup arm pose (out of way for perception)\n tgoal = SingleJointPositionGoal()\n tgoal.position = 0.190 # all the way up is 0.200"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L71_C4", "label": "sm = StateMachine()", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "vector": [14, 1, 0.4356, 0.0061, 1, 0.76, 0.0, 21, 3, 1, 0, 0, 174, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "StateMachine", "annotation": ""}, "snippet": " sm = smach.StateMachine(outcomes=['succeeded','aborted','preempted'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L75_C8", "label": "tgoal = SingleJointPositionGoal()", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "vector": [14, 1, 0.4601, 0.0061, 1, 0.76, 0.0, 454, 3, 0, 0, 0, 974, 10, 1], "semantic": {"name": "tgoal", "arg_names": [], "import_names": [], "rhs_call_name": "SingleJointPositionGoal", "annotation": ""}, "snippet": " tgoal = SingleJointPositionGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L76_C8", "label": "tgoal.position =", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "vector": [14, 1, 0.4663, 0.0061, 1, 0.76, 0.1, 731, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "tgoal.position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tgoal.position = 0.190 # all the way up is 0.200"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L77_C8", "label": "tgoal.min_duration = Duration()", "type": "assigned_variable", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "vector": [14, 1, 0.4724, 0.0061, 1, 0.76, 0.2, 779, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "tgoal.min_duration", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " tgoal.min_duration = rospy.Duration( 2.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L78_C8", "label": "tgoal.max_velocity =", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "vector": [14, 1, 0.4785, 0.0061, 1, 0.76, 0.3, 590, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "tgoal.max_velocity", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tgoal.max_velocity = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Expr_L79_C8", "label": "add()", "type": "expression", "loc": [79, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "vector": [8, 1, 0.5, 0.0368, 1, 0.76, 0.4, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'TORSO_SETUP',\n SimpleActionState( 'torso_controller/position_joint_action',\n SingleJointPositionAction,\n goal = tgoal),\n transitions = { 'succeeded': 'THREE_TRIES' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Expr_L87_C8", "label": "add()", "type": "expression", "loc": [87, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "vector": [8, 1, 0.546, 0.0307, 1, 0.76, 0.5, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'THREE_TRIES',\n NTries( 3 ),\n transitions = {'succeeded':'PERCEIVE_SETUP',\n 'aborted':'aborted'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Expr_L94_C8", "label": "add()", "type": "expression", "loc": [94, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "vector": [8, 1, 0.5859, 0.0245, 1, 0.76, 0.6, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'PERCEIVE_SETUP',\n ServiceState( '/rfid_handoff/grasp', HandoffSrv ),\n transitions = { 'succeeded' : 'PERCEIVE_OBJECT' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Expr_L101_C8", "label": "add()", "type": "expression", "loc": [101, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "vector": [8, 1, 0.6411, 0.0491, 1, 0.76, 0.7, 241, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'PERCEIVE_OBJECT',\n ServiceState( '/obj_segment_inst',\n DetectTableInst,\n request = DetectTableInstRequest( 1.0 ),\n response_slots = ['grasp_points']), # PoseArray\n transitions = {'succeeded':'GRASP_SETUP'},\n remapping = {'grasp_points':'object_poses'}) #output"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Expr_L111_C8", "label": "add()", "type": "expression", "loc": [111, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "vector": [8, 1, 0.6963, 0.0368, 1, 0.76, 0.8, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'GRASP_SETUP',\n SimpleActionState( 'overhead_grasp_setup',\n OverheadGraspSetupAction,\n goal = OverheadGraspSetupGoal( True )), # disable new look\n transitions = { 'succeeded': 'GRASP' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L119_C8", "label": "grasp_goal_cb", "type": "function", "loc": [119, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "vector": [2, 1, 0.7761, 0.0982, 1, 0.76, 0.9, 610, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "grasp_goal_cb", "arg_names": ["userdata", "goal"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def grasp_goal_cb( userdata, goal ):\n # grasp_poses is PoseArray in base_link\n mgp = userdata.grasp_poses.poses[0]\n \n ggoal = OverheadGraspGoal()\n ggoal.is_grasp = True\n ggoal.grasp_type = OverheadGraspGoal.MANUAL_GRASP\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L121_C12", "label": "mgp =", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L119_C8", "vector": [14, 2, 0.7423, 0.0061, 2, 0.75, 0.0, 577, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mgp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mgp = userdata.grasp_poses.poses[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L123_C12", "label": "ggoal = OverheadGraspGoal()", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L119_C8", "vector": [14, 2, 0.7546, 0.0061, 2, 0.75, 0.1111, 434, 3, 0, 0, 0, 708, 10, 1], "semantic": {"name": "ggoal", "arg_names": [], "import_names": [], "rhs_call_name": "OverheadGraspGoal", "annotation": ""}, "snippet": " ggoal = OverheadGraspGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L124_C12", "label": "ggoal.is_grasp =", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L119_C8", "vector": [14, 2, 0.7607, 0.0061, 2, 0.75, 0.2222, 165, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "ggoal.is_grasp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ggoal.is_grasp = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L125_C12", "label": "ggoal.grasp_type =", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L119_C8", "vector": [14, 2, 0.7669, 0.0061, 2, 0.75, 0.3333, 397, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ggoal.grasp_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ggoal.grasp_type = OverheadGraspGoal.MANUAL_GRASP"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L127_C12", "label": "ggoal.x =", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L119_C8", "vector": [14, 2, 0.7791, 0.0061, 2, 0.75, 0.4444, 666, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ggoal.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ggoal.x = mgp.position.x + 0.05 # Converts base_link -> torso_lift_link (only for x,y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L128_C12", "label": "ggoal.y =", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L119_C8", "vector": [14, 2, 0.7853, 0.0061, 2, 0.75, 0.5556, 406, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ggoal.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ggoal.y = mgp.position.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L130_C12", "label": "o =", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L119_C8", "vector": [14, 2, 0.7975, 0.0061, 2, 0.75, 0.6667, 926, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "o", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " o = mgp.orientation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L131_C12", "label": "r, p, y = euler_from_quaternion()", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L119_C8", "vector": [14, 2, 0.8037, 0.0061, 2, 0.75, 0.7778, 387, 3, 1, 0, 0, 409, 10, 1], "semantic": {"name": "r, p, y", "arg_names": [], "import_names": [], "rhs_call_name": "euler_from_quaternion", "annotation": ""}, "snippet": " r,p,y = tft.euler_from_quaternion(( o.x, o.y, o.z, o.w ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L132_C12", "label": "ggoal.rot =", "type": "assigned_variable", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L119_C8", "vector": [14, 2, 0.8098, 0.0061, 2, 0.75, 0.8889, 740, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ggoal.rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ggoal.rot = y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Return_L134_C12", "label": "return", "type": "return", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L119_C8", "vector": [13, 2, 0.8221, 0.0061, 2, 0.75, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ggoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Expr_L136_C8", "label": "add()", "type": "expression", "loc": [136, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "vector": [8, 1, 0.8589, 0.0552, 1, 0.76, 1.0, 241, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'GRASP',\n SimpleActionState( 'overhead_grasp',\n OverheadGraspAction,\n goal_cb = grasp_goal_cb,\n input_keys = ['grasp_poses']),\n remapping = {'grasp_poses':'object_poses'},\n transitions = { 'succeeded': 'succeeded',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Return_L146_C4", "label": "return", "type": "return", "loc": [146, 146], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "vector": [13, 1, 0.8957, 0.0061, 1, 0.76, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:If_L150_C0", "label": "if", "type": "if", "loc": [150, 160], "level": 0, "parent": null, "vector": [4, 0, 0.9509, 0.0675, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n rospy.init_node('smach_sm_grasp')\n\n sm = sm_grasp()\n\n sis = IntrospectionServer('Grasping', sm, '/SM_GRASPING')\n sis.start()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Expr_L151_C4", "label": "init_node()", "type": "expression", "loc": [151, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:If_L150_C0", "vector": [8, 1, 0.9264, 0.0061, 1, 0.26, 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('smach_sm_grasp')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L153_C4", "label": "sm = sm_grasp()", "type": "assigned_variable", "loc": [153, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:If_L150_C0", "vector": [14, 1, 0.9387, 0.0061, 1, 0.26, 0.2, 21, 3, 0, 0, 0, 619, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "sm_grasp", "annotation": ""}, "snippet": " sm = sm_grasp()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L155_C4", "label": "sis = IntrospectionServer()", "type": "assigned_variable", "loc": [155, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:If_L150_C0", "vector": [14, 1, 0.9509, 0.0061, 1, 0.26, 0.4, 608, 3, 3, 0, 0, 702, 10, 1], "semantic": {"name": "sis", "arg_names": [], "import_names": [], "rhs_call_name": "IntrospectionServer", "annotation": ""}, "snippet": " sis = IntrospectionServer('Grasping', sm, '/SM_GRASPING')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Expr_L156_C4", "label": "start()", "type": "expression", "loc": [156, 156], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:If_L150_C0", "vector": [8, 1, 0.9571, 0.0061, 1, 0.26, 0.6, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " sis.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L158_C4", "label": "outcome = execute()", "type": "assigned_variable", "loc": [158, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:If_L150_C0", "vector": [14, 1, 0.9693, 0.0061, 1, 0.26, 0.8, 805, 3, 0, 0, 0, 569, 10, 1], "semantic": {"name": "outcome", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " outcome = sm.execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99306:Expr_L160_C4", "label": "stop()", "type": "expression", "loc": [160, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99306:If_L150_C0", "vector": [8, 1, 0.9816, 0.0061, 1, 0.26, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " sis.stop()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99306:ClassDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:ClassDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:If_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Expr_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Return_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Return_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Expr_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Expr_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Expr_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Expr_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Expr_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L121_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L123_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L124_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L128_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L131_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L132_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Return_L134_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Expr_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Return_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:If_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Expr_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:If_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:If_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:If_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Expr_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:If_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Assign_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99306:If_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99306:Expr_L160_C4"}]
import svm labels = [0, 1] samples = [[0, 0], [0, 1]] labels = [0, 1, 1, 2] samples = [[0, 0], [0, 1], [1, 0], [1, 1]] import svm labels = [0, 0, 1, 1] samples = [[1, 1], [1, -1], [-1, 1], [-1, -1]] param = svm.svm_parameter('-c 1') problem = svm.svm_problem(labels, samples) model = svm.libsvm.svm_train(problem, param) pmodel = svm.toPyModel(model) pmodel.predict_values(samples[0]) for i in range(len(samples)): print svm.libsvm.svm_predict(model, svm.gen_svm_nodearray(samples[i])[0]) r = (c_double*6)() svm.libsvm.svm_predict_values(model, svm.gen_svm_nodearray(samples[0])[0], r)
ajibawa-2023/Python-Code-Large/train/row_99307
17
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_99307:Import_L1_C0", "label": "svm import svm", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0357, 0.0357, 0, 0.66, 0.0, 75, 0, 1, 0, 0, 75, 0, 0], "semantic": {"name": "svm", "arg_names": [], "import_names": ["svm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import svm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99307:Assign_L4_C0", "label": "labels =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.1429, 0.0357, 0, 0.66, 0.0667, 283, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "labels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "labels = [0, 1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99307:Assign_L5_C0", "label": "samples =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1786, 0.0357, 0, 0.66, 0.1333, 986, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "samples", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "samples = [[0, 0], [0, 1]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99307:Assign_L7_C0", "label": "labels =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.0357, 0, 0.66, 0.2, 283, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "labels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "labels = [0, 1, 1, 2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99307:Assign_L8_C0", "label": "samples =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.2857, 0.0357, 0, 0.66, 0.2667, 986, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "samples", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "samples = [[0, 0], [0, 1], [1, 0], [1, 1]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99307:Import_L10_C0", "label": "svm import svm", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.3571, 0.0357, 0, 0.66, 0.3333, 75, 0, 1, 0, 0, 75, 0, 0], "semantic": {"name": "svm", "arg_names": [], "import_names": ["svm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import svm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99307:Assign_L12_C0", "label": "labels =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.4286, 0.0357, 0, 0.66, 0.4, 283, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "labels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "labels = [0, 0, 1, 1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99307:Assign_L13_C0", "label": "samples =", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.4643, 0.0357, 0, 0.66, 0.4667, 986, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "samples", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "samples = [[1, 1], [1, -1], [-1, 1], [-1, -1]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99307:Assign_L15_C0", "label": "param = svm_parameter()", "type": "assigned_variable", "loc": [15, 15], "level": 0, "parent": null, "vector": [14, 0, 0.5357, 0.0357, 0, 0.66, 0.5333, 841, 3, 1, 0, 0, 987, 10, 1], "semantic": {"name": "param", "arg_names": [], "import_names": [], "rhs_call_name": "svm_parameter", "annotation": ""}, "snippet": "param = svm.svm_parameter('-c 1')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99307:Assign_L16_C0", "label": "problem = svm_problem()", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.5714, 0.0357, 0, 0.66, 0.6, 41, 3, 2, 0, 0, 14, 10, 1], "semantic": {"name": "problem", "arg_names": [], "import_names": [], "rhs_call_name": "svm_problem", "annotation": ""}, "snippet": "problem = svm.svm_problem(labels, samples)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99307:Assign_L18_C0", "label": "model = svm_train()", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.6429, 0.0357, 0, 0.66, 0.6667, 722, 3, 2, 0, 0, 400, 10, 1], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "svm_train", "annotation": ""}, "snippet": "model = svm.libsvm.svm_train(problem, param)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99307:Assign_L19_C0", "label": "pmodel = toPyModel()", "type": "assigned_variable", "loc": [19, 19], "level": 0, "parent": null, "vector": [14, 0, 0.6786, 0.0357, 0, 0.66, 0.7333, 692, 3, 1, 0, 0, 834, 10, 1], "semantic": {"name": "pmodel", "arg_names": [], "import_names": [], "rhs_call_name": "toPyModel", "annotation": ""}, "snippet": "pmodel = svm.toPyModel(model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99307:Expr_L20_C0", "label": "predict_values()", "type": "expression", "loc": [20, 20], "level": 0, "parent": null, "vector": [8, 0, 0.7143, 0.0357, 0, 0.66, 0.8, 167, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "predict_values", "arg_names": [], "import_names": [], "rhs_call_name": "predict_values", "annotation": ""}, "snippet": "pmodel.predict_values(samples[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99307:For_L21_C0", "label": "for i", "type": "for", "loc": [21, 22], "level": 0, "parent": null, "vector": [6, 0, 0.7679, 0.0714, 0, 0.66, 0.8667, 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(samples)):\n print(svm.libsvm.svm_predict(model, svm.gen_svm_nodearray(samples[i])[0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99307:Expr_L22_C4", "label": "print()", "type": "expression", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99307:For_L21_C0", "vector": [8, 1, 0.7857, 0.0357, 1, 0.02, 0.0, 535, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(svm.libsvm.svm_predict(model, svm.gen_svm_nodearray(samples[i])[0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99307:Assign_L25_C0", "label": "r =", "type": "assigned_variable", "loc": [25, 25], "level": 0, "parent": null, "vector": [14, 0, 0.8929, 0.0357, 0, 0.66, 0.9333, 436, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "r = (c_double*6)()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99307:Expr_L26_C0", "label": "svm_predict_values()", "type": "expression", "loc": [26, 26], "level": 0, "parent": null, "vector": [8, 0, 0.9286, 0.0357, 0, 0.66, 1.0, 132, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "svm_predict_values", "arg_names": [], "import_names": [], "rhs_call_name": "svm_predict_values", "annotation": ""}, "snippet": "svm.libsvm.svm_predict_values(model, svm.gen_svm_nodearray(samples[0])[0], r)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99307:For_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99307:Expr_L22_C4"}]
#!/usr/bin/env python import pdb from svm import * def svm_read_problem(data_file_name): """ svm_read_problem(data_file_name) -> [y, x] Read LIBSVM-format data from data_file_name and return labels y and data instances x. """ prob_y = [] prob_x = [] for line in open(data_file_name): line = line.split(None, 1) # In case an instance with all zero features if len(line) == 1: line += [''] label, features = line xi = {} for e in features.split(): ind, val = e.split(":") xi[int(ind)] = float(val) prob_y += [float(label)] prob_x += [xi] return (prob_y, prob_x) def svm_load_model(model_file_name): """ svm_load_model(model_file_name) -> model Load a LIBSVM model from model_file_name and return. """ model = libsvm.svm_load_model(model_file_name) if not model: print("can't open model file %s" % model_file_name) return None model = toPyModel(model) return model def svm_save_model(model_file_name, model): """ svm_save_model(model_file_name, model) -> None Save a LIBSVM model to the file model_file_name. """ libsvm.svm_save_model(model_file_name, model) def evaluations(ty, pv): """ evaluations(ty, pv) -> (ACC, MSE, SCC) Calculate accuracy, mean squared error and squared correlation coefficient using the true values (ty) and predicted values (pv). """ if len(ty) != len(pv): raise ValueError("len(ty) must equal to len(pv)") total_correct = total_error = 0 sumv = sumy = sumvv = sumyy = sumvy = 0 for v, y in zip(pv, ty): if y == v: total_correct += 1 total_error += (v-y)*(v-y) sumv += v sumy += y sumvv += v*v sumyy += y*y sumvy += v*y l = len(ty) ACC = 100.0*total_correct/l MSE = total_error/l try: SCC = ((l*sumvy-sumv*sumy)*(l*sumvy-sumv*sumy))/((l*sumvv-sumv*sumv)*(l*sumyy-sumy*sumy)) except: SCC = float('nan') return (ACC, MSE, SCC) def svm_train(arg1, arg2=None, arg3=None): """ svm_train(y, x [, 'options']) -> model | ACC | MSE svm_train(prob, [, 'options']) -> model | ACC | MSE svm_train(prob, param) -> model | ACC| MSE Train an SVM model from data (y, x) or an svm_problem prob using 'options' or an svm_parameter param. If '-v' is specified in 'options' (i.e., cross validation) either accuracy (ACC) or mean-squared error (MSE) is returned. 'options': -s svm_type : set type of SVM (default 0) 0 -- C-SVC 1 -- nu-SVC 2 -- one-class SVM 3 -- epsilon-SVR 4 -- nu-SVR -t kernel_type : set type of kernel function (default 2) 0 -- linear: u'*v 1 -- polynomial: (gamma*u'*v + coef0)^degree 2 -- radial basis function: exp(-gamma*|u-v|^2) 3 -- sigmoid: tanh(gamma*u'*v + coef0) 4 -- precomputed kernel (kernel values in training_set_file) -d degree : set degree in kernel function (default 3) -g gamma : set gamma in kernel function (default 1/num_features) -r coef0 : set coef0 in kernel function (default 0) -c cost : set the parameter C of C-SVC, epsilon-SVR, and nu-SVR (default 1) -n nu : set the parameter nu of nu-SVC, one-class SVM, and nu-SVR (default 0.5) -p epsilon : set the epsilon in loss function of epsilon-SVR (default 0.1) -m cachesize : set cache memory size in MB (default 100) -e epsilon : set tolerance of termination criterion (default 0.001) -h shrinking : whether to use the shrinking heuristics, 0 or 1 (default 1) -b probability_estimates : whether to train a SVC or SVR model for probability estimates, 0 or 1 (default 0) -wi weight : set the parameter C of class i to weight*C, for C-SVC (default 1) -v n: n-fold cross validation mode -q : quiet mode (no outputs) """ prob, param = None, None #pdb.set_trace() if isinstance(arg1, (list, tuple)): assert isinstance(arg2, (list, tuple)) y, x, options = arg1, arg2, arg3 prob = svm_problem(y, x) param = svm_parameter(options) elif isinstance(arg1, svm_problem): prob = arg1 if isinstance(arg2, svm_parameter): param = arg2 else: param = svm_parameter(arg2) if prob == None or param == None: raise TypeError("Wrong types for the arguments") if param.kernel_type == PRECOMPUTED: for xi in prob.x_space: idx, val = xi[0].index, xi[0].value if xi[0].index != 0: raise ValueError('Wrong input format: first column must be 0:sample_serial_number') if val <= 0 or val > prob.n: raise ValueError('Wrong input format: sample_serial_number out of range') if param.gamma == 0 and prob.n > 0: param.gamma = 1.0 / prob.n libsvm.svm_set_print_string_function(param.print_func) err_msg = libsvm.svm_check_parameter(prob, param) if err_msg: raise ValueError('Error: %s' % err_msg) if param.cross_validation: l, nr_fold = prob.l, param.nr_fold target = (c_double * l)() libsvm.svm_cross_validation(prob, param, nr_fold, target) ACC, MSE, SCC = evaluations(prob.y[:l], target[:l]) if param.svm_type in [EPSILON_SVR, NU_SVR]: print("Cross Validation Mean squared error = %g" % MSE) print("Cross Validation Squared correlation coefficient = %g" % SCC) return MSE else: print("Cross Validation Accuracy = %g%%" % ACC) return ACC else: m = libsvm.svm_train(prob, param) m = toPyModel(m) # If prob is destroyed, data including SVs pointed by m can remain. m.x_space = prob.x_space return m def svm_predict(y, x, m, options=""): """ svm_predict(y, x, m [, "options"]) -> (p_labels, p_acc, p_vals) Predict data (y, x) with the SVM model m. "options": -b probability_estimates: whether to predict probability estimates, 0 or 1 (default 0); for one-class SVM only 0 is supported. The return tuple contains p_labels: a list of predicted labels p_acc: a tuple including accuracy (for classification), mean-squared error, and squared correlation coefficient (for regression). p_vals: a list of decision values or probability estimates (if '-b 1' is specified). If k is the number of classes, for decision values, each element includes results of predicting k(k-1)/2 binary-class SVMs. For probabilities, each element contains k values indicating the probability that the testing instance is in each class. Note that the order of classes here is the same as 'model.label' field in the model structure. """ predict_probability = 0 argv = options.split() i = 0 while i < len(argv): if argv[i] == '-b': i += 1 predict_probability = int(argv[i]) else: raise ValueError("Wrong options") i+=1 svm_type = m.get_svm_type() is_prob_model = m.is_probability_model() nr_class = m.get_nr_class() pred_labels = [] pred_values = [] if predict_probability: if not is_prob_model: raise ValueError("Model does not support probabiliy estimates") if svm_type in [NU_SVR, EPSILON_SVR]: print("Prob. model for test data: target value = predicted value + z,\n" "z: Laplace distribution e^(-|z|/sigma)/(2sigma),sigma=%g" % m.get_svr_probability()); nr_class = 0 prob_estimates = (c_double * nr_class)() for xi in x: xi, idx = gen_svm_nodearray(xi) label = libsvm.svm_predict_probability(m, xi, prob_estimates) values = prob_estimates[:nr_class] pred_labels += [label] pred_values += [values] else: if is_prob_model: print("Model supports probability estimates, but disabled in predicton.") if svm_type in (ONE_CLASS, EPSILON_SVR, NU_SVC): nr_classifier = 1 else: nr_classifier = nr_class*(nr_class-1)//2 dec_values = (c_double * nr_classifier)() for xi in x: #pdb.set_trace() xi, idx = gen_svm_nodearray(xi) label = libsvm.svm_predict_values(m, xi, dec_values) values = dec_values[:nr_classifier] pred_labels += [label] pred_values += [values] ACC, MSE, SCC = evaluations(y, pred_labels) l = len(y) if svm_type in [EPSILON_SVR, NU_SVR]: print("Mean squared error = %g (regression)" % MSE) print("Squared correlation coefficient = %g (regression)" % SCC) else: print("Accuracy = %g%% (%d/%d) (classification)" % (ACC, int(l*ACC/100), l)) return pred_labels, (ACC, MSE, SCC), pred_values
ajibawa-2023/Python-Code-Large/train/row_99308
118
245
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Import_L3_C0", "label": "pdb import pdb", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0122, 0.0041, 0, 0.66, 0.0, 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_99308:ImportFrom_L4_C0", "label": "from svm import *", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0163, 0.0041, 0, 0.66, 0.1429, 75, 0, 1, 0, 0, 75, 0, 0], "semantic": {"name": "svm", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from svm import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L6_C0", "label": "svm_read_problem", "type": "function", "loc": [6, 26], "level": 0, "parent": null, "vector": [2, 0, 0.0653, 0.0857, 0, 0.66, 0.2857, 583, 0, 1, 1, 0, 0, 0, 8], "semantic": {"name": "svm_read_problem", "arg_names": ["data_file_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def svm_read_problem(data_file_name):\n\t\"\"\"\n\tsvm_read_problem(data_file_name) -> [y, x]\n\n\tRead LIBSVM-format data from data_file_name and return labels y\n\tand data instances x.\n\t\"\"\"\n\tprob_y = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L7_C1", "label": "expression", "type": "expression", "loc": [7, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L6_C0", "vector": [8, 1, 0.0388, 0.0245, 1, 0.33, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\"\"\"\n\tsvm_read_problem(data_file_name) -> [y, x]\n\n\tRead LIBSVM-format data from data_file_name and return labels y\n\tand data instances x.\n\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L13_C1", "label": "prob_y =", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L6_C0", "vector": [14, 1, 0.0531, 0.0041, 1, 0.33, 0.25, 28, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "prob_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tprob_y = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L14_C1", "label": "prob_x =", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L6_C0", "vector": [14, 1, 0.0571, 0.0041, 1, 0.33, 0.5, 341, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "prob_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tprob_x = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L15_C1", "label": "for line", "type": "for", "loc": [15, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L6_C0", "vector": [6, 1, 0.0816, 0.0449, 1, 0.33, 0.75, 373, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor line in open(data_file_name):\n\t\tline = line.split(None, 1)\n\t\t# In case an instance with all zero features\n\t\tif len(line) == 1: line += ['']\n\t\tlabel, features = line\n\t\txi = {}\n\t\tfor e in features.split():\n\t\t\tind, val = e.split(\":\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L16_C2", "label": "line = split()", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L15_C1", "vector": [14, 2, 0.0653, 0.0041, 2, 0.57, 0.0, 373, 3, 2, 0, 0, 908, 10, 1], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tline = line.split(None, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L18_C2", "label": "if", "type": "if", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L15_C1", "vector": [4, 2, 0.0735, 0.0041, 2, 0.57, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif len(line) == 1: line += ['']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L19_C2", "label": "label, features =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L15_C1", "vector": [14, 2, 0.0776, 0.0041, 2, 0.57, 0.5, 350, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "label, features", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tlabel, features = line"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L20_C2", "label": "xi =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L15_C1", "vector": [14, 2, 0.0816, 0.0041, 2, 0.57, 0.75, 290, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "xi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\txi = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L21_C2", "label": "for e", "type": "for", "loc": [21, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L15_C1", "vector": [6, 2, 0.0898, 0.0122, 2, 0.57, 1.0, 175, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "e", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor e in features.split():\n\t\t\tind, val = e.split(\":\")\n\t\t\txi[int(ind)] = float(val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L22_C3", "label": "ind, val = split()", "type": "assigned_variable", "loc": [22, 22], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L21_C2", "vector": [14, 3, 0.0898, 0.0041, 3, 0.89, 0.0, 695, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "ind, val", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\t\tind, val = e.split(\":\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L23_C3", "label": " = float()", "type": "assigned_variable", "loc": [23, 23], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L21_C2", "vector": [14, 3, 0.0939, 0.0041, 3, 0.89, 1.0, 0, 3, 1, 0, 0, 639, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": "\t\t\txi[int(ind)] = float(val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Return_L26_C1", "label": "return", "type": "return", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L6_C0", "vector": [13, 1, 0.1061, 0.0041, 1, 0.33, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn (prob_y, prob_x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L28_C0", "label": "svm_load_model", "type": "function", "loc": [28, 39], "level": 0, "parent": null, "vector": [2, 0, 0.1367, 0.049, 0, 0.66, 0.4286, 81, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "svm_load_model", "arg_names": ["model_file_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def svm_load_model(model_file_name):\n\t\"\"\"\n\tsvm_load_model(model_file_name) -> model\n\t\n\tLoad a LIBSVM model from model_file_name and return.\n\t\"\"\"\n\tmodel = libsvm.svm_load_model(model_file_name)\n\tif not model: "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L29_C1", "label": "expression", "type": "expression", "loc": [29, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L28_C0", "vector": [8, 1, 0.1265, 0.0204, 1, 0.21, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\"\"\"\n\tsvm_load_model(model_file_name) -> model\n\t\n\tLoad a LIBSVM model from model_file_name and return.\n\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L34_C1", "label": "model = svm_load_model()", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L28_C0", "vector": [14, 1, 0.1388, 0.0041, 1, 0.21, 0.25, 722, 3, 1, 0, 0, 81, 10, 1], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "svm_load_model", "annotation": ""}, "snippet": "\tmodel = libsvm.svm_load_model(model_file_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L35_C1", "label": "if", "type": "if", "loc": [35, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L28_C0", "vector": [4, 1, 0.1469, 0.0122, 1, 0.21, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif not model: \n\t\tprint(\"can't open model file %s\" % model_file_name)\n\t\treturn None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L36_C2", "label": "print()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L35_C1", "vector": [8, 2, 0.1469, 0.0041, 2, 0.6, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint(\"can't open model file %s\" % model_file_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Return_L37_C2", "label": "return", "type": "return", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L35_C1", "vector": [13, 2, 0.151, 0.0041, 2, 0.6, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L38_C1", "label": "model = toPyModel()", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L28_C0", "vector": [14, 1, 0.1551, 0.0041, 1, 0.21, 0.75, 722, 3, 1, 0, 0, 834, 10, 1], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "toPyModel", "annotation": ""}, "snippet": "\tmodel = toPyModel(model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Return_L39_C1", "label": "return", "type": "return", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L28_C0", "vector": [13, 1, 0.1592, 0.0041, 1, 0.21, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L41_C0", "label": "svm_save_model", "type": "function", "loc": [41, 47], "level": 0, "parent": null, "vector": [2, 0, 0.1796, 0.0286, 0, 0.66, 0.5714, 733, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "svm_save_model", "arg_names": ["model_file_name", "model"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def svm_save_model(model_file_name, model):\n\t\"\"\"\n\tsvm_save_model(model_file_name, model) -> None\n\n\tSave a LIBSVM model to the file model_file_name.\n\t\"\"\"\n\tlibsvm.svm_save_model(model_file_name, model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L42_C1", "label": "expression", "type": "expression", "loc": [42, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L41_C0", "vector": [8, 1, 0.1796, 0.0204, 1, 0.09, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\"\"\"\n\tsvm_save_model(model_file_name, model) -> None\n\n\tSave a LIBSVM model to the file model_file_name.\n\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L47_C1", "label": "svm_save_model()", "type": "expression", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L41_C0", "vector": [8, 1, 0.1918, 0.0041, 1, 0.09, 1.0, 733, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "svm_save_model", "arg_names": [], "import_names": [], "rhs_call_name": "svm_save_model", "annotation": ""}, "snippet": "\tlibsvm.svm_save_model(model_file_name, model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L49_C0", "label": "evaluations", "type": "function", "loc": [49, 76], "level": 0, "parent": null, "vector": [2, 0, 0.2551, 0.1143, 0, 0.66, 0.7143, 522, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "evaluations", "arg_names": ["ty", "pv"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def evaluations(ty, pv):\n\t\"\"\"\n\tevaluations(ty, pv) -> (ACC, MSE, SCC)\n\n\tCalculate accuracy, mean squared error and squared correlation coefficient\n\tusing the true values (ty) and predicted values (pv).\n\t\"\"\"\n\tif len(ty) != len(pv):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L50_C1", "label": "expression", "type": "expression", "loc": [50, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L49_C0", "vector": [8, 1, 0.2143, 0.0245, 1, 0.67, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\"\"\"\n\tevaluations(ty, pv) -> (ACC, MSE, SCC)\n\n\tCalculate accuracy, mean squared error and squared correlation coefficient\n\tusing the true values (ty) and predicted values (pv).\n\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L56_C1", "label": "if", "type": "if", "loc": [56, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L49_C0", "vector": [4, 1, 0.2306, 0.0082, 1, 0.67, 0.1111, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif len(ty) != len(pv):\n\t\traise ValueError(\"len(ty) must equal to len(pv)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L58_C1", "label": "total_correct =", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L49_C0", "vector": [14, 1, 0.2367, 0.0041, 1, 0.67, 0.2222, 772, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "total_correct", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\ttotal_correct = total_error = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L59_C1", "label": "sumv =", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L49_C0", "vector": [14, 1, 0.2408, 0.0041, 1, 0.67, 0.3333, 247, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "sumv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tsumv = sumy = sumvv = sumyy = sumvy = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L60_C1", "label": "for v, y", "type": "for", "loc": [60, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L49_C0", "vector": [6, 1, 0.2612, 0.0367, 1, 0.67, 0.4444, 492, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "v, y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor v, y in zip(pv, ty):\n\t\tif y == v: \n\t\t\ttotal_correct += 1\n\t\ttotal_error += (v-y)*(v-y)\n\t\tsumv += v\n\t\tsumy += y\n\t\tsumvv += v*v\n\t\tsumyy += y*y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L61_C2", "label": "if", "type": "if", "loc": [61, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L60_C1", "vector": [4, 2, 0.251, 0.0082, 2, 0.8, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif y == v: \n\t\t\ttotal_correct += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L69_C1", "label": "l = len()", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L49_C0", "vector": [14, 1, 0.2816, 0.0041, 1, 0.67, 0.5556, 810, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": "\tl = len(ty)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L70_C1", "label": "ACC =", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L49_C0", "vector": [14, 1, 0.2857, 0.0041, 1, 0.67, 0.6667, 241, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ACC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tACC = 100.0*total_correct/l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L71_C1", "label": "MSE =", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L49_C0", "vector": [14, 1, 0.2898, 0.0041, 1, 0.67, 0.7778, 426, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "MSE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tMSE = total_error/l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Try_L72_C1", "label": "try", "type": "try", "loc": [72, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L49_C0", "vector": [7, 1, 0.3, 0.0163, 1, 0.67, 0.8889, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\ttry:\n\t\tSCC = ((l*sumvy-sumv*sumy)*(l*sumvy-sumv*sumy))/((l*sumvv-sumv*sumv)*(l*sumyy-sumy*sumy))\n\texcept:\n\t\tSCC = float('nan')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L73_C2", "label": "SCC =", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:Try_L72_C1", "vector": [14, 2, 0.298, 0.0041, 2, 0.67, 0.0, 890, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "SCC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tSCC = ((l*sumvy-sumv*sumy)*(l*sumvy-sumv*sumy))/((l*sumvv-sumv*sumv)*(l*sumyy-sumy*sumy))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L75_C2", "label": "SCC = float()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:Try_L72_C1", "vector": [14, 2, 0.3061, 0.0041, 2, 0.67, 0.0, 890, 3, 1, 0, 0, 639, 10, 1], "semantic": {"name": "SCC", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": "\t\tSCC = float('nan')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Return_L76_C1", "label": "return", "type": "return", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L49_C0", "vector": [13, 1, 0.3102, 0.0041, 1, 0.67, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn (ACC, MSE, SCC)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L78_C0", "label": "svm_train", "type": "function", "loc": [78, 164], "level": 0, "parent": null, "vector": [2, 0, 0.4939, 0.3551, 0, 0.66, 0.8571, 400, 0, 3, 1, 0, 0, 0, 21], "semantic": {"name": "svm_train", "arg_names": ["arg1", "arg2", "arg3"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def svm_train(arg1, arg2=None, arg3=None):\n\t\"\"\"\n\tsvm_train(y, x [, 'options']) -> model | ACC | MSE \n\tsvm_train(prob, [, 'options']) -> model | ACC | MSE \n\tsvm_train(prob, param) -> model | ACC| MSE \n\n\tTrain an SVM model from data (y, x) or an svm_problem prob using\n\t'options' or an svm_parameter param. "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L79_C1", "label": "expression", "type": "expression", "loc": [79, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L78_C0", "vector": [8, 1, 0.3939, 0.1469, 1, 0.39, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\"\"\"\n\tsvm_train(y, x [, 'options']) -> model | ACC | MSE \n\tsvm_train(prob, [, 'options']) -> model | ACC | MSE \n\tsvm_train(prob, param) -> model | ACC| MSE \n\n\tTrain an SVM model from data (y, x) or an svm_problem prob using\n\t'options' or an svm_parameter param. \n\tIf '-v' is specified in 'options' (i.e., cross validation)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L115_C1", "label": "prob, param =", "type": "assigned_variable", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L78_C0", "vector": [14, 1, 0.4694, 0.0041, 1, 0.39, 0.1111, 210, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "prob, param", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tprob, param = None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L117_C1", "label": "if", "type": "if", "loc": [117, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L78_C0", "vector": [4, 1, 0.498, 0.0449, 1, 0.39, 0.2222, 0, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif isinstance(arg1, (list, tuple)):\n\t\tassert isinstance(arg2, (list, tuple))\n\t\ty, x, options = arg1, arg2, arg3\n\t\tprob = svm_problem(y, x)\n\t\tparam = svm_parameter(options)\n\telif isinstance(arg1, svm_problem):\n\t\tprob = arg1\n\t\tif isinstance(arg2, svm_parameter):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L119_C2", "label": "y, x, options =", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L117_C1", "vector": [14, 2, 0.4857, 0.0041, 2, 0.37, 0.0, 347, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "y, x, options", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\ty, x, options = arg1, arg2, arg3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L120_C2", "label": "prob = svm_problem()", "type": "assigned_variable", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L117_C1", "vector": [14, 2, 0.4898, 0.0041, 2, 0.37, 0.3333, 24, 3, 2, 0, 0, 14, 10, 1], "semantic": {"name": "prob", "arg_names": [], "import_names": [], "rhs_call_name": "svm_problem", "annotation": ""}, "snippet": "\t\tprob = svm_problem(y, x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L121_C2", "label": "param = svm_parameter()", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L117_C1", "vector": [14, 2, 0.4939, 0.0041, 2, 0.37, 0.6667, 841, 3, 1, 0, 0, 987, 10, 1], "semantic": {"name": "param", "arg_names": [], "import_names": [], "rhs_call_name": "svm_parameter", "annotation": ""}, "snippet": "\t\tparam = svm_parameter(options)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L122_C1", "label": "if", "type": "if", "loc": [122, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L117_C1", "vector": [4, 2, 0.5082, 0.0245, 2, 0.37, 1.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\telif isinstance(arg1, svm_problem):\n\t\tprob = arg1\n\t\tif isinstance(arg2, svm_parameter):\n\t\t\tparam = arg2\n\t\telse:\n\t\t\tparam = svm_parameter(arg2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L123_C2", "label": "prob =", "type": "assigned_variable", "loc": [123, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L122_C1", "vector": [14, 3, 0.502, 0.0041, 3, 0.84, 0.0, 24, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prob", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tprob = arg1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L124_C2", "label": "if", "type": "if", "loc": [124, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L122_C1", "vector": [4, 3, 0.5122, 0.0163, 3, 0.84, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif isinstance(arg2, svm_parameter):\n\t\t\tparam = arg2\n\t\telse:\n\t\t\tparam = svm_parameter(arg2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L125_C3", "label": "param =", "type": "assigned_variable", "loc": [125, 125], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L124_C2", "vector": [14, 4, 0.5102, 0.0041, 4, 0.59, 0.0, 841, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "param", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tparam = arg2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L127_C3", "label": "param = svm_parameter()", "type": "assigned_variable", "loc": [127, 127], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L124_C2", "vector": [14, 4, 0.5184, 0.0041, 4, 0.59, 1.0, 841, 3, 1, 0, 0, 987, 10, 1], "semantic": {"name": "param", "arg_names": [], "import_names": [], "rhs_call_name": "svm_parameter", "annotation": ""}, "snippet": "\t\t\tparam = svm_parameter(arg2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L128_C1", "label": "if", "type": "if", "loc": [128, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L78_C0", "vector": [4, 1, 0.5245, 0.0082, 1, 0.39, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif prob == None or param == None:\n\t\traise TypeError(\"Wrong types for the arguments\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L131_C1", "label": "if", "type": "if", "loc": [131, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L78_C0", "vector": [4, 1, 0.5469, 0.0286, 1, 0.39, 0.4444, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif param.kernel_type == PRECOMPUTED:\n\t\tfor xi in prob.x_space:\n\t\t\tidx, val = xi[0].index, xi[0].value\n\t\t\tif xi[0].index != 0:\n\t\t\t\traise ValueError('Wrong input format: first column must be 0:sample_serial_number')\n\t\t\tif val <= 0 or val > prob.n:\n\t\t\t\traise ValueError('Wrong input format: sample_serial_number out of range')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L132_C2", "label": "for xi", "type": "for", "loc": [132, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L131_C1", "vector": [6, 2, 0.549, 0.0245, 2, 0.87, 0.0, 290, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "xi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor xi in prob.x_space:\n\t\t\tidx, val = xi[0].index, xi[0].value\n\t\t\tif xi[0].index != 0:\n\t\t\t\traise ValueError('Wrong input format: first column must be 0:sample_serial_number')\n\t\t\tif val <= 0 or val > prob.n:\n\t\t\t\traise ValueError('Wrong input format: sample_serial_number out of range')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L133_C3", "label": "idx, val =", "type": "assigned_variable", "loc": [133, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L132_C2", "vector": [14, 3, 0.5429, 0.0041, 3, 0.93, 0.0, 861, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "idx, val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tidx, val = xi[0].index, xi[0].value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L134_C3", "label": "if", "type": "if", "loc": [134, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L132_C2", "vector": [4, 3, 0.549, 0.0082, 3, 0.93, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif xi[0].index != 0:\n\t\t\t\traise ValueError('Wrong input format: first column must be 0:sample_serial_number')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L136_C3", "label": "if", "type": "if", "loc": [136, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L132_C2", "vector": [4, 3, 0.5571, 0.0082, 3, 0.93, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif val <= 0 or val > prob.n:\n\t\t\t\traise ValueError('Wrong input format: sample_serial_number out of range')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L139_C1", "label": "if", "type": "if", "loc": [139, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L78_C0", "vector": [4, 1, 0.5694, 0.0082, 1, 0.39, 0.5556, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif param.gamma == 0 and prob.n > 0: \n\t\tparam.gamma = 1.0 / prob.n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L140_C2", "label": "param.gamma =", "type": "assigned_variable", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L139_C1", "vector": [14, 2, 0.5714, 0.0041, 2, 0.93, 0.0, 457, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "param.gamma", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tparam.gamma = 1.0 / prob.n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L141_C1", "label": "svm_set_print_string_function()", "type": "expression", "loc": [141, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L78_C0", "vector": [8, 1, 0.5755, 0.0041, 1, 0.39, 0.6667, 127, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "svm_set_print_string_function", "arg_names": [], "import_names": [], "rhs_call_name": "svm_set_print_string_function", "annotation": ""}, "snippet": "\tlibsvm.svm_set_print_string_function(param.print_func)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L142_C1", "label": "err_msg = svm_check_parameter()", "type": "assigned_variable", "loc": [142, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L78_C0", "vector": [14, 1, 0.5796, 0.0041, 1, 0.39, 0.7778, 236, 3, 2, 0, 0, 317, 10, 1], "semantic": {"name": "err_msg", "arg_names": [], "import_names": [], "rhs_call_name": "svm_check_parameter", "annotation": ""}, "snippet": "\terr_msg = libsvm.svm_check_parameter(prob, param)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L143_C1", "label": "if", "type": "if", "loc": [143, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L78_C0", "vector": [4, 1, 0.5857, 0.0082, 1, 0.39, 0.8889, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif err_msg:\n\t\traise ValueError('Error: %s' % err_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L146_C1", "label": "if", "type": "if", "loc": [146, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L78_C0", "vector": [4, 1, 0.6327, 0.0776, 1, 0.39, 1.0, 0, 7, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif param.cross_validation:\n\t\tl, nr_fold = prob.l, param.nr_fold\n\t\ttarget = (c_double * l)()\n\t\tlibsvm.svm_cross_validation(prob, param, nr_fold, target)\t\n\t\tACC, MSE, SCC = evaluations(prob.y[:l], target[:l])\n\t\tif param.svm_type in [EPSILON_SVR, NU_SVR]:\n\t\t\tprint(\"Cross Validation Mean squared error = %g\" % MSE)\n\t\t\tprint(\"Cross Validation Squared correlation coefficient = %g\" % SCC)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L147_C2", "label": "l, nr_fold =", "type": "assigned_variable", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L146_C1", "vector": [14, 2, 0.6, 0.0041, 2, 0.66, 0.0, 562, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "l, nr_fold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tl, nr_fold = prob.l, param.nr_fold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L148_C2", "label": "target =", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L146_C1", "vector": [14, 2, 0.6041, 0.0041, 2, 0.66, 0.125, 766, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "target", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\ttarget = (c_double * l)()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L149_C2", "label": "svm_cross_validation()", "type": "expression", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L146_C1", "vector": [8, 2, 0.6082, 0.0041, 2, 0.66, 0.25, 359, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "svm_cross_validation", "arg_names": [], "import_names": [], "rhs_call_name": "svm_cross_validation", "annotation": ""}, "snippet": "\t\tlibsvm.svm_cross_validation(prob, param, nr_fold, target)\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L150_C2", "label": "ACC, MSE, SCC = evaluations()", "type": "assigned_variable", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L146_C1", "vector": [14, 2, 0.6122, 0.0041, 2, 0.66, 0.375, 563, 3, 2, 0, 0, 522, 10, 1], "semantic": {"name": "ACC, MSE, SCC", "arg_names": [], "import_names": [], "rhs_call_name": "evaluations", "annotation": ""}, "snippet": "\t\tACC, MSE, SCC = evaluations(prob.y[:l], target[:l])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L151_C2", "label": "if", "type": "if", "loc": [151, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L146_C1", "vector": [4, 2, 0.6286, 0.0286, 2, 0.66, 0.5, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif param.svm_type in [EPSILON_SVR, NU_SVR]:\n\t\t\tprint(\"Cross Validation Mean squared error = %g\" % MSE)\n\t\t\tprint(\"Cross Validation Squared correlation coefficient = %g\" % SCC)\n\t\t\treturn MSE\n\t\telse:\n\t\t\tprint(\"Cross Validation Accuracy = %g%%\" % ACC)\n\t\t\treturn ACC"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L152_C3", "label": "print()", "type": "expression", "loc": [152, 152], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L151_C2", "vector": [8, 3, 0.6204, 0.0041, 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": "\t\t\tprint(\"Cross Validation Mean squared error = %g\" % MSE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L153_C3", "label": "print()", "type": "expression", "loc": [153, 153], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L151_C2", "vector": [8, 3, 0.6245, 0.0041, 3, 0.34, 0.25, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\t\tprint(\"Cross Validation Squared correlation coefficient = %g\" % SCC)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Return_L154_C3", "label": "return", "type": "return", "loc": [154, 154], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L151_C2", "vector": [13, 3, 0.6286, 0.0041, 3, 0.34, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn MSE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L156_C3", "label": "print()", "type": "expression", "loc": [156, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L151_C2", "vector": [8, 3, 0.6367, 0.0041, 3, 0.34, 0.75, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\t\tprint(\"Cross Validation Accuracy = %g%%\" % ACC)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Return_L157_C3", "label": "return", "type": "return", "loc": [157, 157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L151_C2", "vector": [13, 3, 0.6408, 0.0041, 3, 0.34, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn ACC"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L159_C2", "label": "m = svm_train()", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L146_C1", "vector": [14, 2, 0.649, 0.0041, 2, 0.66, 0.625, 711, 3, 2, 0, 0, 400, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "svm_train", "annotation": ""}, "snippet": "\t\tm = libsvm.svm_train(prob, param)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L160_C2", "label": "m = toPyModel()", "type": "assigned_variable", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L146_C1", "vector": [14, 2, 0.6531, 0.0041, 2, 0.66, 0.75, 711, 3, 1, 0, 0, 834, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "toPyModel", "annotation": ""}, "snippet": "\t\tm = toPyModel(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L163_C2", "label": "m.x_space =", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L146_C1", "vector": [14, 2, 0.6653, 0.0041, 2, 0.66, 0.875, 69, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.x_space", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tm.x_space = prob.x_space"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Return_L164_C2", "label": "return", "type": "return", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L146_C1", "vector": [13, 2, 0.6694, 0.0041, 2, 0.66, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn m"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "label": "svm_predict", "type": "function", "loc": [166, 244], "level": 0, "parent": null, "vector": [2, 0, 0.8367, 0.3224, 0, 0.66, 1.0, 350, 0, 4, 1, 0, 0, 0, 23], "semantic": {"name": "svm_predict", "arg_names": ["y", "x", "m", "options"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def svm_predict(y, x, m, options=\"\"):\n\t\"\"\"\n\tsvm_predict(y, x, m [, \"options\"]) -> (p_labels, p_acc, p_vals)\n\n\tPredict data (y, x) with the SVM model m. \n\t\"options\": \n\t -b probability_estimates: whether to predict probability estimates, \n\t 0 or 1 (default 0); for one-class SVM only 0 is supported."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L167_C1", "label": "expression", "type": "expression", "loc": [167, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "vector": [8, 1, 0.7204, 0.0816, 1, 0.49, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\"\"\"\n\tsvm_predict(y, x, m [, \"options\"]) -> (p_labels, p_acc, p_vals)\n\n\tPredict data (y, x) with the SVM model m. \n\t\"options\": \n\t -b probability_estimates: whether to predict probability estimates, \n\t 0 or 1 (default 0); for one-class SVM only 0 is supported.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L187_C1", "label": "predict_probability =", "type": "assigned_variable", "loc": [187, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "vector": [14, 1, 0.7633, 0.0041, 1, 0.49, 0.0714, 111, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "predict_probability", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tpredict_probability = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L188_C1", "label": "argv = split()", "type": "assigned_variable", "loc": [188, 188], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "vector": [14, 1, 0.7673, 0.0041, 1, 0.49, 0.1429, 612, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "argv", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\targv = options.split()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L189_C1", "label": "i =", "type": "assigned_variable", "loc": [189, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "vector": [14, 1, 0.7714, 0.0041, 1, 0.49, 0.2143, 826, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\ti = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:While_L190_C1", "label": "while", "type": "while", "loc": [190, 196], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "vector": [5, 1, 0.7878, 0.0286, 1, 0.49, 0.2857, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\twhile i < len(argv):\n\t\tif argv[i] == '-b':\n\t\t\ti += 1\n\t\t\tpredict_probability = int(argv[i])\n\t\telse:\n\t\t\traise ValueError(\"Wrong options\")\n\t\ti+=1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L191_C2", "label": "if", "type": "if", "loc": [191, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:While_L190_C1", "vector": [4, 2, 0.7878, 0.0204, 2, 0.85, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif argv[i] == '-b':\n\t\t\ti += 1\n\t\t\tpredict_probability = int(argv[i])\n\t\telse:\n\t\t\traise ValueError(\"Wrong options\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L193_C3", "label": "predict_probability = int()", "type": "assigned_variable", "loc": [193, 193], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L191_C2", "vector": [14, 3, 0.7878, 0.0041, 3, 0.57, 0.0, 111, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "predict_probability", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\tpredict_probability = int(argv[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L198_C1", "label": "svm_type = get_svm_type()", "type": "assigned_variable", "loc": [198, 198], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "vector": [14, 1, 0.8082, 0.0041, 1, 0.49, 0.3571, 332, 3, 0, 0, 0, 667, 10, 1], "semantic": {"name": "svm_type", "arg_names": [], "import_names": [], "rhs_call_name": "get_svm_type", "annotation": ""}, "snippet": "\tsvm_type = m.get_svm_type()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L199_C1", "label": "is_prob_model = is_probability_model()", "type": "assigned_variable", "loc": [199, 199], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "vector": [14, 1, 0.8122, 0.0041, 1, 0.49, 0.4286, 254, 3, 0, 0, 0, 875, 10, 1], "semantic": {"name": "is_prob_model", "arg_names": [], "import_names": [], "rhs_call_name": "is_probability_model", "annotation": ""}, "snippet": "\tis_prob_model = m.is_probability_model()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L200_C1", "label": "nr_class = get_nr_class()", "type": "assigned_variable", "loc": [200, 200], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "vector": [14, 1, 0.8163, 0.0041, 1, 0.49, 0.5, 123, 3, 0, 0, 0, 238, 10, 1], "semantic": {"name": "nr_class", "arg_names": [], "import_names": [], "rhs_call_name": "get_nr_class", "annotation": ""}, "snippet": "\tnr_class = m.get_nr_class()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L201_C1", "label": "pred_labels =", "type": "assigned_variable", "loc": [201, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "vector": [14, 1, 0.8204, 0.0041, 1, 0.49, 0.5714, 365, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pred_labels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tpred_labels = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L202_C1", "label": "pred_values =", "type": "assigned_variable", "loc": [202, 202], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "vector": [14, 1, 0.8245, 0.0041, 1, 0.49, 0.6429, 961, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pred_values", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tpred_values = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L204_C1", "label": "if", "type": "if", "loc": [204, 234], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "vector": [4, 1, 0.8939, 0.1265, 1, 0.49, 0.7143, 0, 2, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif predict_probability:\n\t\tif not is_prob_model:\n\t\t\traise ValueError(\"Model does not support probabiliy estimates\")\n\n\t\tif svm_type in [NU_SVR, EPSILON_SVR]:\n\t\t\tprint(\"Prob. model for test data: target value = predicted value + z,\\n\"\n\t\t\t\"z: Laplace distribution e^(-|z|/sigma)/(2sigma),sigma=%g\" % m.get_svr_probability());\n\t\t\tnr_class = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L205_C2", "label": "if", "type": "if", "loc": [205, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L204_C1", "vector": [4, 2, 0.8388, 0.0082, 2, 0.87, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not is_prob_model:\n\t\t\traise ValueError(\"Model does not support probabiliy estimates\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L208_C2", "label": "if", "type": "if", "loc": [208, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L204_C1", "vector": [4, 2, 0.8551, 0.0163, 2, 0.87, 0.1429, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif svm_type in [NU_SVR, EPSILON_SVR]:\n\t\t\tprint(\"Prob. model for test data: target value = predicted value + z,\\n\"\n\t\t\t\"z: Laplace distribution e^(-|z|/sigma)/(2sigma),sigma=%g\" % m.get_svr_probability());\n\t\t\tnr_class = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L209_C3", "label": "print()", "type": "expression", "loc": [209, 210], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L208_C2", "vector": [8, 3, 0.8551, 0.0082, 3, 0.57, 0.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\t\tprint(\"Prob. model for test data: target value = predicted value + z,\\n\"\n\t\t\t\"z: Laplace distribution e^(-|z|/sigma)/(2sigma),sigma=%g\" % m.get_svr_probability());"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L211_C3", "label": "nr_class =", "type": "assigned_variable", "loc": [211, 211], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L208_C2", "vector": [14, 3, 0.8612, 0.0041, 3, 0.57, 1.0, 123, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "nr_class", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tnr_class = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L213_C2", "label": "prob_estimates =", "type": "assigned_variable", "loc": [213, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L204_C1", "vector": [14, 2, 0.8694, 0.0041, 2, 0.87, 0.2857, 900, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "prob_estimates", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tprob_estimates = (c_double * nr_class)()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L214_C2", "label": "for xi", "type": "for", "loc": [214, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L204_C1", "vector": [6, 2, 0.8837, 0.0245, 2, 0.87, 0.4286, 290, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "xi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor xi in x:\n\t\t\txi, idx = gen_svm_nodearray(xi)\n\t\t\tlabel = libsvm.svm_predict_probability(m, xi, prob_estimates)\n\t\t\tvalues = prob_estimates[:nr_class]\n\t\t\tpred_labels += [label]\n\t\t\tpred_values += [values]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L215_C3", "label": "xi, idx = gen_svm_nodearray()", "type": "assigned_variable", "loc": [215, 215], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L214_C2", "vector": [14, 3, 0.8776, 0.0041, 3, 0.0, 0.0, 420, 3, 1, 0, 0, 263, 10, 1], "semantic": {"name": "xi, idx", "arg_names": [], "import_names": [], "rhs_call_name": "gen_svm_nodearray", "annotation": ""}, "snippet": "\t\t\txi, idx = gen_svm_nodearray(xi)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L216_C3", "label": "label = svm_predict_probability()", "type": "assigned_variable", "loc": [216, 216], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L214_C2", "vector": [14, 3, 0.8816, 0.0041, 3, 0.0, 0.5, 811, 3, 3, 0, 0, 773, 10, 1], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "svm_predict_probability", "annotation": ""}, "snippet": "\t\t\tlabel = libsvm.svm_predict_probability(m, xi, prob_estimates)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L217_C3", "label": "values =", "type": "assigned_variable", "loc": [217, 217], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L214_C2", "vector": [14, 3, 0.8857, 0.0041, 3, 0.0, 1.0, 721, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "values", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tvalues = prob_estimates[:nr_class]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L221_C2", "label": "if", "type": "if", "loc": [221, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L204_C1", "vector": [4, 2, 0.9041, 0.0082, 2, 0.87, 0.5714, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif is_prob_model:\n\t\t\tprint(\"Model supports probability estimates, but disabled in predicton.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L222_C3", "label": "print()", "type": "expression", "loc": [222, 222], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L221_C2", "vector": [8, 3, 0.9061, 0.0041, 3, 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": "\t\t\tprint(\"Model supports probability estimates, but disabled in predicton.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L223_C2", "label": "if", "type": "if", "loc": [223, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L204_C1", "vector": [4, 2, 0.9163, 0.0163, 2, 0.87, 0.7143, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif svm_type in (ONE_CLASS, EPSILON_SVR, NU_SVC):\n\t\t\tnr_classifier = 1\n\t\telse:\n\t\t\tnr_classifier = nr_class*(nr_class-1)//2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L224_C3", "label": "nr_classifier =", "type": "assigned_variable", "loc": [224, 224], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L223_C2", "vector": [14, 3, 0.9143, 0.0041, 3, 0.67, 0.0, 498, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "nr_classifier", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tnr_classifier = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L226_C3", "label": "nr_classifier =", "type": "assigned_variable", "loc": [226, 226], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L223_C2", "vector": [14, 3, 0.9224, 0.0041, 3, 0.67, 1.0, 498, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "nr_classifier", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tnr_classifier = nr_class*(nr_class-1)//2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L227_C2", "label": "dec_values =", "type": "assigned_variable", "loc": [227, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L204_C1", "vector": [14, 2, 0.9265, 0.0041, 2, 0.87, 0.8571, 524, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "dec_values", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdec_values = (c_double * nr_classifier)()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L228_C2", "label": "for xi", "type": "for", "loc": [228, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L204_C1", "vector": [6, 2, 0.9429, 0.0286, 2, 0.87, 1.0, 290, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "xi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor xi in x:\n\t\t\t#pdb.set_trace()\n\t\t\txi, idx = gen_svm_nodearray(xi)\n\t\t\tlabel = libsvm.svm_predict_values(m, xi, dec_values)\n\t\t\tvalues = dec_values[:nr_classifier]\n\t\t\tpred_labels += [label]\n\t\t\tpred_values += [values]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L230_C3", "label": "xi, idx = gen_svm_nodearray()", "type": "assigned_variable", "loc": [230, 230], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L228_C2", "vector": [14, 3, 0.9388, 0.0041, 3, 0.25, 0.0, 420, 3, 1, 0, 0, 263, 10, 1], "semantic": {"name": "xi, idx", "arg_names": [], "import_names": [], "rhs_call_name": "gen_svm_nodearray", "annotation": ""}, "snippet": "\t\t\txi, idx = gen_svm_nodearray(xi)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L231_C3", "label": "label = svm_predict_values()", "type": "assigned_variable", "loc": [231, 231], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L228_C2", "vector": [14, 3, 0.9429, 0.0041, 3, 0.25, 0.5, 811, 3, 3, 0, 0, 132, 10, 1], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "svm_predict_values", "annotation": ""}, "snippet": "\t\t\tlabel = libsvm.svm_predict_values(m, xi, dec_values)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L232_C3", "label": "values =", "type": "assigned_variable", "loc": [232, 232], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L228_C2", "vector": [14, 3, 0.9469, 0.0041, 3, 0.25, 1.0, 721, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "values", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tvalues = dec_values[:nr_classifier]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L236_C1", "label": "ACC, MSE, SCC = evaluations()", "type": "assigned_variable", "loc": [236, 236], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "vector": [14, 1, 0.9633, 0.0041, 1, 0.49, 0.7857, 563, 3, 2, 0, 0, 522, 10, 1], "semantic": {"name": "ACC, MSE, SCC", "arg_names": [], "import_names": [], "rhs_call_name": "evaluations", "annotation": ""}, "snippet": "\tACC, MSE, SCC = evaluations(y, pred_labels)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L237_C1", "label": "l = len()", "type": "assigned_variable", "loc": [237, 237], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "vector": [14, 1, 0.9673, 0.0041, 1, 0.49, 0.8571, 810, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": "\tl = len(y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L238_C1", "label": "if", "type": "if", "loc": [238, 242], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "vector": [4, 1, 0.9796, 0.0204, 1, 0.49, 0.9286, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif svm_type in [EPSILON_SVR, NU_SVR]:\n\t\tprint(\"Mean squared error = %g (regression)\" % MSE)\n\t\tprint(\"Squared correlation coefficient = %g (regression)\" % SCC)\n\telse:\n\t\tprint(\"Accuracy = %g%% (%d/%d) (classification)\" % (ACC, int(l*ACC/100), l))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L239_C2", "label": "print()", "type": "expression", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L238_C1", "vector": [8, 2, 0.9755, 0.0041, 2, 0.1, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint(\"Mean squared error = %g (regression)\" % MSE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L240_C2", "label": "print()", "type": "expression", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L238_C1", "vector": [8, 2, 0.9796, 0.0041, 2, 0.1, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint(\"Squared correlation coefficient = %g (regression)\" % SCC)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L242_C2", "label": "print()", "type": "expression", "loc": [242, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L238_C1", "vector": [8, 2, 0.9878, 0.0041, 2, 0.1, 1.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint(\"Accuracy = %g%% (%d/%d) (classification)\" % (ACC, int(l*ACC/100), l))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99308:Return_L244_C1", "label": "return", "type": "return", "loc": [244, 244], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "vector": [13, 1, 0.9959, 0.0041, 1, 0.49, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn pred_labels, (ACC, MSE, SCC), pred_values"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L7_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L13_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L14_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L15_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L15_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L16_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L15_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L18_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L15_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L19_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L15_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L20_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L15_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L21_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L21_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L22_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L21_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L23_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Return_L26_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L29_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L34_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L35_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L35_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L36_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L35_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Return_L37_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L38_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Return_L39_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L42_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L47_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L50_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L56_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L58_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L59_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L60_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L60_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L61_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L69_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L70_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L71_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Try_L72_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:Try_L72_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L73_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:Try_L72_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L75_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Return_L76_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L79_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L115_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L117_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L117_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L119_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L117_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L120_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L117_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L121_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L117_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L122_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L122_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L123_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L122_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L124_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L124_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L125_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L124_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L127_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L128_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L131_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L131_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L132_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L132_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L133_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L132_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L134_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L132_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L136_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L139_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L139_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L140_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L141_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L142_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L143_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L146_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L146_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L147_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L146_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L148_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L146_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L149_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L146_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L150_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L146_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L151_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L151_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L152_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L151_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L153_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L151_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Return_L154_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L151_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L156_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L151_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Return_L157_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L146_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L159_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L146_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L160_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L146_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L163_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L146_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Return_L164_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L167_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L187_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L188_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L189_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:While_L190_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:While_L190_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L191_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L191_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L193_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L198_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L199_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L200_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L201_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L202_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L204_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L204_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L205_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L204_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L208_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L208_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L209_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L208_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L211_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L204_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L213_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L204_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L214_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L214_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L215_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L214_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L216_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L214_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L217_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L204_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L221_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L221_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L222_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L204_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L223_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L223_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L224_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L223_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L226_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L204_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L227_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L204_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L228_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L228_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L230_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L228_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L231_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:For_L228_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L232_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L236_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Assign_L237_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L238_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L238_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L239_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L238_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L240_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:If_L238_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Expr_L242_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99308:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99308:Return_L244_C1"}]
#!/usr/bin/env python from ctypes import * from ctypes.util import find_library import sys import subprocess as sb # For unix the prefix 'lib' is not considered. if find_library('svm'): libsvm = CDLL(find_library('svm')) elif find_library('libsvm'): libsvm = CDLL(find_library('libsvm')) else: if sys.platform == 'win32': libsvm = CDLL('../windows/libsvm.dll') else: libsvm = CDLL(sb.Popen(['rospack', 'find', 'libsvm3'], stdout=sb.PIPE).communicate()[0].rstrip() + '/libsvm.so.2') #libsvm = CDLL('../libsvm.so.2') # Construct constants SVM_TYPE = ['C_SVC', 'NU_SVC', 'ONE_CLASS', 'EPSILON_SVR', 'NU_SVR' ] KERNEL_TYPE = ['LINEAR', 'POLY', 'RBF', 'SIGMOID', 'PRECOMPUTED'] for i, s in enumerate(SVM_TYPE): exec("%s = %d" % (s , i)) for i, s in enumerate(KERNEL_TYPE): exec("%s = %d" % (s , i)) PRINT_STRING_FUN = CFUNCTYPE(None, c_char_p) def print_null(s): return def genFields(names, types): return list(zip(names, types)) def fillprototype(f, restype, argtypes): f.restype = restype f.argtypes = argtypes class svm_node(Structure): _names = ["index", "value"] _types = [c_int, c_double] _fields_ = genFields(_names, _types) def gen_svm_nodearray(xi, feature_max=None, issparse=None): if isinstance(xi, dict): index_range = xi.keys() elif isinstance(xi, (list, tuple)): index_range = range(len(xi)) else: raise TypeError('xi should be a dictionary, list or tuple') if feature_max: assert(isinstance(feature_max, int)) index_range = filter(lambda j: j <= feature_max, index_range) if issparse: index_range = filter(lambda j:xi[j] != 0, index_range) index_range = sorted(index_range) ret = (svm_node * (len(index_range)+1))() ret[-1].index = -1 for idx, j in enumerate(index_range): ret[idx].index = j ret[idx].value = xi[j] max_idx = 0 if index_range: max_idx = index_range[-1] return ret, max_idx class svm_problem(Structure): _names = ["l", "y", "x"] _types = [c_int, POINTER(c_double), POINTER(POINTER(svm_node))] _fields_ = genFields(_names, _types) def __init__(self, y, x): if len(y) != len(x): raise ValueError("len(y) != len(x)") self.l = l = len(y) max_idx = 0 x_space = self.x_space = [] for i, xi in enumerate(x): tmp_xi, tmp_idx = gen_svm_nodearray(xi) x_space += [tmp_xi] max_idx = max(max_idx, tmp_idx) self.n = max_idx self.y = (c_double * l)() for i, yi in enumerate(y): self.y[i] = yi self.x = (POINTER(svm_node) * l)() for i, xi in enumerate(self.x_space): self.x[i] = xi class svm_parameter(Structure): _names = ["svm_type", "kernel_type", "degree", "gamma", "coef0", "cache_size", "eps", "C", "nr_weight", "weight_label", "weight", "nu", "p", "shrinking", "probability"] _types = [c_int, c_int, c_int, c_double, c_double, c_double, c_double, c_double, c_int, POINTER(c_int), POINTER(c_double), c_double, c_double, c_int, c_int] _fields_ = genFields(_names, _types) def __init__(self, options = None): if options == None: options = '' self.parse_options(options) def show(self): attrs = svm_parameter._names + self.__dict__.keys() values = map(lambda attr: getattr(self, attr), attrs) for attr, val in zip(attrs, values): print(' %s: %s' % (attr, val)) def set_to_default_values(self): self.svm_type = C_SVC; self.kernel_type = RBF self.degree = 3 self.gamma = 0 self.coef0 = 0 self.nu = 0.5 self.cache_size = 100 self.C = 1 self.eps = 0.001 self.p = 0.1 self.shrinking = 1 self.probability = 0 self.nr_weight = 0 self.weight_label = (c_int*0)() self.weight = (c_double*0)() self.cross_validation = False self.nr_fold = 0 self.print_func = None def parse_options(self, options): argv = options.split() self.set_to_default_values() self.print_func = cast(None, PRINT_STRING_FUN) weight_label = [] weight = [] i = 0 while i < len(argv): if argv[i] == "-s": i = i + 1 self.svm_type = int(argv[i]) elif argv[i] == "-t": i = i + 1 self.kernel_type = int(argv[i]) elif argv[i] == "-d": i = i + 1 self.degree = int(argv[i]) elif argv[i] == "-g": i = i + 1 self.gamma = float(argv[i]) elif argv[i] == "-r": i = i + 1 self.coef0 = float(argv[i]) elif argv[i] == "-n": i = i + 1 self.nu = float(argv[i]) elif argv[i] == "-m": i = i + 1 self.cache_size = float(argv[i]) elif argv[i] == "-c": i = i + 1 self.C = float(argv[i]) elif argv[i] == "-e": i = i + 1 self.eps = float(argv[i]) elif argv[i] == "-p": i = i + 1 self.p = float(argv[i]) elif argv[i] == "-h": i = i + 1 self.shrinking = int(argv[i]) elif argv[i] == "-b": i = i + 1 self.probability = int(argv[i]) elif argv[i] == "-q": self.print_func = PRINT_STRING_FUN(print_null) elif argv[i] == "-v": i = i + 1 self.cross_validation = 1 self.nr_fold = int(argv[i]) if self.nr_fold < 2: raise ValueError("n-fold cross validation: n must >= 2") elif argv[i].startswith("-w"): i = i + 1 self.nr_weight += 1 nr_weight = self.nr_weight weight_label += [int(argv[i-1][2:])] weight += [float(argv[i])] else: raise ValueError("Wrong options") i += 1 libsvm.svm_set_print_string_function(self.print_func) self.weight_label = (c_int*self.nr_weight)() self.weight = (c_double*self.nr_weight)() for i in range(self.nr_weight): self.weight[i] = weight[i] self.weight_label[i] = weight_label[i] class svm_model(Structure): #_names = ['param', 'nr_class', 'l', 'SV', 'sv_coef', # 'rho', 'probA', 'probB', 'label', 'nSV', 'free_sv', 'SVidx', 'nx'] #_types = [POINTER(svm_parameter), c_int, c_int, POINTER(POINTER(svm_node)), POINTER(POINTER(c_double)), # POINTER(c_double), POINTER(c_double), POINTER(c_double), POINTER(c_int), POINTER(c_int), c_int, # POINTER(c_byte), c_int] #_fields_ = genFields(_names, _types) def __init__(self): self.__createfrom__ = 'python' def __del__(self): # free memory created by C to avoid memory leak if hasattr(self, '__createfrom__') and self.__createfrom__ == 'C': libsvm.svm_free_and_destroy_model(pointer(self)) def get_svm_type(self): return libsvm.svm_get_svm_type(self) def get_nr_class(self): return libsvm.svm_get_nr_class(self) def get_svr_probability(self): return libsvm.svm_get_svr_probability(self) def get_labels(self): nr_class = self.get_nr_class() labels = (c_int * nr_class)() libsvm.svm_get_labels(self, labels) return labels[:nr_class] def is_probability_model(self): return (libsvm.svm_check_probability_model(self) == 1) #def predict(self, sample): # return libsvm.svm_predict(self, gen_svm_nodearray(sample)[0]) #def predict_values(self, sample): # nc = self.get_nr_class() # nvalues = (nc * (nc-1))/2 # dists = (c_double*nvalues)() # p = libsvm.svm_predict_values(self, gen_svm_nodearray(sample)[0], dists) # ddict = {} # ii = 0 # for i in range(nc): # for j in range(i+1, nc): # ddict[(i,j)] = dists[ii] # ii = ii+1 # nr_classifier = nc*(nc-1)//2 # dec_values = (c_double * nr_classifier)() # xi = sample # xi, idx = gen_svm_nodearray(xi) # label = libsvm.svm_predict_values(self, xi, dec_values) # values = dec_values[:nr_classifier] # print 'got label', label # return p, ddict def get_support_vectors(self, samples_len): svs = (c_int * samples_len)() libsvm.svm_get_support_vectors(self, samples_len, svs) return svs[:samples_len] def toPyModel(model_ptr): """ toPyModel(model_ptr) -> svm_model Convert a ctypes POINTER(svm_model) to a Python svm_model """ if bool(model_ptr) == False: raise ValueError("Null pointer") m = model_ptr.contents m.__createfrom__ = 'C' return m fillprototype(libsvm.svm_train, POINTER(svm_model), [POINTER(svm_problem), POINTER(svm_parameter)]) fillprototype(libsvm.svm_cross_validation, None, [POINTER(svm_problem), POINTER(svm_parameter), c_int, POINTER(c_double)]) fillprototype(libsvm.svm_save_model, c_int, [c_char_p, POINTER(svm_model)]) fillprototype(libsvm.svm_load_model, POINTER(svm_model), [c_char_p]) fillprototype(libsvm.svm_get_svm_type, c_int, [POINTER(svm_model)]) fillprototype(libsvm.svm_get_nr_class, c_int, [POINTER(svm_model)]) fillprototype(libsvm.svm_get_labels, None, [POINTER(svm_model), POINTER(c_int)]) fillprototype(libsvm.svm_get_support_vectors, None, [POINTER(svm_model), c_int, POINTER(c_int)]) fillprototype(libsvm.svm_get_svr_probability, c_double, [POINTER(svm_model)]) fillprototype(libsvm.svm_predict_values, c_double, [POINTER(svm_model), POINTER(svm_node), POINTER(c_double)]) fillprototype(libsvm.svm_predict, c_double, [POINTER(svm_model), POINTER(svm_node)]) fillprototype(libsvm.svm_predict_probability, c_double, [POINTER(svm_model), POINTER(svm_node), POINTER(c_double)]) fillprototype(libsvm.svm_free_model_content, None, [POINTER(svm_model)]) fillprototype(libsvm.svm_free_and_destroy_model, None, [POINTER(POINTER(svm_model))]) fillprototype(libsvm.svm_destroy_param, None, [POINTER(svm_parameter)]) fillprototype(libsvm.svm_check_parameter, c_char_p, [POINTER(svm_problem), POINTER(svm_parameter)]) fillprototype(libsvm.svm_check_probability_model, c_int, [POINTER(svm_model)]) fillprototype(libsvm.svm_set_print_string_function, None, [PRINT_STRING_FUN])
ajibawa-2023/Python-Code-Large/train/row_99309
206
302
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99309:ImportFrom_L3_C0", "label": "from ctypes import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0099, 0.0033, 0, 0.66, 0.0, 182, 0, 1, 0, 0, 182, 0, 0], "semantic": {"name": "ctypes", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from ctypes import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:ImportFrom_L4_C0", "label": "from ctypes.util import find_library", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0132, 0.0033, 0, 0.66, 0.0278, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "ctypes.util", "arg_names": [], "import_names": ["find_library"], "rhs_call_name": "", "annotation": ""}, "snippet": "from ctypes.util import find_library"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Import_L5_C0", "label": "sys import sys", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0166, 0.0033, 0, 0.66, 0.0556, 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_99309:Import_L6_C0", "label": "subprocess import sb", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0199, 0.0033, 0, 0.66, 0.0833, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["sb"], "rhs_call_name": "", "annotation": ""}, "snippet": "import subprocess as sb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L9_C0", "label": "if", "type": "if", "loc": [9, 17], "level": 0, "parent": null, "vector": [4, 0, 0.043, 0.0298, 0, 0.66, 0.1111, 0, 3, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if find_library('svm'):\n\tlibsvm = CDLL(find_library('svm'))\nelif find_library('libsvm'):\n\tlibsvm = CDLL(find_library('libsvm'))\nelse:\n\tif sys.platform == 'win32':\n\t\tlibsvm = CDLL('../windows/libsvm.dll')\n\telse:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L10_C1", "label": "libsvm = CDLL()", "type": "assigned_variable", "loc": [10, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L9_C0", "vector": [14, 1, 0.0331, 0.0033, 1, 0.42, 0.0, 820, 3, 1, 0, 0, 453, 10, 2], "semantic": {"name": "libsvm", "arg_names": [], "import_names": [], "rhs_call_name": "CDLL", "annotation": ""}, "snippet": "\tlibsvm = CDLL(find_library('svm'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L11_C0", "label": "if", "type": "if", "loc": [11, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L9_C0", "vector": [4, 1, 0.0464, 0.0232, 1, 0.42, 1.0, 0, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "elif find_library('libsvm'):\n\tlibsvm = CDLL(find_library('libsvm'))\nelse:\n\tif sys.platform == 'win32':\n\t\tlibsvm = CDLL('../windows/libsvm.dll')\n\telse:\n\t\tlibsvm = CDLL(sb.Popen(['rospack', 'find', 'libsvm3'], stdout=sb.PIPE).communicate()[0].rstrip() + '/libsvm.so.2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L12_C1", "label": "libsvm = CDLL()", "type": "assigned_variable", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L11_C0", "vector": [14, 2, 0.0397, 0.0033, 2, 0.04, 0.0, 820, 3, 1, 0, 0, 453, 10, 2], "semantic": {"name": "libsvm", "arg_names": [], "import_names": [], "rhs_call_name": "CDLL", "annotation": ""}, "snippet": "\tlibsvm = CDLL(find_library('libsvm'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L14_C1", "label": "if", "type": "if", "loc": [14, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L11_C0", "vector": [4, 2, 0.0513, 0.0132, 2, 0.04, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif sys.platform == 'win32':\n\t\tlibsvm = CDLL('../windows/libsvm.dll')\n\telse:\n\t\tlibsvm = CDLL(sb.Popen(['rospack', 'find', 'libsvm3'], stdout=sb.PIPE).communicate()[0].rstrip() + '/libsvm.so.2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L15_C2", "label": "libsvm = CDLL()", "type": "assigned_variable", "loc": [15, 15], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L14_C1", "vector": [14, 3, 0.0497, 0.0033, 3, 0.21, 0.0, 820, 3, 1, 0, 0, 453, 10, 1], "semantic": {"name": "libsvm", "arg_names": [], "import_names": [], "rhs_call_name": "CDLL", "annotation": ""}, "snippet": "\t\tlibsvm = CDLL('../windows/libsvm.dll')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L17_C2", "label": "libsvm = CDLL()", "type": "assigned_variable", "loc": [17, 17], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L14_C1", "vector": [14, 3, 0.0563, 0.0033, 3, 0.21, 1.0, 820, 3, 1, 0, 0, 453, 10, 4], "semantic": {"name": "libsvm", "arg_names": [], "import_names": [], "rhs_call_name": "CDLL", "annotation": ""}, "snippet": "\t\tlibsvm = CDLL(sb.Popen(['rospack', 'find', 'libsvm3'], stdout=sb.PIPE).communicate()[0].rstrip() + '/libsvm.so.2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L21_C0", "label": "SVM_TYPE =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.0695, 0.0033, 0, 0.66, 0.1389, 711, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "SVM_TYPE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SVM_TYPE = ['C_SVC', 'NU_SVC', 'ONE_CLASS', 'EPSILON_SVR', 'NU_SVR' ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L22_C0", "label": "KERNEL_TYPE =", "type": "assigned_variable", "loc": [22, 22], "level": 0, "parent": null, "vector": [14, 0, 0.0728, 0.0033, 0, 0.66, 0.1667, 395, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "KERNEL_TYPE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "KERNEL_TYPE = ['LINEAR', 'POLY', 'RBF', 'SIGMOID', 'PRECOMPUTED']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L23_C0", "label": "for i, s", "type": "for", "loc": [23, 23], "level": 0, "parent": null, "vector": [6, 0, 0.0762, 0.0033, 0, 0.66, 0.1944, 856, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i, s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for i, s in enumerate(SVM_TYPE): exec(\"%s = %d\" % (s , i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L23_C33", "label": "exec()", "type": "expression", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L23_C0", "vector": [8, 1, 0.0762, 0.0033, 1, 0.1, 0.0, 272, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exec", "arg_names": [], "import_names": [], "rhs_call_name": "exec", "annotation": ""}, "snippet": "for i, s in enumerate(SVM_TYPE): exec(\"%s = %d\" % (s , i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L24_C0", "label": "for i, s", "type": "for", "loc": [24, 24], "level": 0, "parent": null, "vector": [6, 0, 0.0795, 0.0033, 0, 0.66, 0.2222, 856, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i, s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for i, s in enumerate(KERNEL_TYPE): exec(\"%s = %d\" % (s , i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L24_C36", "label": "exec()", "type": "expression", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L24_C0", "vector": [8, 1, 0.0795, 0.0033, 1, 0.43, 0.0, 272, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exec", "arg_names": [], "import_names": [], "rhs_call_name": "exec", "annotation": ""}, "snippet": "for i, s in enumerate(KERNEL_TYPE): exec(\"%s = %d\" % (s , i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L26_C0", "label": "PRINT_STRING_FUN = CFUNCTYPE()", "type": "assigned_variable", "loc": [26, 26], "level": 0, "parent": null, "vector": [14, 0, 0.0861, 0.0033, 0, 0.66, 0.25, 200, 3, 2, 0, 0, 133, 10, 1], "semantic": {"name": "PRINT_STRING_FUN", "arg_names": [], "import_names": [], "rhs_call_name": "CFUNCTYPE", "annotation": ""}, "snippet": "PRINT_STRING_FUN = CFUNCTYPE(None, c_char_p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L27_C0", "label": "print_null", "type": "function", "loc": [27, 28], "level": 0, "parent": null, "vector": [2, 0, 0.0911, 0.0066, 0, 0.66, 0.2778, 46, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "print_null", "arg_names": ["s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def print_null(s): \n\treturn "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Return_L28_C1", "label": "return", "type": "return", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L27_C0", "vector": [13, 1, 0.0927, 0.0033, 1, 0.97, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L30_C0", "label": "genFields", "type": "function", "loc": [30, 31], "level": 0, "parent": null, "vector": [2, 0, 0.101, 0.0066, 0, 0.66, 0.3056, 986, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "genFields", "arg_names": ["names", "types"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def genFields(names, types): \n\treturn list(zip(names, types))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Return_L31_C1", "label": "return", "type": "return", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L30_C0", "vector": [13, 1, 0.1026, 0.0033, 1, 0.86, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn list(zip(names, types))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L33_C0", "label": "fillprototype", "type": "function", "loc": [33, 35], "level": 0, "parent": null, "vector": [2, 0, 0.1126, 0.0099, 0, 0.66, 0.3333, 68, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "fillprototype", "arg_names": ["f", "restype", "argtypes"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def fillprototype(f, restype, argtypes): \n\tf.restype = restype\n\tf.argtypes = argtypes"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L34_C1", "label": "f.restype =", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L33_C0", "vector": [14, 1, 0.1126, 0.0033, 1, 0.03, 0.0, 762, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f.restype", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tf.restype = restype"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L35_C1", "label": "f.argtypes =", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L33_C0", "vector": [14, 1, 0.1159, 0.0033, 1, 0.03, 1.0, 544, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f.argtypes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tf.argtypes = argtypes"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L37_C0", "label": "svm_node", "type": "class", "loc": [37, 40], "level": 0, "parent": null, "vector": [3, 0, 0.1275, 0.0132, 0, 0.66, 0.3611, 418, 0, 0, 0, 0, 183, 0, 1], "semantic": {"name": "svm_node", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class svm_node(Structure):\n\t_names = [\"index\", \"value\"]\n\t_types = [c_int, c_double]\n\t_fields_ = genFields(_names, _types)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L38_C1", "label": "_names =", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L37_C0", "vector": [14, 1, 0.1258, 0.0033, 1, 0.7, 0.0, 990, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t_names = [\"index\", \"value\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L39_C1", "label": "_types =", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L37_C0", "vector": [14, 1, 0.1291, 0.0033, 1, 0.7, 0.5, 513, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "_types", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t_types = [c_int, c_double]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L40_C1", "label": "_fields_ = genFields()", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L37_C0", "vector": [14, 1, 0.1325, 0.0033, 1, 0.7, 1.0, 283, 3, 2, 0, 0, 986, 10, 1], "semantic": {"name": "_fields_", "arg_names": [], "import_names": [], "rhs_call_name": "genFields", "annotation": ""}, "snippet": "\t_fields_ = genFields(_names, _types)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L42_C0", "label": "gen_svm_nodearray", "type": "function", "loc": [42, 65], "level": 0, "parent": null, "vector": [2, 0, 0.1772, 0.0795, 0, 0.66, 0.3889, 263, 0, 3, 1, 0, 0, 0, 13], "semantic": {"name": "gen_svm_nodearray", "arg_names": ["xi", "feature_max", "issparse"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def gen_svm_nodearray(xi, feature_max=None, issparse=None):\n\tif isinstance(xi, dict):\n\t\tindex_range = xi.keys()\n\telif isinstance(xi, (list, tuple)):\n\t\tindex_range = range(len(xi))\n\telse:\n\t\traise TypeError('xi should be a dictionary, list or tuple')\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L43_C1", "label": "if", "type": "if", "loc": [43, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L42_C0", "vector": [4, 1, 0.1507, 0.0199, 1, 0.65, 0.0, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif isinstance(xi, dict):\n\t\tindex_range = xi.keys()\n\telif isinstance(xi, (list, tuple)):\n\t\tindex_range = range(len(xi))\n\telse:\n\t\traise TypeError('xi should be a dictionary, list or tuple')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L44_C2", "label": "index_range = keys()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L43_C1", "vector": [14, 2, 0.1457, 0.0033, 2, 0.16, 0.0, 637, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "index_range", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": "\t\tindex_range = xi.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L45_C1", "label": "if", "type": "if", "loc": [45, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L43_C1", "vector": [4, 2, 0.154, 0.0132, 2, 0.16, 1.0, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\telif isinstance(xi, (list, tuple)):\n\t\tindex_range = range(len(xi))\n\telse:\n\t\traise TypeError('xi should be a dictionary, list or tuple')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L46_C2", "label": "index_range = range()", "type": "assigned_variable", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L45_C1", "vector": [14, 3, 0.1523, 0.0033, 3, 0.26, 0.0, 637, 3, 1, 0, 0, 816, 10, 2], "semantic": {"name": "index_range", "arg_names": [], "import_names": [], "rhs_call_name": "range", "annotation": ""}, "snippet": "\t\tindex_range = range(len(xi))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L50_C1", "label": "if", "type": "if", "loc": [50, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L42_C0", "vector": [4, 1, 0.1689, 0.0099, 1, 0.65, 0.1111, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif feature_max:\n\t\tassert(isinstance(feature_max, int))\n\t\tindex_range = filter(lambda j: j <= feature_max, index_range)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L52_C2", "label": "index_range = filter()", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L50_C1", "vector": [14, 2, 0.1722, 0.0033, 2, 0.11, 0.0, 637, 3, 2, 0, 0, 526, 10, 1], "semantic": {"name": "index_range", "arg_names": [], "import_names": [], "rhs_call_name": "filter", "annotation": ""}, "snippet": "\t\tindex_range = filter(lambda j: j <= feature_max, index_range)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L53_C1", "label": "if", "type": "if", "loc": [53, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L42_C0", "vector": [4, 1, 0.1772, 0.0066, 1, 0.65, 0.2222, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif issparse: \n\t\tindex_range = filter(lambda j:xi[j] != 0, index_range)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L54_C2", "label": "index_range = filter()", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L53_C1", "vector": [14, 2, 0.1788, 0.0033, 2, 0.12, 0.0, 637, 3, 2, 0, 0, 526, 10, 1], "semantic": {"name": "index_range", "arg_names": [], "import_names": [], "rhs_call_name": "filter", "annotation": ""}, "snippet": "\t\tindex_range = filter(lambda j:xi[j] != 0, index_range)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L56_C1", "label": "index_range = sorted()", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L42_C0", "vector": [14, 1, 0.1854, 0.0033, 1, 0.65, 0.3333, 637, 3, 1, 0, 0, 134, 10, 1], "semantic": {"name": "index_range", "arg_names": [], "import_names": [], "rhs_call_name": "sorted", "annotation": ""}, "snippet": "\tindex_range = sorted(index_range)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L57_C1", "label": "ret =", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L42_C0", "vector": [14, 1, 0.1887, 0.0033, 1, 0.65, 0.4444, 501, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tret = (svm_node * (len(index_range)+1))()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L58_C1", "label": "ret[-1].index =", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L42_C0", "vector": [14, 1, 0.1921, 0.0033, 1, 0.65, 0.5556, 2, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ret[-1].index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tret[-1].index = -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L59_C1", "label": "for idx, j", "type": "for", "loc": [59, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L42_C0", "vector": [6, 1, 0.1987, 0.0099, 1, 0.65, 0.6667, 754, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "idx, j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor idx, j in enumerate(index_range):\n\t\tret[idx].index = j\n\t\tret[idx].value = xi[j]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L60_C2", "label": "ret[idx].index =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L59_C1", "vector": [14, 2, 0.1987, 0.0033, 2, 0.88, 0.0, 421, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ret[idx].index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tret[idx].index = j"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L61_C2", "label": "ret[idx].value =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L59_C1", "vector": [14, 2, 0.202, 0.0033, 2, 0.88, 1.0, 323, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ret[idx].value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tret[idx].value = xi[j]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L62_C1", "label": "max_idx =", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L42_C0", "vector": [14, 1, 0.2053, 0.0033, 1, 0.65, 0.7778, 910, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "max_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tmax_idx = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L63_C1", "label": "if", "type": "if", "loc": [63, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L42_C0", "vector": [4, 1, 0.2103, 0.0066, 1, 0.65, 0.8889, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif index_range: \n\t\tmax_idx = index_range[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L64_C2", "label": "max_idx =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L63_C1", "vector": [14, 2, 0.2119, 0.0033, 2, 0.95, 0.0, 910, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tmax_idx = index_range[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Return_L65_C1", "label": "return", "type": "return", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L42_C0", "vector": [13, 1, 0.2152, 0.0033, 1, 0.65, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn ret, max_idx"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L67_C0", "label": "svm_problem", "type": "class", "loc": [67, 89], "level": 0, "parent": null, "vector": [3, 0, 0.2583, 0.0762, 0, 0.66, 0.4167, 14, 0, 1, 0, 0, 183, 0, 16], "semantic": {"name": "svm_problem", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class svm_problem(Structure):\n\t_names = [\"l\", \"y\", \"x\"]\n\t_types = [c_int, POINTER(c_double), POINTER(POINTER(svm_node))]\n\t_fields_ = genFields(_names, _types)\n\n\tdef __init__(self, y, x):\n\t\tif len(y) != len(x):\n\t\t\traise ValueError(\"len(y) != len(x)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L68_C1", "label": "_names =", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L67_C0", "vector": [14, 1, 0.2252, 0.0033, 1, 0.69, 0.0, 990, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t_names = [\"l\", \"y\", \"x\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L69_C1", "label": "_types =", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L67_C0", "vector": [14, 1, 0.2285, 0.0033, 1, 0.69, 0.3333, 513, 0, 0, 0, 0, 0, 5, 3], "semantic": {"name": "_types", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t_types = [c_int, POINTER(c_double), POINTER(POINTER(svm_node))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L70_C1", "label": "_fields_ = genFields()", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L67_C0", "vector": [14, 1, 0.2318, 0.0033, 1, 0.69, 0.6667, 283, 3, 2, 0, 0, 986, 10, 1], "semantic": {"name": "_fields_", "arg_names": [], "import_names": [], "rhs_call_name": "genFields", "annotation": ""}, "snippet": "\t_fields_ = genFields(_names, _types)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L72_C1", "label": "__init__", "type": "function", "loc": [72, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L67_C0", "vector": [2, 1, 0.2666, 0.0596, 1, 0.69, 1.0, 555, 0, 3, 0, 0, 0, 0, 12], "semantic": {"name": "__init__", "arg_names": ["self", "y", "x"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, y, x):\n\t\tif len(y) != len(x):\n\t\t\traise ValueError(\"len(y) != len(x)\")\n\t\tself.l = l = len(y)\n\n\t\tmax_idx = 0\n\t\tx_space = self.x_space = []\n\t\tfor i, xi in enumerate(x):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L73_C2", "label": "if", "type": "if", "loc": [73, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L72_C1", "vector": [4, 2, 0.2434, 0.0066, 2, 0.22, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif len(y) != len(x):\n\t\t\traise ValueError(\"len(y) != len(x)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L75_C2", "label": "self.l = len()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L72_C1", "vector": [14, 2, 0.2483, 0.0033, 2, 0.22, 0.1111, 166, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "self.l", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": "\t\tself.l = l = len(y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L77_C2", "label": "max_idx =", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L72_C1", "vector": [14, 2, 0.255, 0.0033, 2, 0.22, 0.2222, 910, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "max_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tmax_idx = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L78_C2", "label": "x_space =", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L72_C1", "vector": [14, 2, 0.2583, 0.0033, 2, 0.22, 0.3333, 614, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "x_space", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tx_space = self.x_space = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L79_C2", "label": "for i, xi", "type": "for", "loc": [79, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L72_C1", "vector": [6, 2, 0.2666, 0.0132, 2, 0.22, 0.4444, 42, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i, xi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i, xi in enumerate(x):\n\t\t\ttmp_xi, tmp_idx = gen_svm_nodearray(xi)\n\t\t\tx_space += [tmp_xi]\n\t\t\tmax_idx = max(max_idx, tmp_idx)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L80_C3", "label": "tmp_xi, tmp_idx = gen_svm_nodearray()", "type": "assigned_variable", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L79_C2", "vector": [14, 3, 0.2649, 0.0033, 3, 0.7, 0.0, 583, 3, 1, 0, 0, 263, 10, 1], "semantic": {"name": "tmp_xi, tmp_idx", "arg_names": [], "import_names": [], "rhs_call_name": "gen_svm_nodearray", "annotation": ""}, "snippet": "\t\t\ttmp_xi, tmp_idx = gen_svm_nodearray(xi)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L82_C3", "label": "max_idx = max()", "type": "assigned_variable", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L79_C2", "vector": [14, 3, 0.2715, 0.0033, 3, 0.7, 1.0, 910, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "max_idx", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": "\t\t\tmax_idx = max(max_idx, tmp_idx)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L83_C2", "label": "self.n =", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L72_C1", "vector": [14, 2, 0.2748, 0.0033, 2, 0.22, 0.5556, 172, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.n = max_idx"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L85_C2", "label": "self.y =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L72_C1", "vector": [14, 2, 0.2815, 0.0033, 2, 0.22, 0.6667, 276, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "self.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.y = (c_double * l)()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L86_C2", "label": "for i, yi", "type": "for", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L72_C1", "vector": [6, 2, 0.2848, 0.0033, 2, 0.22, 0.7778, 769, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "i, yi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i, yi in enumerate(y): self.y[i] = yi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L86_C29", "label": "assign", "type": "assigned_variable", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L86_C2", "vector": [14, 3, 0.2848, 0.0033, 3, 0.76, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i, yi in enumerate(y): self.y[i] = yi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L88_C2", "label": "self.x =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L72_C1", "vector": [14, 2, 0.2914, 0.0033, 2, 0.22, 0.8889, 236, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "self.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.x = (POINTER(svm_node) * l)() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L89_C2", "label": "for i, xi", "type": "for", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L72_C1", "vector": [6, 2, 0.2947, 0.0033, 2, 0.22, 1.0, 42, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "i, xi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i, xi in enumerate(self.x_space): self.x[i] = xi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L89_C40", "label": "assign", "type": "assigned_variable", "loc": [89, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L89_C2", "vector": [14, 3, 0.2947, 0.0033, 3, 0.62, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i, xi in enumerate(self.x_space): self.x[i] = xi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L91_C0", "label": "svm_parameter", "type": "class", "loc": [91, 199], "level": 0, "parent": null, "vector": [3, 0, 0.4801, 0.3609, 0, 0.66, 0.4444, 987, 0, 4, 0, 0, 183, 0, 38], "semantic": {"name": "svm_parameter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class svm_parameter(Structure):\n\t_names = [\"svm_type\", \"kernel_type\", \"degree\", \"gamma\", \"coef0\",\n\t\t\t\"cache_size\", \"eps\", \"C\", \"nr_weight\", \"weight_label\", \"weight\", \n\t\t\t\"nu\", \"p\", \"shrinking\", \"probability\"]\n\t_types = [c_int, c_int, c_int, c_double, c_double, \n\t\t\tc_double, c_double, c_double, c_int, POINTER(c_int), POINTER(c_double),\n\t\t\tc_double, c_double, c_int, c_int]\n\t_fields_ = genFields(_names, _types)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L92_C1", "label": "_names =", "type": "assigned_variable", "loc": [92, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L91_C0", "vector": [14, 1, 0.3079, 0.0099, 1, 0.69, 0.0, 990, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t_names = [\"svm_type\", \"kernel_type\", \"degree\", \"gamma\", \"coef0\",\n\t\t\t\"cache_size\", \"eps\", \"C\", \"nr_weight\", \"weight_label\", \"weight\", \n\t\t\t\"nu\", \"p\", \"shrinking\", \"probability\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L95_C1", "label": "_types =", "type": "assigned_variable", "loc": [95, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L91_C0", "vector": [14, 1, 0.3179, 0.0099, 1, 0.69, 0.1667, 513, 0, 0, 0, 0, 0, 5, 2], "semantic": {"name": "_types", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t_types = [c_int, c_int, c_int, c_double, c_double, \n\t\t\tc_double, c_double, c_double, c_int, POINTER(c_int), POINTER(c_double),\n\t\t\tc_double, c_double, c_int, c_int]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L98_C1", "label": "_fields_ = genFields()", "type": "assigned_variable", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L91_C0", "vector": [14, 1, 0.3245, 0.0033, 1, 0.69, 0.3333, 283, 3, 2, 0, 0, 986, 10, 1], "semantic": {"name": "_fields_", "arg_names": [], "import_names": [], "rhs_call_name": "genFields", "annotation": ""}, "snippet": "\t_fields_ = genFields(_names, _types)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L100_C1", "label": "__init__", "type": "function", "loc": [100, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L91_C0", "vector": [2, 1, 0.3361, 0.0132, 1, 0.69, 0.5, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "options"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, options = None):\n\t\tif options == None:\n\t\t\toptions = ''\n\t\tself.parse_options(options)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L101_C2", "label": "if", "type": "if", "loc": [101, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L100_C1", "vector": [4, 2, 0.3361, 0.0066, 2, 0.83, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif options == None:\n\t\t\toptions = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L102_C3", "label": "options =", "type": "assigned_variable", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L101_C2", "vector": [14, 3, 0.3377, 0.0033, 3, 0.32, 0.0, 707, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "options", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\toptions = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L103_C2", "label": "parse_options()", "type": "expression", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L100_C1", "vector": [8, 2, 0.3411, 0.0033, 2, 0.83, 1.0, 634, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "parse_options", "arg_names": [], "import_names": [], "rhs_call_name": "parse_options", "annotation": ""}, "snippet": "\t\tself.parse_options(options)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L105_C1", "label": "show", "type": "function", "loc": [105, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L91_C0", "vector": [2, 1, 0.3543, 0.0166, 1, 0.69, 0.6667, 497, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "show", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef show(self):\n\t\tattrs = svm_parameter._names + self.__dict__.keys()\n\t\tvalues = map(lambda attr: getattr(self, attr), attrs) \n\t\tfor attr, val in zip(attrs, values):\n\t\t\tprint(' %s: %s' % (attr, val))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L106_C2", "label": "attrs =", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L105_C1", "vector": [14, 2, 0.351, 0.0033, 2, 0.78, 0.0, 251, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "attrs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tattrs = svm_parameter._names + self.__dict__.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L107_C2", "label": "values = map()", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L105_C1", "vector": [14, 2, 0.3543, 0.0033, 2, 0.78, 0.5, 721, 3, 2, 0, 0, 53, 10, 2], "semantic": {"name": "values", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": "\t\tvalues = map(lambda attr: getattr(self, attr), attrs) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L108_C2", "label": "for attr, val", "type": "for", "loc": [108, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L105_C1", "vector": [6, 2, 0.3593, 0.0066, 2, 0.78, 1.0, 722, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "attr, val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor attr, val in zip(attrs, values):\n\t\t\tprint(' %s: %s' % (attr, val))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L109_C3", "label": "print()", "type": "expression", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L108_C2", "vector": [8, 3, 0.3609, 0.0033, 3, 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": "\t\t\tprint(' %s: %s' % (attr, val))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "label": "set_to_default_values", "type": "function", "loc": [111, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L91_C0", "vector": [2, 1, 0.3974, 0.0629, 1, 0.69, 0.8333, 507, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_to_default_values", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef set_to_default_values(self):\n\t\tself.svm_type = C_SVC;\n\t\tself.kernel_type = RBF\n\t\tself.degree = 3\n\t\tself.gamma = 0\n\t\tself.coef0 = 0\n\t\tself.nu = 0.5\n\t\tself.cache_size = 100"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L112_C2", "label": "self.svm_type =", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "vector": [14, 2, 0.3709, 0.0033, 2, 0.06, 0.0, 423, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.svm_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.svm_type = C_SVC;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L113_C2", "label": "self.kernel_type =", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "vector": [14, 2, 0.3742, 0.0033, 2, 0.06, 0.0588, 480, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.kernel_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.kernel_type = RBF"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L114_C2", "label": "self.degree =", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "vector": [14, 2, 0.3775, 0.0033, 2, 0.06, 0.1176, 434, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.degree", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.degree = 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L115_C2", "label": "self.gamma =", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "vector": [14, 2, 0.3808, 0.0033, 2, 0.06, 0.1765, 463, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.gamma", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.gamma = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L116_C2", "label": "self.coef0 =", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "vector": [14, 2, 0.3841, 0.0033, 2, 0.06, 0.2353, 938, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.coef0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.coef0 = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L117_C2", "label": "self.nu =", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "vector": [14, 2, 0.3874, 0.0033, 2, 0.06, 0.2941, 371, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.nu", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.nu = 0.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L118_C2", "label": "self.cache_size =", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "vector": [14, 2, 0.3907, 0.0033, 2, 0.06, 0.3529, 854, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.cache_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.cache_size = 100"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L119_C2", "label": "self.C =", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "vector": [14, 2, 0.394, 0.0033, 2, 0.06, 0.4118, 970, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.C", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.C = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L120_C2", "label": "self.eps =", "type": "assigned_variable", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "vector": [14, 2, 0.3974, 0.0033, 2, 0.06, 0.4706, 315, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.eps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.eps = 0.001"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L121_C2", "label": "self.p =", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "vector": [14, 2, 0.4007, 0.0033, 2, 0.06, 0.5294, 657, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.p = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L122_C2", "label": "self.shrinking =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "vector": [14, 2, 0.404, 0.0033, 2, 0.06, 0.5882, 688, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.shrinking", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.shrinking = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L123_C2", "label": "self.probability =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "vector": [14, 2, 0.4073, 0.0033, 2, 0.06, 0.6471, 151, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.probability", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.probability = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L124_C2", "label": "self.nr_weight =", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "vector": [14, 2, 0.4106, 0.0033, 2, 0.06, 0.7059, 224, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.nr_weight", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.nr_weight = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L125_C2", "label": "self.weight_label =", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "vector": [14, 2, 0.4139, 0.0033, 2, 0.06, 0.7647, 472, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "self.weight_label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.weight_label = (c_int*0)()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L126_C2", "label": "self.weight =", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "vector": [14, 2, 0.4172, 0.0033, 2, 0.06, 0.8235, 496, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "self.weight", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.weight = (c_double*0)()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L127_C2", "label": "self.cross_validation =", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "vector": [14, 2, 0.4205, 0.0033, 2, 0.06, 0.8824, 711, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.cross_validation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.cross_validation = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L128_C2", "label": "self.nr_fold =", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "vector": [14, 2, 0.4238, 0.0033, 2, 0.06, 0.9412, 284, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.nr_fold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.nr_fold = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L129_C2", "label": "self.print_func =", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "vector": [14, 2, 0.4272, 0.0033, 2, 0.06, 1.0, 357, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.print_func", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.print_func = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L131_C1", "label": "parse_options", "type": "function", "loc": [131, 199], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L91_C0", "vector": [2, 1, 0.5464, 0.2285, 1, 0.69, 1.0, 634, 0, 2, 0, 0, 0, 0, 27], "semantic": {"name": "parse_options", "arg_names": ["self", "options"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef parse_options(self, options):\n\t\targv = options.split()\n\t\tself.set_to_default_values()\n\t\tself.print_func = cast(None, PRINT_STRING_FUN)\n\t\tweight_label = []\n\t\tweight = []\n\n\t\ti = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L132_C2", "label": "argv = split()", "type": "assigned_variable", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L131_C1", "vector": [14, 2, 0.4371, 0.0033, 2, 0.81, 0.0, 612, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "argv", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\targv = options.split()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L133_C2", "label": "set_to_default_values()", "type": "expression", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L131_C1", "vector": [8, 2, 0.4404, 0.0033, 2, 0.81, 0.1, 507, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_to_default_values", "arg_names": [], "import_names": [], "rhs_call_name": "set_to_default_values", "annotation": ""}, "snippet": "\t\tself.set_to_default_values()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L134_C2", "label": "self.print_func = cast()", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L131_C1", "vector": [14, 2, 0.4437, 0.0033, 2, 0.81, 0.2, 357, 3, 2, 0, 0, 590, 10, 1], "semantic": {"name": "self.print_func", "arg_names": [], "import_names": [], "rhs_call_name": "cast", "annotation": ""}, "snippet": "\t\tself.print_func = cast(None, PRINT_STRING_FUN)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L135_C2", "label": "weight_label =", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L131_C1", "vector": [14, 2, 0.447, 0.0033, 2, 0.81, 0.3, 922, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "weight_label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tweight_label = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L136_C2", "label": "weight =", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L131_C1", "vector": [14, 2, 0.4503, 0.0033, 2, 0.81, 0.4, 205, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "weight", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tweight = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L138_C2", "label": "i =", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L131_C1", "vector": [14, 2, 0.457, 0.0033, 2, 0.81, 0.5, 826, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\ti = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:While_L139_C2", "label": "while", "type": "while", "loc": [139, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L131_C1", "vector": [5, 2, 0.548, 0.1788, 2, 0.81, 0.6, 0, 0, 0, 0, 0, 0, 0, 20], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\twhile i < len(argv):\n\t\t\tif argv[i] == \"-s\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.svm_type = int(argv[i])\n\t\t\telif argv[i] == \"-t\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.kernel_type = int(argv[i])\n\t\t\telif argv[i] == \"-d\":"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L140_C3", "label": "if", "type": "if", "loc": [140, 191], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:While_L139_C2", "vector": [4, 3, 0.548, 0.1722, 3, 0.06, 0.0, 0, 0, 0, 0, 0, 0, 0, 19], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif argv[i] == \"-s\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.svm_type = int(argv[i])\n\t\t\telif argv[i] == \"-t\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.kernel_type = int(argv[i])\n\t\t\telif argv[i] == \"-d\":\n\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L141_C4", "label": "i =", "type": "assigned_variable", "loc": [141, 141], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L140_C3", "vector": [14, 4, 0.4669, 0.0033, 4, 0.74, 0.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L142_C4", "label": "self.svm_type = int()", "type": "assigned_variable", "loc": [142, 142], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L140_C3", "vector": [14, 4, 0.4702, 0.0033, 4, 0.74, 0.5, 423, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "self.svm_type", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\t\tself.svm_type = int(argv[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L143_C3", "label": "if", "type": "if", "loc": [143, 191], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L140_C3", "vector": [4, 4, 0.553, 0.1623, 4, 0.74, 1.0, 0, 0, 0, 0, 0, 0, 0, 18], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\telif argv[i] == \"-t\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.kernel_type = int(argv[i])\n\t\t\telif argv[i] == \"-d\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.degree = int(argv[i])\n\t\t\telif argv[i] == \"-g\":\n\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L144_C4", "label": "i =", "type": "assigned_variable", "loc": [144, 144], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L143_C3", "vector": [14, 5, 0.4768, 0.0033, 5, 0.46, 0.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L145_C4", "label": "self.kernel_type = int()", "type": "assigned_variable", "loc": [145, 145], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L143_C3", "vector": [14, 5, 0.4801, 0.0033, 5, 0.46, 0.5, 480, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "self.kernel_type", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\t\tself.kernel_type = int(argv[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L146_C3", "label": "if", "type": "if", "loc": [146, 191], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L143_C3", "vector": [4, 5, 0.5579, 0.1523, 5, 0.46, 1.0, 0, 0, 0, 0, 0, 0, 0, 17], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\telif argv[i] == \"-d\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.degree = int(argv[i])\n\t\t\telif argv[i] == \"-g\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.gamma = float(argv[i])\n\t\t\telif argv[i] == \"-r\":\n\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L147_C4", "label": "i =", "type": "assigned_variable", "loc": [147, 147], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L146_C3", "vector": [14, 6, 0.4868, 0.0033, 6, 0.54, 0.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L148_C4", "label": "self.degree = int()", "type": "assigned_variable", "loc": [148, 148], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L146_C3", "vector": [14, 6, 0.4901, 0.0033, 6, 0.54, 0.5, 434, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "self.degree", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\t\tself.degree = int(argv[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L149_C3", "label": "if", "type": "if", "loc": [149, 191], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L146_C3", "vector": [4, 6, 0.5629, 0.1424, 6, 0.54, 1.0, 0, 0, 0, 0, 0, 0, 0, 16], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\telif argv[i] == \"-g\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.gamma = float(argv[i])\n\t\t\telif argv[i] == \"-r\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.coef0 = float(argv[i])\n\t\t\telif argv[i] == \"-n\":\n\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L150_C4", "label": "i =", "type": "assigned_variable", "loc": [150, 150], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L149_C3", "vector": [14, 7, 0.4967, 0.0033, 7, 0.43, 0.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L151_C4", "label": "self.gamma = float()", "type": "assigned_variable", "loc": [151, 151], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L149_C3", "vector": [14, 7, 0.5, 0.0033, 7, 0.43, 0.5, 463, 3, 1, 0, 0, 639, 10, 1], "semantic": {"name": "self.gamma", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": "\t\t\t\tself.gamma = float(argv[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L152_C3", "label": "if", "type": "if", "loc": [152, 191], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L149_C3", "vector": [4, 7, 0.5679, 0.1325, 7, 0.43, 1.0, 0, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\telif argv[i] == \"-r\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.coef0 = float(argv[i])\n\t\t\telif argv[i] == \"-n\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.nu = float(argv[i])\n\t\t\telif argv[i] == \"-m\":\n\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L153_C4", "label": "i =", "type": "assigned_variable", "loc": [153, 153], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L152_C3", "vector": [14, 8, 0.5066, 0.0033, 8, 0.5, 0.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L154_C4", "label": "self.coef0 = float()", "type": "assigned_variable", "loc": [154, 154], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L152_C3", "vector": [14, 8, 0.5099, 0.0033, 8, 0.5, 0.5, 938, 3, 1, 0, 0, 639, 10, 1], "semantic": {"name": "self.coef0", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": "\t\t\t\tself.coef0 = float(argv[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L155_C3", "label": "if", "type": "if", "loc": [155, 191], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L152_C3", "vector": [4, 8, 0.5728, 0.1225, 8, 0.5, 1.0, 0, 0, 0, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\telif argv[i] == \"-n\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.nu = float(argv[i])\n\t\t\telif argv[i] == \"-m\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.cache_size = float(argv[i])\n\t\t\telif argv[i] == \"-c\":\n\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L156_C4", "label": "i =", "type": "assigned_variable", "loc": [156, 156], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L155_C3", "vector": [14, 9, 0.5166, 0.0033, 9, 0.47, 0.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L157_C4", "label": "self.nu = float()", "type": "assigned_variable", "loc": [157, 157], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L155_C3", "vector": [14, 9, 0.5199, 0.0033, 9, 0.47, 0.5, 371, 3, 1, 0, 0, 639, 10, 1], "semantic": {"name": "self.nu", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": "\t\t\t\tself.nu = float(argv[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L158_C3", "label": "if", "type": "if", "loc": [158, 191], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L155_C3", "vector": [4, 9, 0.5778, 0.1126, 9, 0.47, 1.0, 0, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\telif argv[i] == \"-m\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.cache_size = float(argv[i])\n\t\t\telif argv[i] == \"-c\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.C = float(argv[i])\n\t\t\telif argv[i] == \"-e\":\n\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L159_C4", "label": "i =", "type": "assigned_variable", "loc": [159, 159], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L158_C3", "vector": [14, 10, 0.5265, 0.0033, 10, 0.22, 0.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L160_C4", "label": "self.cache_size = float()", "type": "assigned_variable", "loc": [160, 160], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L158_C3", "vector": [14, 10, 0.5298, 0.0033, 10, 0.22, 0.5, 854, 3, 1, 0, 0, 639, 10, 1], "semantic": {"name": "self.cache_size", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": "\t\t\t\tself.cache_size = float(argv[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L161_C3", "label": "if", "type": "if", "loc": [161, 191], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L158_C3", "vector": [4, 10, 0.5828, 0.1026, 10, 0.22, 1.0, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\telif argv[i] == \"-c\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.C = float(argv[i])\n\t\t\telif argv[i] == \"-e\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.eps = float(argv[i])\n\t\t\telif argv[i] == \"-p\":\n\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L162_C4", "label": "i =", "type": "assigned_variable", "loc": [162, 162], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L161_C3", "vector": [14, 11, 0.5364, 0.0033, 11, 0.63, 0.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L163_C4", "label": "self.C = float()", "type": "assigned_variable", "loc": [163, 163], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L161_C3", "vector": [14, 11, 0.5397, 0.0033, 11, 0.63, 0.5, 970, 3, 1, 0, 0, 639, 10, 1], "semantic": {"name": "self.C", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": "\t\t\t\tself.C = float(argv[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L164_C3", "label": "if", "type": "if", "loc": [164, 191], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L161_C3", "vector": [4, 11, 0.5877, 0.0927, 11, 0.63, 1.0, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\telif argv[i] == \"-e\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.eps = float(argv[i])\n\t\t\telif argv[i] == \"-p\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.p = float(argv[i])\n\t\t\telif argv[i] == \"-h\":\n\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L165_C4", "label": "i =", "type": "assigned_variable", "loc": [165, 165], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L164_C3", "vector": [14, 12, 0.5464, 0.0033, 12, 0.11, 0.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L166_C4", "label": "self.eps = float()", "type": "assigned_variable", "loc": [166, 166], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L164_C3", "vector": [14, 12, 0.5497, 0.0033, 12, 0.11, 0.5, 315, 3, 1, 0, 0, 639, 10, 1], "semantic": {"name": "self.eps", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": "\t\t\t\tself.eps = float(argv[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L167_C3", "label": "if", "type": "if", "loc": [167, 191], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L164_C3", "vector": [4, 12, 0.5927, 0.0828, 12, 0.11, 1.0, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\telif argv[i] == \"-p\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.p = float(argv[i])\n\t\t\telif argv[i] == \"-h\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.shrinking = int(argv[i])\n\t\t\telif argv[i] == \"-b\":\n\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L168_C4", "label": "i =", "type": "assigned_variable", "loc": [168, 168], "level": 13, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L167_C3", "vector": [14, 13, 0.5563, 0.0033, 13, 0.36, 0.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L169_C4", "label": "self.p = float()", "type": "assigned_variable", "loc": [169, 169], "level": 13, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L167_C3", "vector": [14, 13, 0.5596, 0.0033, 13, 0.36, 0.5, 657, 3, 1, 0, 0, 639, 10, 1], "semantic": {"name": "self.p", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": "\t\t\t\tself.p = float(argv[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L170_C3", "label": "if", "type": "if", "loc": [170, 191], "level": 13, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L167_C3", "vector": [4, 13, 0.5977, 0.0728, 13, 0.36, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\telif argv[i] == \"-h\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.shrinking = int(argv[i])\n\t\t\telif argv[i] == \"-b\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.probability = int(argv[i])\n\t\t\telif argv[i] == \"-q\":\n\t\t\t\tself.print_func = PRINT_STRING_FUN(print_null)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L171_C4", "label": "i =", "type": "assigned_variable", "loc": [171, 171], "level": 14, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L170_C3", "vector": [14, 14, 0.5662, 0.0033, 14, 0.92, 0.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L172_C4", "label": "self.shrinking = int()", "type": "assigned_variable", "loc": [172, 172], "level": 14, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L170_C3", "vector": [14, 14, 0.5695, 0.0033, 14, 0.92, 0.5, 688, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "self.shrinking", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\t\tself.shrinking = int(argv[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L173_C3", "label": "if", "type": "if", "loc": [173, 191], "level": 14, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L170_C3", "vector": [4, 14, 0.6026, 0.0629, 14, 0.92, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\telif argv[i] == \"-b\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.probability = int(argv[i])\n\t\t\telif argv[i] == \"-q\":\n\t\t\t\tself.print_func = PRINT_STRING_FUN(print_null)\n\t\t\telif argv[i] == \"-v\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.cross_validation = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L174_C4", "label": "i =", "type": "assigned_variable", "loc": [174, 174], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L173_C3", "vector": [14, 15, 0.5762, 0.0033, 15, 0.83, 0.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L175_C4", "label": "self.probability = int()", "type": "assigned_variable", "loc": [175, 175], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L173_C3", "vector": [14, 15, 0.5795, 0.0033, 15, 0.83, 0.5, 151, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "self.probability", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\t\tself.probability = int(argv[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L176_C3", "label": "if", "type": "if", "loc": [176, 191], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L173_C3", "vector": [4, 15, 0.6076, 0.053, 15, 0.83, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\telif argv[i] == \"-q\":\n\t\t\t\tself.print_func = PRINT_STRING_FUN(print_null)\n\t\t\telif argv[i] == \"-v\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.cross_validation = 1\n\t\t\t\tself.nr_fold = int(argv[i])\n\t\t\t\tif self.nr_fold < 2:\n\t\t\t\t\traise ValueError(\"n-fold cross validation: n must >= 2\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L177_C4", "label": "self.print_func = PRINT_STRING_FUN()", "type": "assigned_variable", "loc": [177, 177], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L176_C3", "vector": [14, 16, 0.5861, 0.0033, 16, 0.35, 0.0, 357, 3, 1, 0, 0, 200, 10, 1], "semantic": {"name": "self.print_func", "arg_names": [], "import_names": [], "rhs_call_name": "PRINT_STRING_FUN", "annotation": ""}, "snippet": "\t\t\t\tself.print_func = PRINT_STRING_FUN(print_null)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L178_C3", "label": "if", "type": "if", "loc": [178, 191], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L176_C3", "vector": [4, 16, 0.6109, 0.0464, 16, 0.35, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\telif argv[i] == \"-v\":\n\t\t\t\ti = i + 1\n\t\t\t\tself.cross_validation = 1\n\t\t\t\tself.nr_fold = int(argv[i])\n\t\t\t\tif self.nr_fold < 2:\n\t\t\t\t\traise ValueError(\"n-fold cross validation: n must >= 2\")\n\t\t\telif argv[i].startswith(\"-w\"):\n\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L179_C4", "label": "i =", "type": "assigned_variable", "loc": [179, 179], "level": 17, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L178_C3", "vector": [14, 17, 0.5927, 0.0033, 17, 0.11, 0.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L180_C4", "label": "self.cross_validation =", "type": "assigned_variable", "loc": [180, 180], "level": 17, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L178_C3", "vector": [14, 17, 0.596, 0.0033, 17, 0.11, 0.25, 711, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.cross_validation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tself.cross_validation = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L181_C4", "label": "self.nr_fold = int()", "type": "assigned_variable", "loc": [181, 181], "level": 17, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L178_C3", "vector": [14, 17, 0.5993, 0.0033, 17, 0.11, 0.5, 284, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "self.nr_fold", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\t\tself.nr_fold = int(argv[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L182_C4", "label": "if", "type": "if", "loc": [182, 183], "level": 17, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L178_C3", "vector": [4, 17, 0.6043, 0.0066, 17, 0.11, 0.75, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif self.nr_fold < 2:\n\t\t\t\t\traise ValueError(\"n-fold cross validation: n must >= 2\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L184_C3", "label": "if", "type": "if", "loc": [184, 191], "level": 17, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L178_C3", "vector": [4, 17, 0.6209, 0.0265, 17, 0.11, 1.0, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\telif argv[i].startswith(\"-w\"):\n\t\t\t\ti = i + 1\n\t\t\t\tself.nr_weight += 1\n\t\t\t\tnr_weight = self.nr_weight\n\t\t\t\tweight_label += [int(argv[i-1][2:])]\n\t\t\t\tweight += [float(argv[i])]\n\t\t\telse:\n\t\t\t\traise ValueError(\"Wrong options\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L185_C4", "label": "i =", "type": "assigned_variable", "loc": [185, 185], "level": 18, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L184_C3", "vector": [14, 18, 0.6126, 0.0033, 18, 0.67, 0.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L187_C4", "label": "nr_weight =", "type": "assigned_variable", "loc": [187, 187], "level": 18, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L184_C3", "vector": [14, 18, 0.6192, 0.0033, 18, 0.67, 1.0, 817, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "nr_weight", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tnr_weight = self.nr_weight"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L194_C2", "label": "svm_set_print_string_function()", "type": "expression", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L131_C1", "vector": [8, 2, 0.6424, 0.0033, 2, 0.81, 0.7, 127, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "svm_set_print_string_function", "arg_names": [], "import_names": [], "rhs_call_name": "svm_set_print_string_function", "annotation": ""}, "snippet": "\t\tlibsvm.svm_set_print_string_function(self.print_func)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L195_C2", "label": "self.weight_label =", "type": "assigned_variable", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L131_C1", "vector": [14, 2, 0.6457, 0.0033, 2, 0.81, 0.8, 472, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "self.weight_label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.weight_label = (c_int*self.nr_weight)()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L196_C2", "label": "self.weight =", "type": "assigned_variable", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L131_C1", "vector": [14, 2, 0.649, 0.0033, 2, 0.81, 0.9, 496, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "self.weight", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.weight = (c_double*self.nr_weight)()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L197_C2", "label": "for i", "type": "for", "loc": [197, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L131_C1", "vector": [6, 2, 0.6556, 0.0099, 2, 0.81, 1.0, 826, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in range(self.nr_weight): \n\t\t\tself.weight[i] = weight[i]\n\t\t\tself.weight_label[i] = weight_label[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L198_C3", "label": "assign", "type": "assigned_variable", "loc": [198, 198], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L197_C2", "vector": [14, 3, 0.6556, 0.0033, 3, 0.19, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.weight[i] = weight[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L199_C3", "label": "assign", "type": "assigned_variable", "loc": [199, 199], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L197_C2", "vector": [14, 3, 0.6589, 0.0033, 3, 0.19, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.weight_label[i] = weight_label[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L201_C0", "label": "svm_model", "type": "class", "loc": [201, 263], "level": 0, "parent": null, "vector": [3, 0, 0.7682, 0.2086, 0, 0.66, 0.4722, 871, 0, 8, 0, 0, 183, 0, 12], "semantic": {"name": "svm_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class svm_model(Structure):\n\t#_names = ['param', 'nr_class', 'l', 'SV', 'sv_coef', \n # 'rho', 'probA', 'probB', 'label', 'nSV', 'free_sv', 'SVidx', 'nx']\n\t#_types = [POINTER(svm_parameter), c_int, c_int, POINTER(POINTER(svm_node)), POINTER(POINTER(c_double)), \n # POINTER(c_double), POINTER(c_double), POINTER(c_double), POINTER(c_int), POINTER(c_int), c_int, \n # POINTER(c_byte), c_int]\n\t#_fields_ = genFields(_names, _types)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L209_C1", "label": "__init__", "type": "function", "loc": [209, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L201_C0", "vector": [2, 1, 0.6937, 0.0066, 1, 0.9, 0.0, 555, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tself.__createfrom__ = 'python'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L210_C2", "label": "self.__createfrom__ =", "type": "assigned_variable", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L209_C1", "vector": [14, 2, 0.6954, 0.0033, 2, 0.09, 0.0, 46, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.__createfrom__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.__createfrom__ = 'python'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L212_C1", "label": "__del__", "type": "function", "loc": [212, 215], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L201_C0", "vector": [2, 1, 0.707, 0.0132, 1, 0.9, 0.1429, 258, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "__del__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __del__(self):\n\t\t# free memory created by C to avoid memory leak\n\t\tif hasattr(self, '__createfrom__') and self.__createfrom__ == 'C':\n\t\t\tlibsvm.svm_free_and_destroy_model(pointer(self))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L214_C2", "label": "if", "type": "if", "loc": [214, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L212_C1", "vector": [4, 2, 0.7103, 0.0066, 2, 0.53, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif hasattr(self, '__createfrom__') and self.__createfrom__ == 'C':\n\t\t\tlibsvm.svm_free_and_destroy_model(pointer(self))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L215_C3", "label": "svm_free_and_destroy_model()", "type": "expression", "loc": [215, 215], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L214_C2", "vector": [8, 3, 0.7119, 0.0033, 3, 0.83, 0.0, 474, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "svm_free_and_destroy_model", "arg_names": [], "import_names": [], "rhs_call_name": "svm_free_and_destroy_model", "annotation": ""}, "snippet": "\t\t\tlibsvm.svm_free_and_destroy_model(pointer(self))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L217_C1", "label": "get_svm_type", "type": "function", "loc": [217, 218], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L201_C0", "vector": [2, 1, 0.7202, 0.0066, 1, 0.9, 0.2857, 667, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_svm_type", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef get_svm_type(self):\n\t\treturn libsvm.svm_get_svm_type(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Return_L218_C2", "label": "return", "type": "return", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L217_C1", "vector": [13, 2, 0.7219, 0.0033, 2, 0.8, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn libsvm.svm_get_svm_type(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L220_C1", "label": "get_nr_class", "type": "function", "loc": [220, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L201_C0", "vector": [2, 1, 0.7301, 0.0066, 1, 0.9, 0.4286, 238, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_nr_class", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef get_nr_class(self):\n\t\treturn libsvm.svm_get_nr_class(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Return_L221_C2", "label": "return", "type": "return", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L220_C1", "vector": [13, 2, 0.7318, 0.0033, 2, 0.41, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn libsvm.svm_get_nr_class(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L223_C1", "label": "get_svr_probability", "type": "function", "loc": [223, 224], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L201_C0", "vector": [2, 1, 0.7401, 0.0066, 1, 0.9, 0.5714, 765, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_svr_probability", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef get_svr_probability(self):\n\t\treturn libsvm.svm_get_svr_probability(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Return_L224_C2", "label": "return", "type": "return", "loc": [224, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L223_C1", "vector": [13, 2, 0.7417, 0.0033, 2, 0.38, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn libsvm.svm_get_svr_probability(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L226_C1", "label": "get_labels", "type": "function", "loc": [226, 230], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L201_C0", "vector": [2, 1, 0.755, 0.0166, 1, 0.9, 0.7143, 505, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "get_labels", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef get_labels(self):\n\t\tnr_class = self.get_nr_class()\n\t\tlabels = (c_int * nr_class)()\n\t\tlibsvm.svm_get_labels(self, labels)\n\t\treturn labels[:nr_class]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L227_C2", "label": "nr_class = get_nr_class()", "type": "assigned_variable", "loc": [227, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L226_C1", "vector": [14, 2, 0.7517, 0.0033, 2, 0.35, 0.0, 123, 3, 0, 0, 0, 238, 10, 1], "semantic": {"name": "nr_class", "arg_names": [], "import_names": [], "rhs_call_name": "get_nr_class", "annotation": ""}, "snippet": "\t\tnr_class = self.get_nr_class()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L228_C2", "label": "labels =", "type": "assigned_variable", "loc": [228, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L226_C1", "vector": [14, 2, 0.755, 0.0033, 2, 0.35, 0.3333, 283, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "labels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tlabels = (c_int * nr_class)()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L229_C2", "label": "svm_get_labels()", "type": "expression", "loc": [229, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L226_C1", "vector": [8, 2, 0.7583, 0.0033, 2, 0.35, 0.6667, 529, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "svm_get_labels", "arg_names": [], "import_names": [], "rhs_call_name": "svm_get_labels", "annotation": ""}, "snippet": "\t\tlibsvm.svm_get_labels(self, labels)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Return_L230_C2", "label": "return", "type": "return", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L226_C1", "vector": [13, 2, 0.7616, 0.0033, 2, 0.35, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn labels[:nr_class]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L232_C1", "label": "is_probability_model", "type": "function", "loc": [232, 233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L201_C0", "vector": [2, 1, 0.7699, 0.0066, 1, 0.9, 0.8571, 875, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "is_probability_model", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef is_probability_model(self):\n\t\treturn (libsvm.svm_check_probability_model(self) == 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Return_L233_C2", "label": "return", "type": "return", "loc": [233, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L232_C1", "vector": [13, 2, 0.7715, 0.0033, 2, 0.65, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn (libsvm.svm_check_probability_model(self) == 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L260_C1", "label": "get_support_vectors", "type": "function", "loc": [260, 263], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L201_C0", "vector": [2, 1, 0.8659, 0.0132, 1, 0.9, 1.0, 605, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_support_vectors", "arg_names": ["self", "samples_len"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef get_support_vectors(self, samples_len):\n\t\tsvs = (c_int * samples_len)()\n\t\tlibsvm.svm_get_support_vectors(self, samples_len, svs)\n\t\treturn svs[:samples_len]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L261_C2", "label": "svs =", "type": "assigned_variable", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L260_C1", "vector": [14, 2, 0.8642, 0.0033, 2, 0.72, 0.0, 666, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "svs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tsvs = (c_int * samples_len)()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L262_C2", "label": "svm_get_support_vectors()", "type": "expression", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L260_C1", "vector": [8, 2, 0.8675, 0.0033, 2, 0.72, 0.5, 307, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "svm_get_support_vectors", "arg_names": [], "import_names": [], "rhs_call_name": "svm_get_support_vectors", "annotation": ""}, "snippet": "\t\tlibsvm.svm_get_support_vectors(self, samples_len, svs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Return_L263_C2", "label": "return", "type": "return", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L260_C1", "vector": [13, 2, 0.8709, 0.0033, 2, 0.72, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn svs[:samples_len]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L268_C0", "label": "toPyModel", "type": "function", "loc": [268, 278], "level": 0, "parent": null, "vector": [2, 0, 0.904, 0.0364, 0, 0.66, 0.5, 834, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "toPyModel", "arg_names": ["model_ptr"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def toPyModel(model_ptr):\n\t\"\"\"\n\ttoPyModel(model_ptr) -> svm_model\n\n\tConvert a ctypes POINTER(svm_model) to a Python svm_model\n\t\"\"\"\n\tif bool(model_ptr) == False:\n\t\traise ValueError(\"Null pointer\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L269_C1", "label": "expression", "type": "expression", "loc": [269, 273], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L268_C0", "vector": [8, 1, 0.8974, 0.0166, 1, 0.09, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\"\"\"\n\ttoPyModel(model_ptr) -> svm_model\n\n\tConvert a ctypes POINTER(svm_model) to a Python svm_model\n\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L274_C1", "label": "if", "type": "if", "loc": [274, 275], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L268_C0", "vector": [4, 1, 0.9089, 0.0066, 1, 0.09, 0.25, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif bool(model_ptr) == False:\n\t\traise ValueError(\"Null pointer\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L276_C1", "label": "m =", "type": "assigned_variable", "loc": [276, 276], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L268_C0", "vector": [14, 1, 0.9139, 0.0033, 1, 0.09, 0.5, 711, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tm = model_ptr.contents"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L277_C1", "label": "m.__createfrom__ =", "type": "assigned_variable", "loc": [277, 277], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L268_C0", "vector": [14, 1, 0.9172, 0.0033, 1, 0.09, 0.75, 563, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "m.__createfrom__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tm.__createfrom__ = 'C'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Return_L278_C1", "label": "return", "type": "return", "loc": [278, 278], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L268_C0", "vector": [13, 1, 0.9205, 0.0033, 1, 0.09, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn m"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L280_C0", "label": "fillprototype()", "type": "expression", "loc": [280, 280], "level": 0, "parent": null, "vector": [8, 0, 0.9272, 0.0033, 0, 0.66, 0.5278, 68, 3, 3, 0, 0, 0, 0, 4], "semantic": {"name": "fillprototype", "arg_names": [], "import_names": [], "rhs_call_name": "fillprototype", "annotation": ""}, "snippet": "fillprototype(libsvm.svm_train, POINTER(svm_model), [POINTER(svm_problem), POINTER(svm_parameter)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L281_C0", "label": "fillprototype()", "type": "expression", "loc": [281, 281], "level": 0, "parent": null, "vector": [8, 0, 0.9305, 0.0033, 0, 0.66, 0.5556, 68, 3, 3, 0, 0, 0, 0, 4], "semantic": {"name": "fillprototype", "arg_names": [], "import_names": [], "rhs_call_name": "fillprototype", "annotation": ""}, "snippet": "fillprototype(libsvm.svm_cross_validation, None, [POINTER(svm_problem), POINTER(svm_parameter), c_int, POINTER(c_double)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L283_C0", "label": "fillprototype()", "type": "expression", "loc": [283, 283], "level": 0, "parent": null, "vector": [8, 0, 0.9371, 0.0033, 0, 0.66, 0.5833, 68, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "fillprototype", "arg_names": [], "import_names": [], "rhs_call_name": "fillprototype", "annotation": ""}, "snippet": "fillprototype(libsvm.svm_save_model, c_int, [c_char_p, POINTER(svm_model)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L284_C0", "label": "fillprototype()", "type": "expression", "loc": [284, 284], "level": 0, "parent": null, "vector": [8, 0, 0.9404, 0.0033, 0, 0.66, 0.6111, 68, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "fillprototype", "arg_names": [], "import_names": [], "rhs_call_name": "fillprototype", "annotation": ""}, "snippet": "fillprototype(libsvm.svm_load_model, POINTER(svm_model), [c_char_p])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L286_C0", "label": "fillprototype()", "type": "expression", "loc": [286, 286], "level": 0, "parent": null, "vector": [8, 0, 0.947, 0.0033, 0, 0.66, 0.6389, 68, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "fillprototype", "arg_names": [], "import_names": [], "rhs_call_name": "fillprototype", "annotation": ""}, "snippet": "fillprototype(libsvm.svm_get_svm_type, c_int, [POINTER(svm_model)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L287_C0", "label": "fillprototype()", "type": "expression", "loc": [287, 287], "level": 0, "parent": null, "vector": [8, 0, 0.9503, 0.0033, 0, 0.66, 0.6667, 68, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "fillprototype", "arg_names": [], "import_names": [], "rhs_call_name": "fillprototype", "annotation": ""}, "snippet": "fillprototype(libsvm.svm_get_nr_class, c_int, [POINTER(svm_model)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L288_C0", "label": "fillprototype()", "type": "expression", "loc": [288, 288], "level": 0, "parent": null, "vector": [8, 0, 0.9536, 0.0033, 0, 0.66, 0.6944, 68, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "fillprototype", "arg_names": [], "import_names": [], "rhs_call_name": "fillprototype", "annotation": ""}, "snippet": "fillprototype(libsvm.svm_get_labels, None, [POINTER(svm_model), POINTER(c_int)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L289_C0", "label": "fillprototype()", "type": "expression", "loc": [289, 289], "level": 0, "parent": null, "vector": [8, 0, 0.957, 0.0033, 0, 0.66, 0.7222, 68, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "fillprototype", "arg_names": [], "import_names": [], "rhs_call_name": "fillprototype", "annotation": ""}, "snippet": "fillprototype(libsvm.svm_get_support_vectors, None, [POINTER(svm_model), c_int, POINTER(c_int)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L290_C0", "label": "fillprototype()", "type": "expression", "loc": [290, 290], "level": 0, "parent": null, "vector": [8, 0, 0.9603, 0.0033, 0, 0.66, 0.75, 68, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "fillprototype", "arg_names": [], "import_names": [], "rhs_call_name": "fillprototype", "annotation": ""}, "snippet": "fillprototype(libsvm.svm_get_svr_probability, c_double, [POINTER(svm_model)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L292_C0", "label": "fillprototype()", "type": "expression", "loc": [292, 292], "level": 0, "parent": null, "vector": [8, 0, 0.9669, 0.0033, 0, 0.66, 0.7778, 68, 3, 3, 0, 0, 0, 0, 4], "semantic": {"name": "fillprototype", "arg_names": [], "import_names": [], "rhs_call_name": "fillprototype", "annotation": ""}, "snippet": "fillprototype(libsvm.svm_predict_values, c_double, [POINTER(svm_model), POINTER(svm_node), POINTER(c_double)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L293_C0", "label": "fillprototype()", "type": "expression", "loc": [293, 293], "level": 0, "parent": null, "vector": [8, 0, 0.9702, 0.0033, 0, 0.66, 0.8056, 68, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "fillprototype", "arg_names": [], "import_names": [], "rhs_call_name": "fillprototype", "annotation": ""}, "snippet": "fillprototype(libsvm.svm_predict, c_double, [POINTER(svm_model), POINTER(svm_node)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L294_C0", "label": "fillprototype()", "type": "expression", "loc": [294, 294], "level": 0, "parent": null, "vector": [8, 0, 0.9735, 0.0033, 0, 0.66, 0.8333, 68, 3, 3, 0, 0, 0, 0, 4], "semantic": {"name": "fillprototype", "arg_names": [], "import_names": [], "rhs_call_name": "fillprototype", "annotation": ""}, "snippet": "fillprototype(libsvm.svm_predict_probability, c_double, [POINTER(svm_model), POINTER(svm_node), POINTER(c_double)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L296_C0", "label": "fillprototype()", "type": "expression", "loc": [296, 296], "level": 0, "parent": null, "vector": [8, 0, 0.9801, 0.0033, 0, 0.66, 0.8611, 68, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "fillprototype", "arg_names": [], "import_names": [], "rhs_call_name": "fillprototype", "annotation": ""}, "snippet": "fillprototype(libsvm.svm_free_model_content, None, [POINTER(svm_model)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L297_C0", "label": "fillprototype()", "type": "expression", "loc": [297, 297], "level": 0, "parent": null, "vector": [8, 0, 0.9834, 0.0033, 0, 0.66, 0.8889, 68, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "fillprototype", "arg_names": [], "import_names": [], "rhs_call_name": "fillprototype", "annotation": ""}, "snippet": "fillprototype(libsvm.svm_free_and_destroy_model, None, [POINTER(POINTER(svm_model))])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L298_C0", "label": "fillprototype()", "type": "expression", "loc": [298, 298], "level": 0, "parent": null, "vector": [8, 0, 0.9868, 0.0033, 0, 0.66, 0.9167, 68, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "fillprototype", "arg_names": [], "import_names": [], "rhs_call_name": "fillprototype", "annotation": ""}, "snippet": "fillprototype(libsvm.svm_destroy_param, None, [POINTER(svm_parameter)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L300_C0", "label": "fillprototype()", "type": "expression", "loc": [300, 300], "level": 0, "parent": null, "vector": [8, 0, 0.9934, 0.0033, 0, 0.66, 0.9444, 68, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "fillprototype", "arg_names": [], "import_names": [], "rhs_call_name": "fillprototype", "annotation": ""}, "snippet": "fillprototype(libsvm.svm_check_parameter, c_char_p, [POINTER(svm_problem), POINTER(svm_parameter)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L301_C0", "label": "fillprototype()", "type": "expression", "loc": [301, 301], "level": 0, "parent": null, "vector": [8, 0, 0.9967, 0.0033, 0, 0.66, 0.9722, 68, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "fillprototype", "arg_names": [], "import_names": [], "rhs_call_name": "fillprototype", "annotation": ""}, "snippet": "fillprototype(libsvm.svm_check_probability_model, c_int, [POINTER(svm_model)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L302_C0", "label": "fillprototype()", "type": "expression", "loc": [302, 302], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.0033, 0, 0.66, 1.0, 68, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "fillprototype", "arg_names": [], "import_names": [], "rhs_call_name": "fillprototype", "annotation": ""}, "snippet": "fillprototype(libsvm.svm_set_print_string_function, None, [PRINT_STRING_FUN])"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L11_C0"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L12_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L14_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L14_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L15_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L14_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L17_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L23_C33"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L24_C36"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Return_L28_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Return_L31_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L34_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L35_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L38_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L39_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L40_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L43_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L43_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L44_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L43_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L45_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L45_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L46_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L50_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L50_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L52_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L53_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L53_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L54_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L56_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L57_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L58_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L59_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L59_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L60_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L59_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L61_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L62_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L63_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L63_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L64_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Return_L65_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L68_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L69_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L70_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L72_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L72_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L73_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L72_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L75_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L72_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L77_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L72_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L78_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L72_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L79_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L79_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L80_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L79_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L82_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L72_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L83_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L72_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L85_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L72_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L86_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L86_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L86_C29"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L72_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L88_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L72_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L89_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L89_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L89_C40"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L92_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L95_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L98_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L100_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L100_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L101_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L101_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L102_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L100_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L103_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L105_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L105_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L106_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L105_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L107_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L105_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L108_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L108_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L109_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L112_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L113_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L114_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L115_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L116_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L117_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L118_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L119_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L120_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L121_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L122_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L123_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L124_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L125_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L126_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L127_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L128_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L129_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L131_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L131_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L132_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L131_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L133_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L131_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L134_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L131_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L135_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L131_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L136_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L131_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L138_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L131_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:While_L139_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:While_L139_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L140_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L140_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L140_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L140_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L143_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L143_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L143_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L143_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L146_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L146_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L146_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L146_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L149_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L149_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L149_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L149_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L152_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L152_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L152_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L152_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L155_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L155_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L155_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L155_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L158_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L158_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L158_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L158_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L161_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L161_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L161_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L161_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L164_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L164_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L164_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L164_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L167_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L167_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L167_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L167_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L170_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L170_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L170_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L170_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L173_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L173_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L173_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L173_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L176_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L176_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L177_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L176_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L178_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L178_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L178_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L178_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L178_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L178_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L184_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L184_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L184_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L131_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L194_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L131_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L195_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L131_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L196_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L131_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L197_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L197_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L198_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:For_L197_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L199_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L209_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L209_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L210_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L212_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L212_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L214_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L214_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L215_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L217_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L217_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Return_L218_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L220_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L220_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Return_L221_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L223_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L223_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Return_L224_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L226_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L226_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L227_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L226_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L228_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L226_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L229_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L226_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Return_L230_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L232_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L232_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Return_L233_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L260_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L260_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L261_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L260_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L262_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L260_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Return_L263_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L268_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Expr_L269_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L268_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:If_L274_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L268_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L276_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L268_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Assign_L277_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99309:FunctionDef_L268_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99309:Return_L278_C1"}]
#!/usr/bin/env python import sys import os from subprocess import * if len(sys.argv) <= 1: print('Usage: %s training_file [testing_file]' % sys.argv[0]) raise SystemExit # svm, grid, and gnuplot executable files is_win32 = (sys.platform == 'win32') if not is_win32: svmscale_exe = "../svm-scale" svmtrain_exe = "../svm-train" svmpredict_exe = "../svm-predict" grid_py = "./grid.py" gnuplot_exe = "/usr/bin/gnuplot" else: # example for windows svmscale_exe = r"..\windows\svm-scale.exe" svmtrain_exe = r"..\windows\svm-train.exe" svmpredict_exe = r"..\windows\svm-predict.exe" gnuplot_exe = r"c:\tmp\gnuplot\bin\pgnuplot.exe" grid_py = r".\grid.py" assert os.path.exists(svmscale_exe),"svm-scale executable not found" assert os.path.exists(svmtrain_exe),"svm-train executable not found" assert os.path.exists(svmpredict_exe),"svm-predict executable not found" assert os.path.exists(gnuplot_exe),"gnuplot executable not found" assert os.path.exists(grid_py),"grid.py not found" train_pathname = sys.argv[1] assert os.path.exists(train_pathname),"training file not found" file_name = os.path.split(train_pathname)[1] scaled_file = file_name + ".scale" model_file = file_name + ".model" range_file = file_name + ".range" if len(sys.argv) > 2: test_pathname = sys.argv[2] file_name = os.path.split(test_pathname)[1] assert os.path.exists(test_pathname),"testing file not found" scaled_test_file = file_name + ".scale" predict_test_file = file_name + ".predict" cmd = '%s -s "%s" "%s" > "%s"' % (svmscale_exe, range_file, train_pathname, scaled_file) print('Scaling training data...') Popen(cmd, shell = True, stdout = PIPE).communicate() cmd = '%s -svmtrain "%s" -gnuplot "%s" "%s"' % (grid_py, svmtrain_exe, gnuplot_exe, scaled_file) print('Cross validation...') f = Popen(cmd, shell = True, stdout = PIPE).stdout line = '' while True: last_line = line line = f.readline() if not line: break c,g,rate = map(float,last_line.split()) print('Best c=%s, g=%s CV rate=%s' % (c,g,rate)) cmd = '%s -c %s -g %s "%s" "%s"' % (svmtrain_exe,c,g,scaled_file,model_file) print('Training...') Popen(cmd, shell = True, stdout = PIPE).communicate() print('Output model: %s' % model_file) if len(sys.argv) > 2: cmd = '%s -r "%s" "%s" > "%s"' % (svmscale_exe, range_file, test_pathname, scaled_test_file) print('Scaling testing data...') Popen(cmd, shell = True, stdout = PIPE).communicate() cmd = '%s "%s" "%s" "%s"' % (svmpredict_exe, scaled_test_file, model_file, predict_test_file) print('Testing...') Popen(cmd, shell = True).communicate() print('Output prediction: %s' % predict_test_file)
ajibawa-2023/Python-Code-Large/train/row_99310
52
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_99310:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.038, 0.0127, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Import_L4_C0", "label": "os import os", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0506, 0.0127, 0, 0.66, 0.0385, 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_99310:ImportFrom_L5_C0", "label": "from subprocess import *", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0633, 0.0127, 0, 0.66, 0.0769, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from subprocess import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L7_C0", "label": "if", "type": "if", "loc": [7, 9], "level": 0, "parent": null, "vector": [4, 0, 0.1013, 0.038, 0, 0.66, 0.1154, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if len(sys.argv) <= 1:\n\tprint('Usage: %s training_file [testing_file]' % sys.argv[0])\n\traise SystemExit"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Expr_L8_C1", "label": "print()", "type": "expression", "loc": [8, 8], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L7_C0", "vector": [8, 1, 0.1013, 0.0127, 1, 0.79, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint('Usage: %s training_file [testing_file]' % sys.argv[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L13_C0", "label": "is_win32 =", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.1646, 0.0127, 0, 0.66, 0.1538, 135, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "is_win32", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "is_win32 = (sys.platform == 'win32')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L14_C0", "label": "if", "type": "if", "loc": [14, 26], "level": 0, "parent": null, "vector": [4, 0, 0.2532, 0.1646, 0, 0.66, 0.1923, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if not is_win32:\n\tsvmscale_exe = \"../svm-scale\"\n\tsvmtrain_exe = \"../svm-train\"\n\tsvmpredict_exe = \"../svm-predict\"\n\tgrid_py = \"./grid.py\"\n\tgnuplot_exe = \"/usr/bin/gnuplot\"\nelse:\n # example for windows"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L15_C1", "label": "svmscale_exe =", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L14_C0", "vector": [14, 1, 0.1899, 0.0127, 1, 0.44, 0.0, 72, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "svmscale_exe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tsvmscale_exe = \"../svm-scale\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L16_C1", "label": "svmtrain_exe =", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L14_C0", "vector": [14, 1, 0.2025, 0.0127, 1, 0.44, 0.1111, 415, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "svmtrain_exe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tsvmtrain_exe = \"../svm-train\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L17_C1", "label": "svmpredict_exe =", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L14_C0", "vector": [14, 1, 0.2152, 0.0127, 1, 0.44, 0.2222, 455, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "svmpredict_exe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tsvmpredict_exe = \"../svm-predict\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L18_C1", "label": "grid_py =", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L14_C0", "vector": [14, 1, 0.2278, 0.0127, 1, 0.44, 0.3333, 72, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "grid_py", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tgrid_py = \"./grid.py\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L19_C1", "label": "gnuplot_exe =", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L14_C0", "vector": [14, 1, 0.2405, 0.0127, 1, 0.44, 0.4444, 797, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "gnuplot_exe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tgnuplot_exe = \"/usr/bin/gnuplot\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L22_C1", "label": "svmscale_exe =", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L14_C0", "vector": [14, 1, 0.2785, 0.0127, 1, 0.44, 0.5556, 72, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "svmscale_exe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tsvmscale_exe = r\"..\\windows\\svm-scale.exe\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L23_C1", "label": "svmtrain_exe =", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L14_C0", "vector": [14, 1, 0.2911, 0.0127, 1, 0.44, 0.6667, 415, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "svmtrain_exe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tsvmtrain_exe = r\"..\\windows\\svm-train.exe\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L24_C1", "label": "svmpredict_exe =", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L14_C0", "vector": [14, 1, 0.3038, 0.0127, 1, 0.44, 0.7778, 455, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "svmpredict_exe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tsvmpredict_exe = r\"..\\windows\\svm-predict.exe\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L25_C1", "label": "gnuplot_exe =", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L14_C0", "vector": [14, 1, 0.3165, 0.0127, 1, 0.44, 0.8889, 797, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "gnuplot_exe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tgnuplot_exe = r\"c:\\tmp\\gnuplot\\bin\\pgnuplot.exe\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L26_C1", "label": "grid_py =", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L14_C0", "vector": [14, 1, 0.3291, 0.0127, 1, 0.44, 1.0, 72, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "grid_py", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tgrid_py = r\".\\grid.py\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L34_C0", "label": "train_pathname =", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 0.4304, 0.0127, 0, 0.66, 0.4231, 303, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "train_pathname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "train_pathname = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L36_C0", "label": "file_name =", "type": "assigned_variable", "loc": [36, 36], "level": 0, "parent": null, "vector": [14, 0, 0.4557, 0.0127, 0, 0.66, 0.5, 991, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "file_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "file_name = os.path.split(train_pathname)[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L37_C0", "label": "scaled_file =", "type": "assigned_variable", "loc": [37, 37], "level": 0, "parent": null, "vector": [14, 0, 0.4684, 0.0127, 0, 0.66, 0.5385, 604, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "scaled_file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "scaled_file = file_name + \".scale\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L38_C0", "label": "model_file =", "type": "assigned_variable", "loc": [38, 38], "level": 0, "parent": null, "vector": [14, 0, 0.481, 0.0127, 0, 0.66, 0.5769, 128, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "model_file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "model_file = file_name + \".model\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L39_C0", "label": "range_file =", "type": "assigned_variable", "loc": [39, 39], "level": 0, "parent": null, "vector": [14, 0, 0.4937, 0.0127, 0, 0.66, 0.6154, 149, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "range_file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "range_file = file_name + \".range\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L41_C0", "label": "if", "type": "if", "loc": [41, 46], "level": 0, "parent": null, "vector": [4, 0, 0.5506, 0.0759, 0, 0.66, 0.6538, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if len(sys.argv) > 2:\n\ttest_pathname = sys.argv[2]\n\tfile_name = os.path.split(test_pathname)[1]\n\tassert os.path.exists(test_pathname),\"testing file not found\"\n\tscaled_test_file = file_name + \".scale\"\n\tpredict_test_file = file_name + \".predict\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L42_C1", "label": "test_pathname =", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L41_C0", "vector": [14, 1, 0.5316, 0.0127, 1, 0.58, 0.0, 459, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test_pathname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\ttest_pathname = sys.argv[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L43_C1", "label": "file_name =", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L41_C0", "vector": [14, 1, 0.5443, 0.0127, 1, 0.58, 0.3333, 991, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "file_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfile_name = os.path.split(test_pathname)[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L45_C1", "label": "scaled_test_file =", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L41_C0", "vector": [14, 1, 0.5696, 0.0127, 1, 0.58, 0.6667, 329, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "scaled_test_file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tscaled_test_file = file_name + \".scale\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L46_C1", "label": "predict_test_file =", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L41_C0", "vector": [14, 1, 0.5823, 0.0127, 1, 0.58, 1.0, 807, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "predict_test_file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tpredict_test_file = file_name + \".predict\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L48_C0", "label": "cmd =", "type": "assigned_variable", "loc": [48, 48], "level": 0, "parent": null, "vector": [14, 0, 0.6076, 0.0127, 0, 0.66, 0.6923, 604, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cmd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "cmd = '%s -s \"%s\" \"%s\" > \"%s\"' % (svmscale_exe, range_file, train_pathname, scaled_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Expr_L49_C0", "label": "print()", "type": "expression", "loc": [49, 49], "level": 0, "parent": null, "vector": [8, 0, 0.6203, 0.0127, 0, 0.66, 0.7308, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('Scaling training data...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Expr_L50_C0", "label": "communicate()", "type": "expression", "loc": [50, 50], "level": 0, "parent": null, "vector": [8, 0, 0.6329, 0.0127, 0, 0.66, 0.7692, 768, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "communicate", "arg_names": [], "import_names": [], "rhs_call_name": "communicate", "annotation": ""}, "snippet": "Popen(cmd, shell = True, stdout = PIPE).communicate()\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L52_C0", "label": "cmd =", "type": "assigned_variable", "loc": [52, 52], "level": 0, "parent": null, "vector": [14, 0, 0.6582, 0.0127, 0, 0.66, 0.8077, 604, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cmd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "cmd = '%s -svmtrain \"%s\" -gnuplot \"%s\" \"%s\"' % (grid_py, svmtrain_exe, gnuplot_exe, scaled_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Expr_L53_C0", "label": "print()", "type": "expression", "loc": [53, 53], "level": 0, "parent": null, "vector": [8, 0, 0.6709, 0.0127, 0, 0.66, 0.8462, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('Cross validation...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L54_C0", "label": "f =", "type": "assigned_variable", "loc": [54, 54], "level": 0, "parent": null, "vector": [14, 0, 0.6835, 0.0127, 0, 0.66, 0.8846, 899, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "f = Popen(cmd, shell = True, stdout = PIPE).stdout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L56_C0", "label": "line =", "type": "assigned_variable", "loc": [56, 56], "level": 0, "parent": null, "vector": [14, 0, 0.7089, 0.0127, 0, 0.66, 0.9231, 373, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "line = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:While_L57_C0", "label": "while", "type": "while", "loc": [57, 60], "level": 0, "parent": null, "vector": [5, 0, 0.7405, 0.0506, 0, 0.66, 0.9615, 0, 1, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "while True:\n\tlast_line = line\n\tline = f.readline()\n\tif not line: break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L58_C1", "label": "last_line =", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:While_L57_C0", "vector": [14, 1, 0.7342, 0.0127, 1, 0.8, 0.0, 242, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "last_line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tlast_line = line"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L59_C1", "label": "line = readline()", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:While_L57_C0", "vector": [14, 1, 0.7468, 0.0127, 1, 0.8, 0.5, 373, 3, 0, 0, 0, 303, 10, 1], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "readline", "annotation": ""}, "snippet": "\tline = f.readline()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L60_C1", "label": "if", "type": "if", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:While_L57_C0", "vector": [4, 1, 0.7595, 0.0127, 1, 0.8, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif not line: break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L61_C0", "label": "c, g, rate = map()", "type": "assigned_variable", "loc": [61, 61], "level": 0, "parent": null, "vector": [14, 0, 0.7722, 0.0127, 0, 0.66, 1.0, 930, 3, 2, 0, 0, 53, 10, 2], "semantic": {"name": "c, g, rate", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": "c,g,rate = map(float,last_line.split())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Expr_L63_C0", "label": "print()", "type": "expression", "loc": [63, 63], "level": 0, "parent": null, "vector": [8, 0, 0.7975, 0.0127, 0, 0.66, 1.0385, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('Best c=%s, g=%s CV rate=%s' % (c,g,rate))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L65_C0", "label": "cmd =", "type": "assigned_variable", "loc": [65, 65], "level": 0, "parent": null, "vector": [14, 0, 0.8228, 0.0127, 0, 0.66, 1.0769, 604, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cmd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "cmd = '%s -c %s -g %s \"%s\" \"%s\"' % (svmtrain_exe,c,g,scaled_file,model_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Expr_L66_C0", "label": "print()", "type": "expression", "loc": [66, 66], "level": 0, "parent": null, "vector": [8, 0, 0.8354, 0.0127, 0, 0.66, 1.1154, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('Training...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Expr_L67_C0", "label": "communicate()", "type": "expression", "loc": [67, 67], "level": 0, "parent": null, "vector": [8, 0, 0.8481, 0.0127, 0, 0.66, 1.1538, 768, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "communicate", "arg_names": [], "import_names": [], "rhs_call_name": "communicate", "annotation": ""}, "snippet": "Popen(cmd, shell = True, stdout = PIPE).communicate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Expr_L69_C0", "label": "print()", "type": "expression", "loc": [69, 69], "level": 0, "parent": null, "vector": [8, 0, 0.8734, 0.0127, 0, 0.66, 1.1923, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('Output model: %s' % model_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L70_C0", "label": "if", "type": "if", "loc": [70, 79], "level": 0, "parent": null, "vector": [4, 0, 0.943, 0.1266, 0, 0.66, 1.2308, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if len(sys.argv) > 2:\n\tcmd = '%s -r \"%s\" \"%s\" > \"%s\"' % (svmscale_exe, range_file, test_pathname, scaled_test_file)\n\tprint('Scaling testing data...')\n\tPopen(cmd, shell = True, stdout = PIPE).communicate()\t\n\n\tcmd = '%s \"%s\" \"%s\" \"%s\"' % (svmpredict_exe, scaled_test_file, model_file, predict_test_file)\n\tprint('Testing...')\n\tPopen(cmd, shell = True).communicate()\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L71_C1", "label": "cmd =", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L70_C0", "vector": [14, 1, 0.8987, 0.0127, 1, 0.99, 0.0, 604, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cmd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tcmd = '%s -r \"%s\" \"%s\" > \"%s\"' % (svmscale_exe, range_file, test_pathname, scaled_test_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Expr_L72_C1", "label": "print()", "type": "expression", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L70_C0", "vector": [8, 1, 0.9114, 0.0127, 1, 0.99, 0.1667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint('Scaling testing data...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Expr_L73_C1", "label": "communicate()", "type": "expression", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L70_C0", "vector": [8, 1, 0.9241, 0.0127, 1, 0.99, 0.3333, 768, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "communicate", "arg_names": [], "import_names": [], "rhs_call_name": "communicate", "annotation": ""}, "snippet": "\tPopen(cmd, shell = True, stdout = PIPE).communicate()\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L75_C1", "label": "cmd =", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L70_C0", "vector": [14, 1, 0.9494, 0.0127, 1, 0.99, 0.5, 604, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cmd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tcmd = '%s \"%s\" \"%s\" \"%s\"' % (svmpredict_exe, scaled_test_file, model_file, predict_test_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Expr_L76_C1", "label": "print()", "type": "expression", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L70_C0", "vector": [8, 1, 0.962, 0.0127, 1, 0.99, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint('Testing...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Expr_L77_C1", "label": "communicate()", "type": "expression", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L70_C0", "vector": [8, 1, 0.9747, 0.0127, 1, 0.99, 0.8333, 768, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "communicate", "arg_names": [], "import_names": [], "rhs_call_name": "communicate", "annotation": ""}, "snippet": "\tPopen(cmd, shell = True).communicate()\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99310:Expr_L79_C1", "label": "print()", "type": "expression", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L70_C0", "vector": [8, 1, 1.0, 0.0127, 1, 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": "\tprint('Output prediction: %s' % predict_test_file)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:Expr_L8_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L15_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L16_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L17_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L18_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L19_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L22_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L23_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L24_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L25_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L26_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L42_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L43_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L45_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L46_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99310:While_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L58_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99310:While_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L59_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99310:While_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L60_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L71_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:Expr_L72_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:Expr_L73_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:Assign_L75_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:Expr_L76_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:Expr_L77_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99310:If_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99310:Expr_L79_C1"}]
#!/usr/bin/env python import os, sys, traceback import getpass from threading import Thread from subprocess import * if(sys.hexversion < 0x03000000): import Queue else: import queue as Queue # svmtrain and gnuplot executable is_win32 = (sys.platform == 'win32') if not is_win32: svmtrain_exe = "../svm-train" gnuplot_exe = "/usr/bin/gnuplot" else: # example for windows svmtrain_exe = r"..\windows\svm-train.exe" gnuplot_exe = r"c:\tmp\gnuplot\bin\pgnuplot.exe" # global parameters and their default values fold = 5 c_begin, c_end, c_step = -5, 15, 2 g_begin, g_end, g_step = 3, -15, -2 global dataset_pathname, dataset_title, pass_through_string global out_filename, png_filename # experimental telnet_workers = [] ssh_workers = [] nr_local_worker = 1 # process command line options, set global parameters def process_options(argv=sys.argv): global fold global c_begin, c_end, c_step global g_begin, g_end, g_step global dataset_pathname, dataset_title, pass_through_string global svmtrain_exe, gnuplot_exe, gnuplot, out_filename, png_filename usage = """\ Usage: grid.py [-log2c begin,end,step] [-log2g begin,end,step] [-v fold] [-svmtrain pathname] [-gnuplot pathname] [-out pathname] [-png pathname] [additional parameters for svm-train] dataset""" if len(argv) < 2: print(usage) sys.exit(1) dataset_pathname = argv[-1] dataset_title = os.path.split(dataset_pathname)[1] out_filename = '%s.out' % dataset_title png_filename = '%s.png' % dataset_title pass_through_options = [] i = 1 while i < len(argv) - 1: if argv[i] == "-log2c": i = i + 1 (c_begin,c_end,c_step) = map(float,argv[i].split(",")) elif argv[i] == "-log2g": i = i + 1 (g_begin,g_end,g_step) = map(float,argv[i].split(",")) elif argv[i] == "-v": i = i + 1 fold = argv[i] elif argv[i] in ('-c','-g'): print("Option -c and -g are renamed.") print(usage) sys.exit(1) elif argv[i] == '-svmtrain': i = i + 1 svmtrain_exe = argv[i] elif argv[i] == '-gnuplot': i = i + 1 gnuplot_exe = argv[i] elif argv[i] == '-out': i = i + 1 out_filename = argv[i] elif argv[i] == '-png': i = i + 1 png_filename = argv[i] else: pass_through_options.append(argv[i]) i = i + 1 pass_through_string = " ".join(pass_through_options) assert os.path.exists(svmtrain_exe),"svm-train executable not found" assert os.path.exists(gnuplot_exe),"gnuplot executable not found" assert os.path.exists(dataset_pathname),"dataset not found" gnuplot = Popen(gnuplot_exe,stdin = PIPE).stdin def range_f(begin,end,step): # like range, but works on non-integer too seq = [] while True: if step > 0 and begin > end: break if step < 0 and begin < end: break seq.append(begin) begin = begin + step return seq def permute_sequence(seq): n = len(seq) if n <= 1: return seq mid = int(n/2) left = permute_sequence(seq[:mid]) right = permute_sequence(seq[mid+1:]) ret = [seq[mid]] while left or right: if left: ret.append(left.pop(0)) if right: ret.append(right.pop(0)) return ret def redraw(db,best_param,tofile=False): if len(db) == 0: return begin_level = round(max(x[2] for x in db)) - 3 step_size = 0.5 best_log2c,best_log2g,best_rate = best_param if tofile: gnuplot.write( "set term png transparent small\n".encode()) gnuplot.write( ("set output \"%s\"\n" % png_filename.replace('\\','\\\\')).encode()) #gnuplot.write("set term postscript color solid\n".encode()) #gnuplot.write(("set output \"%s.ps\"\n" % dataset_title).encode()) elif is_win32: gnuplot.write("set term windows\n".encode()) else: gnuplot.write( "set term x11\n".encode()) gnuplot.write("set xlabel \"log2(C)\"\n".encode()) gnuplot.write("set ylabel \"log2(gamma)\"\n".encode()) gnuplot.write(("set xrange [%s:%s]\n" % (c_begin,c_end)).encode()) gnuplot.write(("set yrange [%s:%s]\n" % (g_begin,g_end)).encode()) gnuplot.write("set contour\n".encode()) gnuplot.write(("set cntrparam levels incremental %s,%s,100\n" % (begin_level,step_size)).encode()) gnuplot.write("unset surface\n".encode()) gnuplot.write("unset ztics\n".encode()) gnuplot.write("set view 0,0\n".encode()) gnuplot.write(("set title \"%s\"\n" % dataset_title).encode()) gnuplot.write("unset label\n".encode()) gnuplot.write(("set label \"Best log2(C) = %s log2(gamma) = %s accuracy = %s%%\" \ at screen 0.5,0.85 center\n" % \ (best_log2c, best_log2g, best_rate)).encode()) gnuplot.write(("set label \"C = %s gamma = %s\"" " at screen 0.5,0.8 center\n" % (2**best_log2c, 2**best_log2g)).encode()) gnuplot.write("splot \"-\" with lines\n".encode()) db.sort(key = lambda x:(x[0], -x[1])) prevc = db[0][0] for line in db: if prevc != line[0]: gnuplot.write("\n".encode()) prevc = line[0] gnuplot.write(("%s %s %s\n" % line).encode()) gnuplot.write("e\n".encode()) gnuplot.write("\n".encode()) # force gnuplot back to prompt when term set failure gnuplot.flush() def calculate_jobs(): c_seq = permute_sequence(range_f(c_begin,c_end,c_step)) g_seq = permute_sequence(range_f(g_begin,g_end,g_step)) nr_c = float(len(c_seq)) nr_g = float(len(g_seq)) i = 0 j = 0 jobs = [] while i < nr_c or j < nr_g: if i/nr_c < j/nr_g: # increase C resolution line = [] for k in range(0,j): line.append((c_seq[i],g_seq[k])) i = i + 1 jobs.append(line) else: # increase g resolution line = [] for k in range(0,i): line.append((c_seq[k],g_seq[j])) j = j + 1 jobs.append(line) return jobs class WorkerStopToken: # used to notify the worker to stop pass class Worker(Thread): def __init__(self,name,job_queue,result_queue): Thread.__init__(self) self.name = name self.job_queue = job_queue self.result_queue = result_queue def run(self): while True: (cexp,gexp) = self.job_queue.get() if cexp is WorkerStopToken: self.job_queue.put((cexp,gexp)) # print 'worker %s stop.' % self.name break try: rate = self.run_one(2.0**cexp,2.0**gexp) if rate is None: raise RuntimeError("get no rate") except: # we failed, let others do that and we just quit traceback.print_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2]) self.job_queue.put((cexp,gexp)) print('worker %s quit.' % self.name) break else: self.result_queue.put((self.name,cexp,gexp,rate)) class LocalWorker(Worker): def run_one(self,c,g): cmdline = '%s -c %s -g %s -v %s %s %s' % \ (svmtrain_exe,c,g,fold,pass_through_string,dataset_pathname) result = Popen(cmdline,shell=True,stdout=PIPE).stdout for line in result.readlines(): if str(line).find("Cross") != -1: return float(line.split()[-1][0:-1]) class SSHWorker(Worker): def __init__(self,name,job_queue,result_queue,host): Worker.__init__(self,name,job_queue,result_queue) self.host = host self.cwd = os.getcwd() def run_one(self,c,g): cmdline = 'ssh -x %s "cd %s; %s -c %s -g %s -v %s %s %s"' % \ (self.host,self.cwd, svmtrain_exe,c,g,fold,pass_through_string,dataset_pathname) result = Popen(cmdline,shell=True,stdout=PIPE).stdout for line in result.readlines(): if str(line).find("Cross") != -1: return float(line.split()[-1][0:-1]) class TelnetWorker(Worker): def __init__(self,name,job_queue,result_queue,host,username,password): Worker.__init__(self,name,job_queue,result_queue) self.host = host self.username = username self.password = password def run(self): import telnetlib self.tn = tn = telnetlib.Telnet(self.host) tn.read_until("login: ") tn.write(self.username + "\n") tn.read_until("Password: ") tn.write(self.password + "\n") # XXX: how to know whether login is successful? tn.read_until(self.username) # print('login ok', self.host) tn.write("cd "+os.getcwd()+"\n") Worker.run(self) tn.write("exit\n") def run_one(self,c,g): cmdline = '%s -c %s -g %s -v %s %s %s' % \ (svmtrain_exe,c,g,fold,pass_through_string,dataset_pathname) result = self.tn.write(cmdline+'\n') (idx,matchm,output) = self.tn.expect(['Cross.*\n']) for line in output.split('\n'): if str(line).find("Cross") != -1: return float(line.split()[-1][0:-1]) def main(): # set parameters process_options() # put jobs in queue jobs = calculate_jobs() job_queue = Queue.Queue(0) result_queue = Queue.Queue(0) for line in jobs: for (c,g) in line: job_queue.put((c,g)) job_queue._put = job_queue.queue.appendleft # fire telnet workers if telnet_workers: nr_telnet_worker = len(telnet_workers) username = getpass.getuser() password = getpass.getpass() for host in telnet_workers: TelnetWorker(host,job_queue,result_queue, host,username,password).start() # fire ssh workers if ssh_workers: for host in ssh_workers: SSHWorker(host,job_queue,result_queue,host).start() # fire local workers for i in range(nr_local_worker): LocalWorker('local',job_queue,result_queue).start() # gather results done_jobs = {} result_file = open(out_filename, 'w') db = [] best_rate = -1 best_c1,best_g1 = None,None for line in jobs: for (c,g) in line: while (c, g) not in done_jobs: (worker,c1,g1,rate) = result_queue.get() done_jobs[(c1,g1)] = rate result_file.write('%s %s %s\n' %(c1,g1,rate)) result_file.flush() if (rate > best_rate) or (rate==best_rate and g1==best_g1 and c1<best_c1): best_rate = rate best_c1,best_g1=c1,g1 best_c = 2.0**c1 best_g = 2.0**g1 print("[%s] %s %s %s (best c=%s, g=%s, rate=%s)" % \ (worker,c1,g1,rate, best_c, best_g, best_rate)) db.append((c,g,done_jobs[(c,g)])) redraw(db,[best_c1, best_g1, best_rate]) redraw(db,[best_c1, best_g1, best_rate],True) job_queue.put((WorkerStopToken,None)) print("%s %s %s" % (best_c, best_g, best_rate)) main()
ajibawa-2023/Python-Code-Large/train/row_99311
245
359
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Import_L5_C0", "label": "os import os, sys, traceback", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0139, 0.0028, 0, 0.66, 0.0, 688, 0, 3, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os", "sys", "traceback"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os, sys, traceback"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Import_L6_C0", "label": "getpass import getpass", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0167, 0.0028, 0, 0.66, 0.0417, 784, 0, 1, 0, 0, 784, 0, 0], "semantic": {"name": "getpass", "arg_names": [], "import_names": ["getpass"], "rhs_call_name": "", "annotation": ""}, "snippet": "import getpass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:ImportFrom_L7_C0", "label": "from threading import Thread", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0195, 0.0028, 0, 0.66, 0.0833, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["Thread"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import Thread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:ImportFrom_L8_C0", "label": "from subprocess import *", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0223, 0.0028, 0, 0.66, 0.125, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from subprocess import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L10_C0", "label": "if", "type": "if", "loc": [10, 13], "level": 0, "parent": null, "vector": [4, 0, 0.032, 0.0111, 0, 0.66, 0.1667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if(sys.hexversion < 0x03000000):\n\timport Queue\nelse:\n\timport queue as Queue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Import_L11_C1", "label": "Queue import Queue", "type": "import", "loc": [11, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L10_C0", "vector": [1, 1, 0.0306, 0.0028, 1, 0.25, 0.0, 952, 0, 1, 0, 0, 952, 0, 0], "semantic": {"name": "Queue", "arg_names": [], "import_names": ["Queue"], "rhs_call_name": "", "annotation": ""}, "snippet": "\timport Queue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Import_L13_C1", "label": "queue import Queue", "type": "import", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L10_C0", "vector": [1, 1, 0.0362, 0.0028, 1, 0.25, 1.0, 325, 0, 1, 0, 0, 325, 0, 0], "semantic": {"name": "queue", "arg_names": [], "import_names": ["Queue"], "rhs_call_name": "", "annotation": ""}, "snippet": "\timport queue as Queue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L18_C0", "label": "is_win32 =", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.0501, 0.0028, 0, 0.66, 0.2083, 135, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "is_win32", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "is_win32 = (sys.platform == 'win32')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L19_C0", "label": "if", "type": "if", "loc": [19, 25], "level": 0, "parent": null, "vector": [4, 0, 0.0613, 0.0195, 0, 0.66, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if not is_win32:\n svmtrain_exe = \"../svm-train\"\n gnuplot_exe = \"/usr/bin/gnuplot\"\nelse:\n # example for windows\n svmtrain_exe = r\"..\\windows\\svm-train.exe\"\n gnuplot_exe = r\"c:\\tmp\\gnuplot\\bin\\pgnuplot.exe\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L20_C7", "label": "svmtrain_exe =", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L19_C0", "vector": [14, 1, 0.0557, 0.0028, 1, 0.2, 0.0, 415, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "svmtrain_exe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " svmtrain_exe = \"../svm-train\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L21_C7", "label": "gnuplot_exe =", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L19_C0", "vector": [14, 1, 0.0585, 0.0028, 1, 0.2, 0.3333, 797, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "gnuplot_exe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " gnuplot_exe = \"/usr/bin/gnuplot\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L24_C7", "label": "svmtrain_exe =", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L19_C0", "vector": [14, 1, 0.0669, 0.0028, 1, 0.2, 0.6667, 415, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "svmtrain_exe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " svmtrain_exe = r\"..\\windows\\svm-train.exe\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L25_C7", "label": "gnuplot_exe =", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L19_C0", "vector": [14, 1, 0.0696, 0.0028, 1, 0.2, 1.0, 797, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "gnuplot_exe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " gnuplot_exe = r\"c:\\tmp\\gnuplot\\bin\\pgnuplot.exe\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L29_C0", "label": "fold =", "type": "assigned_variable", "loc": [29, 29], "level": 0, "parent": null, "vector": [14, 0, 0.0808, 0.0028, 0, 0.66, 0.2917, 285, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "fold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "fold = 5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L30_C0", "label": "c_begin, c_end, c_step =", "type": "assigned_variable", "loc": [30, 30], "level": 0, "parent": null, "vector": [14, 0, 0.0836, 0.0028, 0, 0.66, 0.3333, 785, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "c_begin, c_end, c_step", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "c_begin, c_end, c_step = -5, 15, 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L31_C0", "label": "g_begin, g_end, g_step =", "type": "assigned_variable", "loc": [31, 31], "level": 0, "parent": null, "vector": [14, 0, 0.0864, 0.0028, 0, 0.66, 0.375, 864, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "g_begin, g_end, g_step", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "g_begin, g_end, g_step = 3, -15, -2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L37_C0", "label": "telnet_workers =", "type": "assigned_variable", "loc": [37, 37], "level": 0, "parent": null, "vector": [14, 0, 0.1031, 0.0028, 0, 0.66, 0.5, 544, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "telnet_workers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "telnet_workers = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L38_C0", "label": "ssh_workers =", "type": "assigned_variable", "loc": [38, 38], "level": 0, "parent": null, "vector": [14, 0, 0.1058, 0.0028, 0, 0.66, 0.5417, 643, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ssh_workers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ssh_workers = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L39_C0", "label": "nr_local_worker =", "type": "assigned_variable", "loc": [39, 39], "level": 0, "parent": null, "vector": [14, 0, 0.1086, 0.0028, 0, 0.66, 0.5833, 802, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "nr_local_worker", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "nr_local_worker = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L42_C0", "label": "process_options", "type": "function", "loc": [42, 100], "level": 0, "parent": null, "vector": [2, 0, 0.1978, 0.1643, 0, 0.66, 0.625, 955, 0, 1, 0, 0, 0, 0, 18], "semantic": {"name": "process_options", "arg_names": ["argv"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def process_options(argv=sys.argv):\n\n global fold\n global c_begin, c_end, c_step\n global g_begin, g_end, g_step\n global dataset_pathname, dataset_title, pass_through_string\n global svmtrain_exe, gnuplot_exe, gnuplot, out_filename, png_filename\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L50_C4", "label": "usage =", "type": "assigned_variable", "loc": [50, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L42_C0", "vector": [14, 1, 0.1435, 0.0111, 1, 0.21, 0.0, 129, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "usage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " usage = \"\"\"\\\nUsage: grid.py [-log2c begin,end,step] [-log2g begin,end,step] [-v fold] \n[-svmtrain pathname] [-gnuplot pathname] [-out pathname] [-png pathname]\n[additional parameters for svm-train] dataset\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L55_C4", "label": "if", "type": "if", "loc": [55, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L42_C0", "vector": [4, 1, 0.156, 0.0084, 1, 0.21, 0.1, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(argv) < 2:\n print(usage)\n sys.exit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L56_C8", "label": "print()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L55_C4", "vector": [8, 2, 0.156, 0.0028, 2, 0.65, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(usage)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L57_C8", "label": "exit()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L55_C4", "vector": [8, 2, 0.1588, 0.0028, 2, 0.65, 1.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L59_C4", "label": "dataset_pathname =", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L42_C0", "vector": [14, 1, 0.1643, 0.0028, 1, 0.21, 0.2, 66, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dataset_pathname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dataset_pathname = argv[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L60_C4", "label": "dataset_title =", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L42_C0", "vector": [14, 1, 0.1671, 0.0028, 1, 0.21, 0.3, 644, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "dataset_title", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dataset_title = os.path.split(dataset_pathname)[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L61_C4", "label": "out_filename =", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L42_C0", "vector": [14, 1, 0.1699, 0.0028, 1, 0.21, 0.4, 11, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "out_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " out_filename = '%s.out' % dataset_title"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L62_C4", "label": "png_filename =", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L42_C0", "vector": [14, 1, 0.1727, 0.0028, 1, 0.21, 0.5, 517, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "png_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " png_filename = '%s.png' % dataset_title"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L63_C4", "label": "pass_through_options =", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L42_C0", "vector": [14, 1, 0.1755, 0.0028, 1, 0.21, 0.6, 789, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pass_through_options", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pass_through_options = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L65_C4", "label": "i =", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L42_C0", "vector": [14, 1, 0.1811, 0.0028, 1, 0.21, 0.7, 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_99311:While_L66_C4", "label": "while", "type": "while", "loc": [66, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L42_C0", "vector": [5, 1, 0.2228, 0.0808, 1, 0.21, 0.8, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while i < len(argv) - 1:\n if argv[i] == \"-log2c\":\n i = i + 1\n (c_begin,c_end,c_step) = map(float,argv[i].split(\",\"))\n elif argv[i] == \"-log2g\":\n i = i + 1\n (g_begin,g_end,g_step) = map(float,argv[i].split(\",\"))\n elif argv[i] == \"-v\":"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L67_C8", "label": "if", "type": "if", "loc": [67, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L66_C4", "vector": [4, 2, 0.2228, 0.0752, 2, 0.78, 0.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if argv[i] == \"-log2c\":\n i = i + 1\n (c_begin,c_end,c_step) = map(float,argv[i].split(\",\"))\n elif argv[i] == \"-log2g\":\n i = i + 1\n (g_begin,g_end,g_step) = map(float,argv[i].split(\",\"))\n elif argv[i] == \"-v\":\n i = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L68_C12", "label": "i =", "type": "assigned_variable", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L67_C8", "vector": [14, 3, 0.1894, 0.0028, 3, 0.53, 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_99311:Assign_L69_C12", "label": "c_begin, c_end, c_step = map()", "type": "assigned_variable", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L67_C8", "vector": [14, 3, 0.1922, 0.0028, 3, 0.53, 0.5, 785, 3, 2, 0, 0, 53, 10, 2], "semantic": {"name": "c_begin, c_end, c_step", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " (c_begin,c_end,c_step) = map(float,argv[i].split(\",\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L70_C8", "label": "if", "type": "if", "loc": [70, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L67_C8", "vector": [4, 3, 0.227, 0.0669, 3, 0.53, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif argv[i] == \"-log2g\":\n i = i + 1\n (g_begin,g_end,g_step) = map(float,argv[i].split(\",\"))\n elif argv[i] == \"-v\":\n i = i + 1\n fold = argv[i]\n elif argv[i] in ('-c','-g'):\n print(\"Option -c and -g are renamed.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L71_C12", "label": "i =", "type": "assigned_variable", "loc": [71, 71], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L70_C8", "vector": [14, 4, 0.1978, 0.0028, 4, 0.9, 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_99311:Assign_L72_C12", "label": "g_begin, g_end, g_step = map()", "type": "assigned_variable", "loc": [72, 72], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L70_C8", "vector": [14, 4, 0.2006, 0.0028, 4, 0.9, 0.5, 864, 3, 2, 0, 0, 53, 10, 2], "semantic": {"name": "g_begin, g_end, g_step", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " (g_begin,g_end,g_step) = map(float,argv[i].split(\",\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L73_C8", "label": "if", "type": "if", "loc": [73, 93], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L70_C8", "vector": [4, 4, 0.2312, 0.0585, 4, 0.9, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif argv[i] == \"-v\":\n i = i + 1\n fold = argv[i]\n elif argv[i] in ('-c','-g'):\n print(\"Option -c and -g are renamed.\")\n print(usage)\n sys.exit(1)\n elif argv[i] == '-svmtrain':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L74_C12", "label": "i =", "type": "assigned_variable", "loc": [74, 74], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L73_C8", "vector": [14, 5, 0.2061, 0.0028, 5, 0.87, 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_99311:Assign_L75_C12", "label": "fold =", "type": "assigned_variable", "loc": [75, 75], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L73_C8", "vector": [14, 5, 0.2089, 0.0028, 5, 0.87, 0.5, 285, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fold = argv[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L76_C8", "label": "if", "type": "if", "loc": [76, 93], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L73_C8", "vector": [4, 5, 0.2354, 0.0501, 5, 0.87, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif argv[i] in ('-c','-g'):\n print(\"Option -c and -g are renamed.\")\n print(usage)\n sys.exit(1)\n elif argv[i] == '-svmtrain':\n i = i + 1\n svmtrain_exe = argv[i]\n elif argv[i] == '-gnuplot':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L77_C12", "label": "print()", "type": "expression", "loc": [77, 77], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L76_C8", "vector": [8, 6, 0.2145, 0.0028, 6, 0.26, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Option -c and -g are renamed.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L78_C12", "label": "print()", "type": "expression", "loc": [78, 78], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L76_C8", "vector": [8, 6, 0.2173, 0.0028, 6, 0.26, 0.3333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(usage)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L79_C12", "label": "exit()", "type": "expression", "loc": [79, 79], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L76_C8", "vector": [8, 6, 0.2201, 0.0028, 6, 0.26, 0.6667, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L80_C8", "label": "if", "type": "if", "loc": [80, 93], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L76_C8", "vector": [4, 6, 0.2409, 0.039, 6, 0.26, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif argv[i] == '-svmtrain':\n i = i + 1\n svmtrain_exe = argv[i]\n elif argv[i] == '-gnuplot':\n i = i + 1\n gnuplot_exe = argv[i]\n elif argv[i] == '-out':\n i = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L81_C12", "label": "i =", "type": "assigned_variable", "loc": [81, 81], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L80_C8", "vector": [14, 7, 0.2256, 0.0028, 7, 0.91, 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_99311:Assign_L82_C12", "label": "svmtrain_exe =", "type": "assigned_variable", "loc": [82, 82], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L80_C8", "vector": [14, 7, 0.2284, 0.0028, 7, 0.91, 0.5, 415, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "svmtrain_exe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " svmtrain_exe = argv[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L83_C8", "label": "if", "type": "if", "loc": [83, 93], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L80_C8", "vector": [4, 7, 0.2451, 0.0306, 7, 0.91, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif argv[i] == '-gnuplot':\n i = i + 1\n gnuplot_exe = argv[i]\n elif argv[i] == '-out':\n i = i + 1\n out_filename = argv[i]\n elif argv[i] == '-png':\n i = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L84_C12", "label": "i =", "type": "assigned_variable", "loc": [84, 84], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L83_C8", "vector": [14, 8, 0.234, 0.0028, 8, 0.95, 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_99311:Assign_L85_C12", "label": "gnuplot_exe =", "type": "assigned_variable", "loc": [85, 85], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L83_C8", "vector": [14, 8, 0.2368, 0.0028, 8, 0.95, 0.5, 797, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "gnuplot_exe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " gnuplot_exe = argv[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L86_C8", "label": "if", "type": "if", "loc": [86, 93], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L83_C8", "vector": [4, 8, 0.2493, 0.0223, 8, 0.95, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif argv[i] == '-out':\n i = i + 1\n out_filename = argv[i]\n elif argv[i] == '-png':\n i = i + 1\n png_filename = argv[i]\n else:\n pass_through_options.append(argv[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L87_C12", "label": "i =", "type": "assigned_variable", "loc": [87, 87], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L86_C8", "vector": [14, 9, 0.2423, 0.0028, 9, 0.38, 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_99311:Assign_L88_C12", "label": "out_filename =", "type": "assigned_variable", "loc": [88, 88], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L86_C8", "vector": [14, 9, 0.2451, 0.0028, 9, 0.38, 0.5, 11, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "out_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " out_filename = argv[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L89_C8", "label": "if", "type": "if", "loc": [89, 93], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L86_C8", "vector": [4, 9, 0.2535, 0.0139, 9, 0.38, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif argv[i] == '-png':\n i = i + 1\n png_filename = argv[i]\n else:\n pass_through_options.append(argv[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L90_C12", "label": "i =", "type": "assigned_variable", "loc": [90, 90], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L89_C8", "vector": [14, 10, 0.2507, 0.0028, 10, 0.74, 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_99311:Assign_L91_C12", "label": "png_filename =", "type": "assigned_variable", "loc": [91, 91], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L89_C8", "vector": [14, 10, 0.2535, 0.0028, 10, 0.74, 0.5, 517, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "png_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " png_filename = argv[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L93_C12", "label": "append()", "type": "expression", "loc": [93, 93], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L89_C8", "vector": [8, 10, 0.2591, 0.0028, 10, 0.74, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " pass_through_options.append(argv[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L94_C8", "label": "i =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L66_C4", "vector": [14, 2, 0.2618, 0.0028, 2, 0.78, 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_99311:Assign_L96_C4", "label": "pass_through_string = join()", "type": "assigned_variable", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L42_C0", "vector": [14, 1, 0.2674, 0.0028, 1, 0.21, 0.9, 905, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "pass_through_string", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " pass_through_string = \" \".join(pass_through_options)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L100_C4", "label": "gnuplot =", "type": "assigned_variable", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L42_C0", "vector": [14, 1, 0.2786, 0.0028, 1, 0.21, 1.0, 41, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "gnuplot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " gnuplot = Popen(gnuplot_exe,stdin = PIPE).stdin"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L103_C0", "label": "range_f", "type": "function", "loc": [103, 111], "level": 0, "parent": null, "vector": [2, 0, 0.2981, 0.0251, 0, 0.66, 0.6667, 281, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "range_f", "arg_names": ["begin", "end", "step"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def range_f(begin,end,step):\n # like range, but works on non-integer too\n seq = []\n while True:\n if step > 0 and begin > end: break\n if step < 0 and begin < end: break\n seq.append(begin)\n begin = begin + step"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L105_C4", "label": "seq =", "type": "assigned_variable", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L103_C0", "vector": [14, 1, 0.2925, 0.0028, 1, 0.72, 0.0, 609, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "seq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " seq = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L106_C4", "label": "while", "type": "while", "loc": [106, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L103_C0", "vector": [5, 1, 0.3008, 0.0139, 1, 0.72, 0.5, 0, 1, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while True:\n if step > 0 and begin > end: break\n if step < 0 and begin < end: break\n seq.append(begin)\n begin = begin + step"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L107_C8", "label": "if", "type": "if", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L106_C4", "vector": [4, 2, 0.2981, 0.0028, 2, 0.5, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if step > 0 and begin > end: break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L108_C8", "label": "if", "type": "if", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L106_C4", "vector": [4, 2, 0.3008, 0.0028, 2, 0.5, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if step < 0 and begin < end: break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L109_C8", "label": "append()", "type": "expression", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L106_C4", "vector": [8, 2, 0.3036, 0.0028, 2, 0.5, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " seq.append(begin)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L110_C8", "label": "begin =", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L106_C4", "vector": [14, 2, 0.3064, 0.0028, 2, 0.5, 1.0, 969, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "begin", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " begin = begin + step"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Return_L111_C4", "label": "return", "type": "return", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L103_C0", "vector": [13, 1, 0.3092, 0.0028, 1, 0.72, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return seq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L113_C0", "label": "permute_sequence", "type": "function", "loc": [113, 126], "level": 0, "parent": null, "vector": [2, 0, 0.3329, 0.039, 0, 0.66, 0.7083, 792, 0, 1, 1, 0, 0, 0, 8], "semantic": {"name": "permute_sequence", "arg_names": ["seq"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def permute_sequence(seq):\n n = len(seq)\n if n <= 1: return seq\n\n mid = int(n/2)\n left = permute_sequence(seq[:mid])\n right = permute_sequence(seq[mid+1:])\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L114_C4", "label": "n = len()", "type": "assigned_variable", "loc": [114, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L113_C0", "vector": [14, 1, 0.3175, 0.0028, 1, 0.64, 0.0, 773, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n = len(seq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L115_C4", "label": "if", "type": "if", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L113_C0", "vector": [4, 1, 0.3203, 0.0028, 1, 0.64, 0.1429, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n <= 1: return seq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Return_L115_C15", "label": "return", "type": "return", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L115_C4", "vector": [13, 2, 0.3203, 0.0028, 2, 0.36, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n <= 1: return seq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L117_C4", "label": "mid = int()", "type": "assigned_variable", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L113_C0", "vector": [14, 1, 0.3259, 0.0028, 1, 0.64, 0.2857, 254, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "mid", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " mid = int(n/2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L118_C4", "label": "left = permute_sequence()", "type": "assigned_variable", "loc": [118, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L113_C0", "vector": [14, 1, 0.3287, 0.0028, 1, 0.64, 0.4286, 605, 3, 1, 0, 0, 792, 10, 1], "semantic": {"name": "left", "arg_names": [], "import_names": [], "rhs_call_name": "permute_sequence", "annotation": ""}, "snippet": " left = permute_sequence(seq[:mid])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L119_C4", "label": "right = permute_sequence()", "type": "assigned_variable", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L113_C0", "vector": [14, 1, 0.3315, 0.0028, 1, 0.64, 0.5714, 724, 3, 1, 0, 0, 792, 10, 1], "semantic": {"name": "right", "arg_names": [], "import_names": [], "rhs_call_name": "permute_sequence", "annotation": ""}, "snippet": " right = permute_sequence(seq[mid+1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L121_C4", "label": "ret =", "type": "assigned_variable", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L113_C0", "vector": [14, 1, 0.337, 0.0028, 1, 0.64, 0.7143, 501, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret = [seq[mid]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L122_C4", "label": "while", "type": "while", "loc": [122, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L113_C0", "vector": [5, 1, 0.3426, 0.0084, 1, 0.64, 0.8571, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while left or right:\n if left: ret.append(left.pop(0))\n if right: ret.append(right.pop(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L123_C8", "label": "if", "type": "if", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L122_C4", "vector": [4, 2, 0.3426, 0.0028, 2, 0.19, 0.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if left: ret.append(left.pop(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L123_C17", "label": "append()", "type": "expression", "loc": [123, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L123_C8", "vector": [8, 3, 0.3426, 0.0028, 3, 0.69, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " if left: ret.append(left.pop(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L124_C8", "label": "if", "type": "if", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L122_C4", "vector": [4, 2, 0.3454, 0.0028, 2, 0.19, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if right: ret.append(right.pop(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L124_C18", "label": "append()", "type": "expression", "loc": [124, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L124_C8", "vector": [8, 3, 0.3454, 0.0028, 3, 0.4, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " if right: ret.append(right.pop(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Return_L126_C4", "label": "return", "type": "return", "loc": [126, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L113_C0", "vector": [13, 1, 0.351, 0.0028, 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 ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "label": "redraw", "type": "function", "loc": [128, 175], "level": 0, "parent": null, "vector": [2, 0, 0.422, 0.1337, 0, 0.66, 0.75, 870, 0, 3, 0, 0, 0, 0, 50], "semantic": {"name": "redraw", "arg_names": ["db", "best_param", "tofile"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def redraw(db,best_param,tofile=False):\n if len(db) == 0: return\n begin_level = round(max(x[2] for x in db)) - 3\n step_size = 0.5\n\n best_log2c,best_log2g,best_rate = best_param\n\n if tofile:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L129_C4", "label": "if", "type": "if", "loc": [129, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [4, 1, 0.3593, 0.0028, 1, 0.46, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(db) == 0: return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Return_L129_C21", "label": "return", "type": "return", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L129_C4", "vector": [13, 2, 0.3593, 0.0028, 2, 0.11, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(db) == 0: return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L130_C4", "label": "begin_level =", "type": "assigned_variable", "loc": [130, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [14, 1, 0.3621, 0.0028, 1, 0.46, 0.0417, 906, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "begin_level", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " begin_level = round(max(x[2] for x in db)) - 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L131_C4", "label": "step_size =", "type": "assigned_variable", "loc": [131, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [14, 1, 0.3649, 0.0028, 1, 0.46, 0.0833, 764, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "step_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " step_size = 0.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L133_C4", "label": "best_log2c, best_log2g, best_rate =", "type": "assigned_variable", "loc": [133, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [14, 1, 0.3705, 0.0028, 1, 0.46, 0.125, 215, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "best_log2c, best_log2g, best_rate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " best_log2c,best_log2g,best_rate = best_param"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L135_C4", "label": "if", "type": "if", "loc": [135, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [4, 1, 0.3872, 0.0251, 1, 0.46, 0.1667, 0, 2, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tofile:\n gnuplot.write( \"set term png transparent small\\n\".encode())\n gnuplot.write( (\"set output \\\"%s\\\"\\n\" % png_filename.replace('\\\\','\\\\\\\\')).encode())\n #gnuplot.write(\"set term postscript color solid\\n\".encode())\n #gnuplot.write((\"set output \\\"%s.ps\\\"\\n\" % dataset_title).encode())\n elif is_win32:\n gnuplot.write(\"set term windows\\n\".encode())\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L136_C8", "label": "write()", "type": "expression", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L135_C4", "vector": [8, 2, 0.3788, 0.0028, 2, 0.64, 0.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " gnuplot.write( \"set term png transparent small\\n\".encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L137_C8", "label": "write()", "type": "expression", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L135_C4", "vector": [8, 2, 0.3816, 0.0028, 2, 0.64, 0.5, 837, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " gnuplot.write( (\"set output \\\"%s\\\"\\n\" % png_filename.replace('\\\\','\\\\\\\\')).encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L140_C4", "label": "if", "type": "if", "loc": [140, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L135_C4", "vector": [4, 2, 0.3942, 0.0111, 2, 0.64, 1.0, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif is_win32:\n gnuplot.write(\"set term windows\\n\".encode())\n else:\n gnuplot.write( \"set term x11\\n\".encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L141_C8", "label": "write()", "type": "expression", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L140_C4", "vector": [8, 3, 0.3928, 0.0028, 3, 0.15, 0.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " gnuplot.write(\"set term windows\\n\".encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L143_C8", "label": "write()", "type": "expression", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L140_C4", "vector": [8, 3, 0.3983, 0.0028, 3, 0.15, 1.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " gnuplot.write( \"set term x11\\n\".encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L144_C4", "label": "write()", "type": "expression", "loc": [144, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [8, 1, 0.4011, 0.0028, 1, 0.46, 0.2083, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " gnuplot.write(\"set xlabel \\\"log2(C)\\\"\\n\".encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L145_C4", "label": "write()", "type": "expression", "loc": [145, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [8, 1, 0.4039, 0.0028, 1, 0.46, 0.25, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " gnuplot.write(\"set ylabel \\\"log2(gamma)\\\"\\n\".encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L146_C4", "label": "write()", "type": "expression", "loc": [146, 146], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [8, 1, 0.4067, 0.0028, 1, 0.46, 0.2917, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " gnuplot.write((\"set xrange [%s:%s]\\n\" % (c_begin,c_end)).encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L147_C4", "label": "write()", "type": "expression", "loc": [147, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [8, 1, 0.4095, 0.0028, 1, 0.46, 0.3333, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " gnuplot.write((\"set yrange [%s:%s]\\n\" % (g_begin,g_end)).encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L148_C4", "label": "write()", "type": "expression", "loc": [148, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [8, 1, 0.4123, 0.0028, 1, 0.46, 0.375, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " gnuplot.write(\"set contour\\n\".encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L149_C4", "label": "write()", "type": "expression", "loc": [149, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [8, 1, 0.415, 0.0028, 1, 0.46, 0.4167, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " gnuplot.write((\"set cntrparam levels incremental %s,%s,100\\n\" % (begin_level,step_size)).encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L150_C4", "label": "write()", "type": "expression", "loc": [150, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [8, 1, 0.4178, 0.0028, 1, 0.46, 0.4583, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " gnuplot.write(\"unset surface\\n\".encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L151_C4", "label": "write()", "type": "expression", "loc": [151, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [8, 1, 0.4206, 0.0028, 1, 0.46, 0.5, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " gnuplot.write(\"unset ztics\\n\".encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L152_C4", "label": "write()", "type": "expression", "loc": [152, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [8, 1, 0.4234, 0.0028, 1, 0.46, 0.5417, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " gnuplot.write(\"set view 0,0\\n\".encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L153_C4", "label": "write()", "type": "expression", "loc": [153, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [8, 1, 0.4262, 0.0028, 1, 0.46, 0.5833, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " gnuplot.write((\"set title \\\"%s\\\"\\n\" % dataset_title).encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L154_C4", "label": "write()", "type": "expression", "loc": [154, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [8, 1, 0.429, 0.0028, 1, 0.46, 0.625, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " gnuplot.write(\"unset label\\n\".encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L155_C4", "label": "write()", "type": "expression", "loc": [155, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [8, 1, 0.4345, 0.0084, 1, 0.46, 0.6667, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " gnuplot.write((\"set label \\\"Best log2(C) = %s log2(gamma) = %s accuracy = %s%%\\\" \\\n at screen 0.5,0.85 center\\n\" % \\\n (best_log2c, best_log2g, best_rate)).encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L158_C4", "label": "write()", "type": "expression", "loc": [158, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [8, 1, 0.4415, 0.0056, 1, 0.46, 0.7083, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " gnuplot.write((\"set label \\\"C = %s gamma = %s\\\"\"\n \" at screen 0.5,0.8 center\\n\" % (2**best_log2c, 2**best_log2g)).encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L160_C4", "label": "write()", "type": "expression", "loc": [160, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [8, 1, 0.4457, 0.0028, 1, 0.46, 0.75, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " gnuplot.write(\"splot \\\"-\\\" with lines\\n\".encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L165_C4", "label": "sort()", "type": "expression", "loc": [165, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [8, 1, 0.4596, 0.0028, 1, 0.46, 0.7917, 489, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " db.sort(key = lambda x:(x[0], -x[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L167_C4", "label": "prevc =", "type": "assigned_variable", "loc": [167, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [14, 1, 0.4652, 0.0028, 1, 0.46, 0.8333, 516, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prevc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prevc = db[0][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L168_C4", "label": "for line", "type": "for", "loc": [168, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [6, 1, 0.4735, 0.0139, 1, 0.46, 0.875, 373, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for line in db:\n if prevc != line[0]:\n gnuplot.write(\"\\n\".encode())\n prevc = line[0]\n gnuplot.write((\"%s %s %s\\n\" % line).encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L169_C8", "label": "if", "type": "if", "loc": [169, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L168_C4", "vector": [4, 2, 0.4735, 0.0084, 2, 0.48, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if prevc != line[0]:\n gnuplot.write(\"\\n\".encode())\n prevc = line[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L170_C12", "label": "write()", "type": "expression", "loc": [170, 170], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L169_C8", "vector": [8, 3, 0.4735, 0.0028, 3, 0.61, 0.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " gnuplot.write(\"\\n\".encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L171_C12", "label": "prevc =", "type": "assigned_variable", "loc": [171, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L169_C8", "vector": [14, 3, 0.4763, 0.0028, 3, 0.61, 1.0, 516, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prevc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prevc = line[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L172_C8", "label": "write()", "type": "expression", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L168_C4", "vector": [8, 2, 0.4791, 0.0028, 2, 0.48, 1.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " gnuplot.write((\"%s %s %s\\n\" % line).encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L173_C4", "label": "write()", "type": "expression", "loc": [173, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [8, 1, 0.4819, 0.0028, 1, 0.46, 0.9167, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " gnuplot.write(\"e\\n\".encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L174_C4", "label": "write()", "type": "expression", "loc": [174, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [8, 1, 0.4847, 0.0028, 1, 0.46, 0.9583, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " gnuplot.write(\"\\n\".encode()) # force gnuplot back to prompt when term set failure"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L175_C4", "label": "flush()", "type": "expression", "loc": [175, 175], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "vector": [8, 1, 0.4875, 0.0028, 1, 0.46, 1.0, 439, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "flush", "arg_names": [], "import_names": [], "rhs_call_name": "flush", "annotation": ""}, "snippet": " gnuplot.flush()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L178_C0", "label": "calculate_jobs", "type": "function", "loc": [178, 202], "level": 0, "parent": null, "vector": [2, 0, 0.5292, 0.0696, 0, 0.66, 0.7917, 576, 0, 0, 1, 0, 0, 0, 14], "semantic": {"name": "calculate_jobs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def calculate_jobs():\n c_seq = permute_sequence(range_f(c_begin,c_end,c_step))\n g_seq = permute_sequence(range_f(g_begin,g_end,g_step))\n nr_c = float(len(c_seq))\n nr_g = float(len(g_seq))\n i = 0\n j = 0\n jobs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L179_C4", "label": "c_seq = permute_sequence()", "type": "assigned_variable", "loc": [179, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L178_C0", "vector": [14, 1, 0.4986, 0.0028, 1, 0.25, 0.0, 2, 3, 1, 0, 0, 792, 10, 2], "semantic": {"name": "c_seq", "arg_names": [], "import_names": [], "rhs_call_name": "permute_sequence", "annotation": ""}, "snippet": " c_seq = permute_sequence(range_f(c_begin,c_end,c_step))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L180_C4", "label": "g_seq = permute_sequence()", "type": "assigned_variable", "loc": [180, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L178_C0", "vector": [14, 1, 0.5014, 0.0028, 1, 0.25, 0.125, 445, 3, 1, 0, 0, 792, 10, 2], "semantic": {"name": "g_seq", "arg_names": [], "import_names": [], "rhs_call_name": "permute_sequence", "annotation": ""}, "snippet": " g_seq = permute_sequence(range_f(g_begin,g_end,g_step))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L181_C4", "label": "nr_c = float()", "type": "assigned_variable", "loc": [181, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L178_C0", "vector": [14, 1, 0.5042, 0.0028, 1, 0.25, 0.25, 796, 3, 1, 0, 0, 639, 10, 2], "semantic": {"name": "nr_c", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": " nr_c = float(len(c_seq))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L182_C4", "label": "nr_g = float()", "type": "assigned_variable", "loc": [182, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L178_C0", "vector": [14, 1, 0.507, 0.0028, 1, 0.25, 0.375, 254, 3, 1, 0, 0, 639, 10, 2], "semantic": {"name": "nr_g", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": " nr_g = float(len(g_seq))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L183_C4", "label": "i =", "type": "assigned_variable", "loc": [183, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L178_C0", "vector": [14, 1, 0.5097, 0.0028, 1, 0.25, 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_99311:Assign_L184_C4", "label": "j =", "type": "assigned_variable", "loc": [184, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L178_C0", "vector": [14, 1, 0.5125, 0.0028, 1, 0.25, 0.625, 100, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " j = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L185_C4", "label": "jobs =", "type": "assigned_variable", "loc": [185, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L178_C0", "vector": [14, 1, 0.5153, 0.0028, 1, 0.25, 0.75, 755, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "jobs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jobs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L187_C4", "label": "while", "type": "while", "loc": [187, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L178_C0", "vector": [5, 1, 0.5404, 0.0418, 1, 0.25, 0.875, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while i < nr_c or j < nr_g:\n if i/nr_c < j/nr_g:\n # increase C resolution\n line = []\n for k in range(0,j):\n line.append((c_seq[i],g_seq[k]))\n i = i + 1\n jobs.append(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L188_C8", "label": "if", "type": "if", "loc": [188, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L187_C4", "vector": [4, 2, 0.5418, 0.039, 2, 0.79, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i/nr_c < j/nr_g:\n # increase C resolution\n line = []\n for k in range(0,j):\n line.append((c_seq[i],g_seq[k]))\n i = i + 1\n jobs.append(line)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L190_C12", "label": "line =", "type": "assigned_variable", "loc": [190, 190], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L188_C8", "vector": [14, 3, 0.5292, 0.0028, 3, 0.14, 0.0, 373, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " line = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L191_C12", "label": "for k", "type": "for", "loc": [191, 192], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L188_C8", "vector": [6, 3, 0.5334, 0.0056, 3, 0.14, 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 range(0,j):\n line.append((c_seq[i],g_seq[k]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L192_C16", "label": "append()", "type": "expression", "loc": [192, 192], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L191_C12", "vector": [8, 4, 0.5348, 0.0028, 4, 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": " line.append((c_seq[i],g_seq[k]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L193_C12", "label": "i =", "type": "assigned_variable", "loc": [193, 193], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L188_C8", "vector": [14, 3, 0.5376, 0.0028, 3, 0.14, 0.2857, 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_99311:Expr_L194_C12", "label": "append()", "type": "expression", "loc": [194, 194], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L188_C8", "vector": [8, 3, 0.5404, 0.0028, 3, 0.14, 0.4286, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " jobs.append(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L197_C12", "label": "line =", "type": "assigned_variable", "loc": [197, 197], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L188_C8", "vector": [14, 3, 0.5487, 0.0028, 3, 0.14, 0.5714, 373, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " line = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L198_C12", "label": "for k", "type": "for", "loc": [198, 199], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L188_C8", "vector": [6, 3, 0.5529, 0.0056, 3, 0.14, 0.7143, 954, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in range(0,i):\n line.append((c_seq[k],g_seq[j]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L199_C16", "label": "append()", "type": "expression", "loc": [199, 199], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L198_C12", "vector": [8, 4, 0.5543, 0.0028, 4, 0.77, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " line.append((c_seq[k],g_seq[j]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L200_C12", "label": "j =", "type": "assigned_variable", "loc": [200, 200], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L188_C8", "vector": [14, 3, 0.5571, 0.0028, 3, 0.14, 0.8571, 100, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " j = j + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L201_C12", "label": "append()", "type": "expression", "loc": [201, 201], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L188_C8", "vector": [8, 3, 0.5599, 0.0028, 3, 0.14, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " jobs.append(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Return_L202_C4", "label": "return", "type": "return", "loc": [202, 202], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L178_C0", "vector": [13, 1, 0.5627, 0.0028, 1, 0.25, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return jobs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:ClassDef_L204_C0", "label": "WorkerStopToken", "type": "class", "loc": [204, 205], "level": 0, "parent": null, "vector": [3, 0, 0.5696, 0.0056, 0, 0.66, 0.8333, 12, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "WorkerStopToken", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class WorkerStopToken: # used to notify the worker to stop\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:ClassDef_L207_C0", "label": "Worker", "type": "class", "loc": [207, 232], "level": 0, "parent": null, "vector": [3, 0, 0.6114, 0.0724, 0, 0.66, 0.875, 570, 0, 2, 0, 0, 134, 0, 12], "semantic": {"name": "Worker", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Worker(Thread):\n def __init__(self,name,job_queue,result_queue):\n Thread.__init__(self)\n self.name = name\n self.job_queue = job_queue\n self.result_queue = result_queue\n def run(self):\n while True:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L208_C4", "label": "__init__", "type": "function", "loc": [208, 212], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:ClassDef_L207_C0", "vector": [2, 1, 0.585, 0.0139, 1, 0.98, 0.0, 555, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "name", "job_queue", "result_queue"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self,name,job_queue,result_queue):\n Thread.__init__(self)\n self.name = name\n self.job_queue = job_queue\n self.result_queue = result_queue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L209_C8", "label": "__init__()", "type": "expression", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L208_C4", "vector": [8, 2, 0.5822, 0.0028, 2, 0.51, 0.0, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Thread.__init__(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L210_C8", "label": "self.name =", "type": "assigned_variable", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L208_C4", "vector": [14, 2, 0.585, 0.0028, 2, 0.51, 0.3333, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L211_C8", "label": "self.job_queue =", "type": "assigned_variable", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L208_C4", "vector": [14, 2, 0.5877, 0.0028, 2, 0.51, 0.6667, 285, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.job_queue", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.job_queue = job_queue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L212_C8", "label": "self.result_queue =", "type": "assigned_variable", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L208_C4", "vector": [14, 2, 0.5905, 0.0028, 2, 0.51, 1.0, 77, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.result_queue", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.result_queue = result_queue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L213_C4", "label": "run", "type": "function", "loc": [213, 232], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:ClassDef_L207_C0", "vector": [2, 1, 0.6198, 0.0557, 1, 0.98, 1.0, 679, 0, 1, 0, 0, 0, 0, 11], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run(self):\n while True:\n (cexp,gexp) = self.job_queue.get()\n if cexp is WorkerStopToken:\n self.job_queue.put((cexp,gexp))\n # print 'worker %s stop.' % self.name\n break\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L214_C8", "label": "while", "type": "while", "loc": [214, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L213_C4", "vector": [5, 2, 0.6212, 0.0529, 2, 0.96, 0.0, 0, 1, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while True:\n (cexp,gexp) = self.job_queue.get()\n if cexp is WorkerStopToken:\n self.job_queue.put((cexp,gexp))\n # print 'worker %s stop.' % self.name\n break\n try:\n rate = self.run_one(2.0**cexp,2.0**gexp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L215_C12", "label": "cexp, gexp = get()", "type": "assigned_variable", "loc": [215, 215], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L214_C8", "vector": [14, 3, 0.5989, 0.0028, 3, 0.17, 0.0, 443, 3, 0, 0, 0, 607, 10, 1], "semantic": {"name": "cexp, gexp", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " (cexp,gexp) = self.job_queue.get()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L216_C12", "label": "if", "type": "if", "loc": [216, 219], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L214_C8", "vector": [4, 3, 0.6058, 0.0111, 3, 0.17, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cexp is WorkerStopToken:\n self.job_queue.put((cexp,gexp))\n # print 'worker %s stop.' % self.name\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L217_C16", "label": "put()", "type": "expression", "loc": [217, 217], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L216_C12", "vector": [8, 4, 0.6045, 0.0028, 4, 0.57, 0.0, 636, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "put", "arg_names": [], "import_names": [], "rhs_call_name": "put", "annotation": ""}, "snippet": " self.job_queue.put((cexp,gexp))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Try_L220_C12", "label": "try", "type": "try", "loc": [220, 232], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L214_C8", "vector": [7, 3, 0.6295, 0.0362, 3, 0.17, 1.0, 0, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rate = self.run_one(2.0**cexp,2.0**gexp)\n if rate is None: raise RuntimeError(\"get no rate\")\n except:\n # we failed, let others do that and we just quit\n \n traceback.print_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2])\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L221_C16", "label": "rate = run_one()", "type": "assigned_variable", "loc": [221, 221], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:Try_L220_C12", "vector": [14, 4, 0.6156, 0.0028, 4, 0.96, 0.0, 477, 3, 2, 0, 0, 315, 10, 1], "semantic": {"name": "rate", "arg_names": [], "import_names": [], "rhs_call_name": "run_one", "annotation": ""}, "snippet": " rate = self.run_one(2.0**cexp,2.0**gexp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L222_C16", "label": "if", "type": "if", "loc": [222, 222], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:Try_L220_C12", "vector": [4, 4, 0.6184, 0.0028, 4, 0.96, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rate is None: raise RuntimeError(\"get no rate\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L226_C16", "label": "print_exception()", "type": "expression", "loc": [226, 226], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:Try_L220_C12", "vector": [8, 4, 0.6295, 0.0028, 4, 0.96, 0.0, 393, 3, 3, 0, 0, 0, 0, 4], "semantic": {"name": "print_exception", "arg_names": [], "import_names": [], "rhs_call_name": "print_exception", "annotation": ""}, "snippet": " traceback.print_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L228_C16", "label": "put()", "type": "expression", "loc": [228, 228], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:Try_L220_C12", "vector": [8, 4, 0.6351, 0.0028, 4, 0.96, 0.5, 636, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "put", "arg_names": [], "import_names": [], "rhs_call_name": "put", "annotation": ""}, "snippet": " self.job_queue.put((cexp,gexp))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L229_C16", "label": "print()", "type": "expression", "loc": [229, 229], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:Try_L220_C12", "vector": [8, 4, 0.6379, 0.0028, 4, 0.96, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('worker %s quit.' % self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L232_C16", "label": "put()", "type": "expression", "loc": [232, 232], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:Try_L220_C12", "vector": [8, 4, 0.6462, 0.0028, 4, 0.96, 1.0, 636, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "put", "arg_names": [], "import_names": [], "rhs_call_name": "put", "annotation": ""}, "snippet": " self.result_queue.put((self.name,cexp,gexp,rate))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:ClassDef_L234_C0", "label": "LocalWorker", "type": "class", "loc": [234, 241], "level": 0, "parent": null, "vector": [3, 0, 0.6616, 0.0223, 0, 0.66, 0.9167, 864, 0, 1, 0, 0, 570, 0, 6], "semantic": {"name": "LocalWorker", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class LocalWorker(Worker):\n def run_one(self,c,g):\n cmdline = '%s -c %s -g %s -v %s %s %s' % \\\n (svmtrain_exe,c,g,fold,pass_through_string,dataset_pathname)\n result = Popen(cmdline,shell=True,stdout=PIPE).stdout\n for line in result.readlines():\n if str(line).find(\"Cross\") != -1:\n return float(line.split()[-1][0:-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L235_C4", "label": "run_one", "type": "function", "loc": [235, 241], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:ClassDef_L234_C0", "vector": [2, 1, 0.663, 0.0195, 1, 0.91, 0.0, 315, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "run_one", "arg_names": ["self", "c", "g"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run_one(self,c,g):\n cmdline = '%s -c %s -g %s -v %s %s %s' % \\\n (svmtrain_exe,c,g,fold,pass_through_string,dataset_pathname)\n result = Popen(cmdline,shell=True,stdout=PIPE).stdout\n for line in result.readlines():\n if str(line).find(\"Cross\") != -1:\n return float(line.split()[-1][0:-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L236_C8", "label": "cmdline =", "type": "assigned_variable", "loc": [236, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L235_C4", "vector": [14, 2, 0.6588, 0.0056, 2, 0.47, 0.0, 83, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cmdline", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cmdline = '%s -c %s -g %s -v %s %s %s' % \\\n (svmtrain_exe,c,g,fold,pass_through_string,dataset_pathname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L238_C8", "label": "result =", "type": "assigned_variable", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L235_C4", "vector": [14, 2, 0.663, 0.0028, 2, 0.47, 0.5, 51, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = Popen(cmdline,shell=True,stdout=PIPE).stdout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L239_C8", "label": "for line", "type": "for", "loc": [239, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L235_C4", "vector": [6, 2, 0.6685, 0.0084, 2, 0.47, 1.0, 373, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for line in result.readlines():\n if str(line).find(\"Cross\") != -1:\n return float(line.split()[-1][0:-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L240_C12", "label": "if", "type": "if", "loc": [240, 241], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L239_C8", "vector": [4, 3, 0.6699, 0.0056, 3, 0.65, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if str(line).find(\"Cross\") != -1:\n return float(line.split()[-1][0:-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Return_L241_C16", "label": "return", "type": "return", "loc": [241, 241], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L240_C12", "vector": [13, 4, 0.6713, 0.0028, 4, 0.34, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return float(line.split()[-1][0:-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:ClassDef_L243_C0", "label": "SSHWorker", "type": "class", "loc": [243, 255], "level": 0, "parent": null, "vector": [3, 0, 0.6936, 0.0362, 0, 0.66, 0.9583, 21, 0, 2, 0, 0, 570, 0, 8], "semantic": {"name": "SSHWorker", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SSHWorker(Worker):\n def __init__(self,name,job_queue,result_queue,host):\n Worker.__init__(self,name,job_queue,result_queue)\n self.host = host\n self.cwd = os.getcwd()\n def run_one(self,c,g):\n cmdline = 'ssh -x %s \"cd %s; %s -c %s -g %s -v %s %s %s\"' % \\\n (self.host,self.cwd,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L244_C4", "label": "__init__", "type": "function", "loc": [244, 247], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:ClassDef_L243_C0", "vector": [2, 1, 0.6838, 0.0111, 1, 0.4, 0.0, 555, 0, 5, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "name", "job_queue", "result_queue", "host"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self,name,job_queue,result_queue,host):\n Worker.__init__(self,name,job_queue,result_queue)\n self.host = host\n self.cwd = os.getcwd()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L245_C8", "label": "__init__()", "type": "expression", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L244_C4", "vector": [8, 2, 0.6825, 0.0028, 2, 0.91, 0.0, 555, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Worker.__init__(self,name,job_queue,result_queue)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L246_C8", "label": "self.host =", "type": "assigned_variable", "loc": [246, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L244_C4", "vector": [14, 2, 0.6852, 0.0028, 2, 0.91, 0.5, 445, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.host", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.host = host"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L247_C8", "label": "self.cwd = getcwd()", "type": "assigned_variable", "loc": [247, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L244_C4", "vector": [14, 2, 0.688, 0.0028, 2, 0.91, 1.0, 441, 3, 0, 0, 0, 320, 10, 1], "semantic": {"name": "self.cwd", "arg_names": [], "import_names": [], "rhs_call_name": "getcwd", "annotation": ""}, "snippet": " self.cwd = os.getcwd()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L248_C4", "label": "run_one", "type": "function", "loc": [248, 255], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:ClassDef_L243_C0", "vector": [2, 1, 0.7006, 0.0223, 1, 0.4, 1.0, 315, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "run_one", "arg_names": ["self", "c", "g"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run_one(self,c,g):\n cmdline = 'ssh -x %s \"cd %s; %s -c %s -g %s -v %s %s %s\"' % \\\n (self.host,self.cwd,\n svmtrain_exe,c,g,fold,pass_through_string,dataset_pathname)\n result = Popen(cmdline,shell=True,stdout=PIPE).stdout\n for line in result.readlines():\n if str(line).find(\"Cross\") != -1:\n return float(line.split()[-1][0:-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L249_C8", "label": "cmdline =", "type": "assigned_variable", "loc": [249, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L248_C4", "vector": [14, 2, 0.6964, 0.0084, 2, 0.22, 0.0, 83, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cmdline", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cmdline = 'ssh -x %s \"cd %s; %s -c %s -g %s -v %s %s %s\"' % \\\n (self.host,self.cwd,\n svmtrain_exe,c,g,fold,pass_through_string,dataset_pathname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L252_C8", "label": "result =", "type": "assigned_variable", "loc": [252, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L248_C4", "vector": [14, 2, 0.7019, 0.0028, 2, 0.22, 0.5, 51, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = Popen(cmdline,shell=True,stdout=PIPE).stdout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L253_C8", "label": "for line", "type": "for", "loc": [253, 255], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L248_C4", "vector": [6, 2, 0.7075, 0.0084, 2, 0.22, 1.0, 373, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for line in result.readlines():\n if str(line).find(\"Cross\") != -1:\n return float(line.split()[-1][0:-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L254_C12", "label": "if", "type": "if", "loc": [254, 255], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L253_C8", "vector": [4, 3, 0.7089, 0.0056, 3, 0.6, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if str(line).find(\"Cross\") != -1:\n return float(line.split()[-1][0:-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Return_L255_C16", "label": "return", "type": "return", "loc": [255, 255], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L254_C12", "vector": [13, 4, 0.7103, 0.0028, 4, 0.81, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return float(line.split()[-1][0:-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:ClassDef_L257_C0", "label": "TelnetWorker", "type": "class", "loc": [257, 285], "level": 0, "parent": null, "vector": [3, 0, 0.7549, 0.0808, 0, 0.66, 1.0, 950, 0, 3, 0, 0, 570, 0, 19], "semantic": {"name": "TelnetWorker", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TelnetWorker(Worker):\n def __init__(self,name,job_queue,result_queue,host,username,password):\n Worker.__init__(self,name,job_queue,result_queue)\n self.host = host\n self.username = username\n self.password = password \n def run(self):\n import telnetlib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L258_C4", "label": "__init__", "type": "function", "loc": [258, 262], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:ClassDef_L257_C0", "vector": [2, 1, 0.7242, 0.0139, 1, 0.64, 0.0, 555, 0, 7, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "name", "job_queue", "result_queue", "host", "username", "password"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self,name,job_queue,result_queue,host,username,password):\n Worker.__init__(self,name,job_queue,result_queue)\n self.host = host\n self.username = username\n self.password = password "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L259_C8", "label": "__init__()", "type": "expression", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L258_C4", "vector": [8, 2, 0.7214, 0.0028, 2, 0.69, 0.0, 555, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Worker.__init__(self,name,job_queue,result_queue)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L260_C8", "label": "self.host =", "type": "assigned_variable", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L258_C4", "vector": [14, 2, 0.7242, 0.0028, 2, 0.69, 0.3333, 445, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.host", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.host = host"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L261_C8", "label": "self.username =", "type": "assigned_variable", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L258_C4", "vector": [14, 2, 0.727, 0.0028, 2, 0.69, 0.6667, 380, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.username", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.username = username"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L262_C8", "label": "self.password =", "type": "assigned_variable", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L258_C4", "vector": [14, 2, 0.7298, 0.0028, 2, 0.69, 1.0, 902, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.password", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.password = password "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L263_C4", "label": "run", "type": "function", "loc": [263, 277], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:ClassDef_L257_C0", "vector": [2, 1, 0.7521, 0.0418, 1, 0.64, 0.5, 679, 0, 1, 0, 0, 0, 0, 11], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run(self):\n import telnetlib\n self.tn = tn = telnetlib.Telnet(self.host)\n tn.read_until(\"login: \")\n tn.write(self.username + \"\\n\")\n tn.read_until(\"Password: \")\n tn.write(self.password + \"\\n\")\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Import_L264_C8", "label": "telnetlib import telnetlib", "type": "import", "loc": [264, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L263_C4", "vector": [1, 2, 0.7354, 0.0028, 2, 0.05, 0.0, 248, 0, 1, 0, 0, 248, 0, 0], "semantic": {"name": "telnetlib", "arg_names": [], "import_names": ["telnetlib"], "rhs_call_name": "", "annotation": ""}, "snippet": " import telnetlib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L265_C8", "label": "self.tn = Telnet()", "type": "assigned_variable", "loc": [265, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L263_C4", "vector": [14, 2, 0.7382, 0.0028, 2, 0.05, 0.1, 442, 3, 1, 0, 0, 321, 10, 1], "semantic": {"name": "self.tn", "arg_names": [], "import_names": [], "rhs_call_name": "Telnet", "annotation": ""}, "snippet": " self.tn = tn = telnetlib.Telnet(self.host)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L266_C8", "label": "read_until()", "type": "expression", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L263_C4", "vector": [8, 2, 0.7409, 0.0028, 2, 0.05, 0.2, 68, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "read_until", "arg_names": [], "import_names": [], "rhs_call_name": "read_until", "annotation": ""}, "snippet": " tn.read_until(\"login: \")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L267_C8", "label": "write()", "type": "expression", "loc": [267, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L263_C4", "vector": [8, 2, 0.7437, 0.0028, 2, 0.05, 0.3, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " tn.write(self.username + \"\\n\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L268_C8", "label": "read_until()", "type": "expression", "loc": [268, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L263_C4", "vector": [8, 2, 0.7465, 0.0028, 2, 0.05, 0.4, 68, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "read_until", "arg_names": [], "import_names": [], "rhs_call_name": "read_until", "annotation": ""}, "snippet": " tn.read_until(\"Password: \")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L269_C8", "label": "write()", "type": "expression", "loc": [269, 269], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L263_C4", "vector": [8, 2, 0.7493, 0.0028, 2, 0.05, 0.5, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " tn.write(self.password + \"\\n\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L272_C8", "label": "read_until()", "type": "expression", "loc": [272, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L263_C4", "vector": [8, 2, 0.7577, 0.0028, 2, 0.05, 0.6, 68, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "read_until", "arg_names": [], "import_names": [], "rhs_call_name": "read_until", "annotation": ""}, "snippet": " tn.read_until(self.username)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L274_C8", "label": "print()", "type": "expression", "loc": [274, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L263_C4", "vector": [8, 2, 0.7632, 0.0028, 2, 0.05, 0.7, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('login ok', self.host)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L275_C8", "label": "write()", "type": "expression", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L263_C4", "vector": [8, 2, 0.766, 0.0028, 2, 0.05, 0.8, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " tn.write(\"cd \"+os.getcwd()+\"\\n\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L276_C8", "label": "run()", "type": "expression", "loc": [276, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L263_C4", "vector": [8, 2, 0.7688, 0.0028, 2, 0.05, 0.9, 679, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " Worker.run(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L277_C8", "label": "write()", "type": "expression", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L263_C4", "vector": [8, 2, 0.7716, 0.0028, 2, 0.05, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " tn.write(\"exit\\n\") "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L278_C4", "label": "run_one", "type": "function", "loc": [278, 285], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:ClassDef_L257_C0", "vector": [2, 1, 0.7841, 0.0223, 1, 0.64, 1.0, 315, 0, 3, 1, 0, 0, 0, 7], "semantic": {"name": "run_one", "arg_names": ["self", "c", "g"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run_one(self,c,g):\n cmdline = '%s -c %s -g %s -v %s %s %s' % \\\n (svmtrain_exe,c,g,fold,pass_through_string,dataset_pathname)\n result = self.tn.write(cmdline+'\\n')\n (idx,matchm,output) = self.tn.expect(['Cross.*\\n'])\n for line in output.split('\\n'):\n if str(line).find(\"Cross\") != -1:\n return float(line.split()[-1][0:-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L279_C8", "label": "cmdline =", "type": "assigned_variable", "loc": [279, 280], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L278_C4", "vector": [14, 2, 0.7786, 0.0056, 2, 0.14, 0.0, 83, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cmdline", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cmdline = '%s -c %s -g %s -v %s %s %s' % \\\n (svmtrain_exe,c,g,fold,pass_through_string,dataset_pathname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L281_C8", "label": "result = write()", "type": "assigned_variable", "loc": [281, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L278_C4", "vector": [14, 2, 0.7827, 0.0028, 2, 0.14, 0.3333, 51, 3, 1, 0, 0, 837, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " result = self.tn.write(cmdline+'\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L282_C8", "label": "idx, matchm, output = expect()", "type": "assigned_variable", "loc": [282, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L278_C4", "vector": [14, 2, 0.7855, 0.0028, 2, 0.14, 0.6667, 799, 3, 1, 0, 0, 754, 10, 1], "semantic": {"name": "idx, matchm, output", "arg_names": [], "import_names": [], "rhs_call_name": "expect", "annotation": ""}, "snippet": " (idx,matchm,output) = self.tn.expect(['Cross.*\\n'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L283_C8", "label": "for line", "type": "for", "loc": [283, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L278_C4", "vector": [6, 2, 0.7911, 0.0084, 2, 0.14, 1.0, 373, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for line in output.split('\\n'):\n if str(line).find(\"Cross\") != -1:\n return float(line.split()[-1][0:-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L284_C12", "label": "if", "type": "if", "loc": [284, 285], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L283_C8", "vector": [4, 3, 0.7925, 0.0056, 3, 0.98, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if str(line).find(\"Cross\") != -1:\n return float(line.split()[-1][0:-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Return_L285_C16", "label": "return", "type": "return", "loc": [285, 285], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L284_C12", "vector": [13, 4, 0.7939, 0.0028, 4, 0.78, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return float(line.split()[-1][0:-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "label": "main", "type": "function", "loc": [287, 358], "level": 0, "parent": null, "vector": [2, 0, 0.8983, 0.2006, 0, 0.66, 1.0417, 624, 0, 0, 0, 0, 0, 0, 25], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n\n # set parameters\n\n process_options()\n\n # put jobs in queue\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L291_C4", "label": "process_options()", "type": "expression", "loc": [291, 291], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "vector": [8, 1, 0.8106, 0.0028, 1, 0.64, 0.0, 955, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "process_options", "arg_names": [], "import_names": [], "rhs_call_name": "process_options", "annotation": ""}, "snippet": " process_options()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L295_C4", "label": "jobs = calculate_jobs()", "type": "assigned_variable", "loc": [295, 295], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "vector": [14, 1, 0.8217, 0.0028, 1, 0.64, 0.0625, 755, 3, 0, 0, 0, 576, 10, 1], "semantic": {"name": "jobs", "arg_names": [], "import_names": [], "rhs_call_name": "calculate_jobs", "annotation": ""}, "snippet": " jobs = calculate_jobs()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L296_C4", "label": "job_queue = Queue()", "type": "assigned_variable", "loc": [296, 296], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "vector": [14, 1, 0.8245, 0.0028, 1, 0.64, 0.125, 733, 3, 1, 0, 0, 952, 10, 1], "semantic": {"name": "job_queue", "arg_names": [], "import_names": [], "rhs_call_name": "Queue", "annotation": ""}, "snippet": " job_queue = Queue.Queue(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L297_C4", "label": "result_queue = Queue()", "type": "assigned_variable", "loc": [297, 297], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "vector": [14, 1, 0.8273, 0.0028, 1, 0.64, 0.1875, 916, 3, 1, 0, 0, 952, 10, 1], "semantic": {"name": "result_queue", "arg_names": [], "import_names": [], "rhs_call_name": "Queue", "annotation": ""}, "snippet": " result_queue = Queue.Queue(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L299_C4", "label": "for line", "type": "for", "loc": [299, 301], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "vector": [6, 1, 0.8357, 0.0084, 1, 0.64, 0.25, 373, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for line in jobs:\n for (c,g) in line:\n job_queue.put((c,g))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L300_C8", "label": "for c, g", "type": "for", "loc": [300, 301], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L299_C4", "vector": [6, 2, 0.837, 0.0056, 2, 0.95, 0.0, 171, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "c, g", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for (c,g) in line:\n job_queue.put((c,g))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L301_C12", "label": "put()", "type": "expression", "loc": [301, 301], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L300_C8", "vector": [8, 3, 0.8384, 0.0028, 3, 0.29, 0.0, 636, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "put", "arg_names": [], "import_names": [], "rhs_call_name": "put", "annotation": ""}, "snippet": " job_queue.put((c,g))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L303_C4", "label": "job_queue._put =", "type": "assigned_variable", "loc": [303, 303], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "vector": [14, 1, 0.844, 0.0028, 1, 0.64, 0.3125, 147, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "job_queue._put", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " job_queue._put = job_queue.queue.appendleft"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L308_C4", "label": "if", "type": "if", "loc": [308, 314], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "vector": [4, 1, 0.8663, 0.0195, 1, 0.64, 0.375, 0, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if telnet_workers:\n nr_telnet_worker = len(telnet_workers)\n username = getpass.getuser()\n password = getpass.getpass()\n for host in telnet_workers:\n TelnetWorker(host,job_queue,result_queue,\n host,username,password).start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L309_C8", "label": "nr_telnet_worker = len()", "type": "assigned_variable", "loc": [309, 309], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L308_C4", "vector": [14, 2, 0.8607, 0.0028, 2, 0.01, 0.0, 808, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "nr_telnet_worker", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " nr_telnet_worker = len(telnet_workers)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L310_C8", "label": "username = getuser()", "type": "assigned_variable", "loc": [310, 310], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L308_C4", "vector": [14, 2, 0.8635, 0.0028, 2, 0.01, 0.3333, 718, 3, 0, 0, 0, 610, 10, 1], "semantic": {"name": "username", "arg_names": [], "import_names": [], "rhs_call_name": "getuser", "annotation": ""}, "snippet": " username = getpass.getuser()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L311_C8", "label": "password = getpass()", "type": "assigned_variable", "loc": [311, 311], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L308_C4", "vector": [14, 2, 0.8663, 0.0028, 2, 0.01, 0.6667, 489, 3, 0, 0, 0, 784, 10, 1], "semantic": {"name": "password", "arg_names": [], "import_names": [], "rhs_call_name": "getpass", "annotation": ""}, "snippet": " password = getpass.getpass()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L312_C8", "label": "for host", "type": "for", "loc": [312, 314], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L308_C4", "vector": [6, 2, 0.8719, 0.0084, 2, 0.01, 1.0, 867, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "host", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for host in telnet_workers:\n TelnetWorker(host,job_queue,result_queue,\n host,username,password).start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L313_C12", "label": "start()", "type": "expression", "loc": [313, 314], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L312_C8", "vector": [8, 3, 0.8733, 0.0056, 3, 0.58, 0.0, 511, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " TelnetWorker(host,job_queue,result_queue,\n host,username,password).start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L318_C4", "label": "if", "type": "if", "loc": [318, 320], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "vector": [4, 1, 0.8886, 0.0084, 1, 0.64, 0.4375, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ssh_workers:\n for host in ssh_workers:\n SSHWorker(host,job_queue,result_queue,host).start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L319_C8", "label": "for host", "type": "for", "loc": [319, 320], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L318_C4", "vector": [6, 2, 0.89, 0.0056, 2, 0.57, 0.0, 867, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "host", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for host in ssh_workers:\n SSHWorker(host,job_queue,result_queue,host).start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L320_C12", "label": "start()", "type": "expression", "loc": [320, 320], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L319_C8", "vector": [8, 3, 0.8914, 0.0028, 3, 0.92, 0.0, 511, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " SSHWorker(host,job_queue,result_queue,host).start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L324_C4", "label": "for i", "type": "for", "loc": [324, 325], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "vector": [6, 1, 0.9039, 0.0056, 1, 0.64, 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(nr_local_worker):\n LocalWorker('local',job_queue,result_queue).start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L325_C8", "label": "start()", "type": "expression", "loc": [325, 325], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L324_C4", "vector": [8, 2, 0.9053, 0.0028, 2, 0.64, 0.0, 511, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " LocalWorker('local',job_queue,result_queue).start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L329_C4", "label": "done_jobs =", "type": "assigned_variable", "loc": [329, 329], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "vector": [14, 1, 0.9164, 0.0028, 1, 0.64, 0.5625, 422, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "done_jobs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " done_jobs = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L332_C4", "label": "result_file = open()", "type": "assigned_variable", "loc": [332, 332], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "vector": [14, 1, 0.9248, 0.0028, 1, 0.64, 0.625, 719, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "result_file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " result_file = open(out_filename, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L335_C4", "label": "db =", "type": "assigned_variable", "loc": [335, 335], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "vector": [14, 1, 0.9331, 0.0028, 1, 0.64, 0.6875, 761, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "db", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " db = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L336_C4", "label": "best_rate =", "type": "assigned_variable", "loc": [336, 336], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "vector": [14, 1, 0.9359, 0.0028, 1, 0.64, 0.75, 434, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "best_rate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " best_rate = -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L337_C4", "label": "best_c1, best_g1 =", "type": "assigned_variable", "loc": [337, 337], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "vector": [14, 1, 0.9387, 0.0028, 1, 0.64, 0.8125, 760, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "best_c1, best_g1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " best_c1,best_g1 = None,None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L339_C4", "label": "for line", "type": "for", "loc": [339, 355], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "vector": [6, 1, 0.9666, 0.0474, 1, 0.64, 0.875, 373, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for line in jobs:\n for (c,g) in line:\n while (c, g) not in done_jobs:\n (worker,c1,g1,rate) = result_queue.get()\n done_jobs[(c1,g1)] = rate\n result_file.write('%s %s %s\\n' %(c1,g1,rate))\n result_file.flush()\n if (rate > best_rate) or (rate==best_rate and g1==best_g1 and c1<best_c1):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L340_C8", "label": "for c, g", "type": "for", "loc": [340, 353], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L339_C4", "vector": [6, 2, 0.9652, 0.039, 2, 0.66, 0.0, 171, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "c, g", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for (c,g) in line:\n while (c, g) not in done_jobs:\n (worker,c1,g1,rate) = result_queue.get()\n done_jobs[(c1,g1)] = rate\n result_file.write('%s %s %s\\n' %(c1,g1,rate))\n result_file.flush()\n if (rate > best_rate) or (rate==best_rate and g1==best_g1 and c1<best_c1):\n best_rate = rate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L341_C12", "label": "while", "type": "while", "loc": [341, 352], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L340_C8", "vector": [5, 3, 0.9652, 0.0334, 3, 0.44, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while (c, g) not in done_jobs:\n (worker,c1,g1,rate) = result_queue.get()\n done_jobs[(c1,g1)] = rate\n result_file.write('%s %s %s\\n' %(c1,g1,rate))\n result_file.flush()\n if (rate > best_rate) or (rate==best_rate and g1==best_g1 and c1<best_c1):\n best_rate = rate\n best_c1,best_g1=c1,g1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L342_C16", "label": "worker, c1, g1, rate = get()", "type": "assigned_variable", "loc": [342, 342], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L341_C12", "vector": [14, 4, 0.9526, 0.0028, 4, 0.66, 0.0, 749, 3, 0, 0, 0, 607, 10, 1], "semantic": {"name": "worker, c1, g1, rate", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " (worker,c1,g1,rate) = result_queue.get()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L343_C16", "label": "assign", "type": "assigned_variable", "loc": [343, 343], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L341_C12", "vector": [14, 4, 0.9554, 0.0028, 4, 0.66, 0.2, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " done_jobs[(c1,g1)] = rate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L344_C16", "label": "write()", "type": "expression", "loc": [344, 344], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L341_C12", "vector": [8, 4, 0.9582, 0.0028, 4, 0.66, 0.4, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " result_file.write('%s %s %s\\n' %(c1,g1,rate))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L345_C16", "label": "flush()", "type": "expression", "loc": [345, 345], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L341_C12", "vector": [8, 4, 0.961, 0.0028, 4, 0.66, 0.6, 439, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "flush", "arg_names": [], "import_names": [], "rhs_call_name": "flush", "annotation": ""}, "snippet": " result_file.flush()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L346_C16", "label": "if", "type": "if", "loc": [346, 350], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L341_C12", "vector": [4, 4, 0.9694, 0.0139, 4, 0.66, 0.8, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (rate > best_rate) or (rate==best_rate and g1==best_g1 and c1<best_c1):\n best_rate = rate\n best_c1,best_g1=c1,g1\n best_c = 2.0**c1\n best_g = 2.0**g1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L347_C20", "label": "best_rate =", "type": "assigned_variable", "loc": [347, 347], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L346_C16", "vector": [14, 5, 0.9666, 0.0028, 5, 0.53, 0.0, 434, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "best_rate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " best_rate = rate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L348_C20", "label": "best_c1, best_g1 =", "type": "assigned_variable", "loc": [348, 348], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L346_C16", "vector": [14, 5, 0.9694, 0.0028, 5, 0.53, 0.3333, 760, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "best_c1, best_g1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " best_c1,best_g1=c1,g1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L349_C20", "label": "best_c =", "type": "assigned_variable", "loc": [349, 349], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L346_C16", "vector": [14, 5, 0.9721, 0.0028, 5, 0.53, 0.6667, 642, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "best_c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " best_c = 2.0**c1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L350_C20", "label": "best_g =", "type": "assigned_variable", "loc": [350, 350], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L346_C16", "vector": [14, 5, 0.9749, 0.0028, 5, 0.53, 1.0, 862, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "best_g", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " best_g = 2.0**g1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L351_C16", "label": "print()", "type": "expression", "loc": [351, 352], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L341_C12", "vector": [8, 4, 0.9791, 0.0056, 4, 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(\"[%s] %s %s %s (best c=%s, g=%s, rate=%s)\" % \\\n\t\t (worker,c1,g1,rate, best_c, best_g, best_rate))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L353_C12", "label": "append()", "type": "expression", "loc": [353, 353], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L340_C8", "vector": [8, 3, 0.9833, 0.0028, 3, 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": " db.append((c,g,done_jobs[(c,g)]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L354_C8", "label": "redraw()", "type": "expression", "loc": [354, 354], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L339_C4", "vector": [8, 2, 0.9861, 0.0028, 2, 0.66, 0.5, 870, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "redraw", "arg_names": [], "import_names": [], "rhs_call_name": "redraw", "annotation": ""}, "snippet": " redraw(db,[best_c1, best_g1, best_rate])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L355_C8", "label": "redraw()", "type": "expression", "loc": [355, 355], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L339_C4", "vector": [8, 2, 0.9889, 0.0028, 2, 0.66, 1.0, 870, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "redraw", "arg_names": [], "import_names": [], "rhs_call_name": "redraw", "annotation": ""}, "snippet": " redraw(db,[best_c1, best_g1, best_rate],True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L357_C4", "label": "put()", "type": "expression", "loc": [357, 357], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "vector": [8, 1, 0.9944, 0.0028, 1, 0.64, 0.9375, 636, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "put", "arg_names": [], "import_names": [], "rhs_call_name": "put", "annotation": ""}, "snippet": " job_queue.put((WorkerStopToken,None))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L358_C4", "label": "print()", "type": "expression", "loc": [358, 358], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "vector": [8, 1, 0.9972, 0.0028, 1, 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(\"%s %s %s\" % (best_c, best_g, best_rate))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L359_C0", "label": "main()", "type": "expression", "loc": [359, 359], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.0028, 0, 0.66, 1.0833, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": "main()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Import_L11_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Import_L13_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L20_C7"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L21_C7"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L24_C7"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L25_C7"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L73_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L73_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L73_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L77_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L86_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L86_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L86_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Return_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L113_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L113_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Return_L115_C15"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L113_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L113_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L113_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L113_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L113_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L123_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L123_C17"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L124_C18"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L113_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Return_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Return_L129_C21"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L169_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L170_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L169_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L171_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L188_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L190_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L188_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L191_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L191_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L192_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L188_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L193_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L188_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L194_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L188_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L197_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L188_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L198_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L198_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L199_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L188_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L200_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L188_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L201_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Return_L202_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:ClassDef_L207_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L208_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:ClassDef_L207_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L213_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L214_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L215_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L214_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L216_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L216_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L217_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L214_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Try_L220_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:Try_L220_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L221_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:Try_L220_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L222_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:Try_L220_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L226_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:Try_L220_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L228_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:Try_L220_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L229_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:Try_L220_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L232_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:ClassDef_L234_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L239_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L240_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L240_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Return_L241_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:ClassDef_L243_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L244_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L247_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:ClassDef_L243_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L248_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L253_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L254_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L254_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Return_L255_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:ClassDef_L257_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L258_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L258_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L259_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L258_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L258_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L258_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:ClassDef_L257_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L263_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Import_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L265_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L267_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L272_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L274_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:ClassDef_L257_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L278_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L279_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L281_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L282_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L283_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L284_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L284_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Return_L285_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L291_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L295_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L296_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L297_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L299_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L299_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L300_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L300_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L301_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L303_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L308_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L309_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L310_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L311_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L312_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L312_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L313_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L318_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L318_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L319_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L319_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L320_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L324_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L325_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L329_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L332_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L335_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L336_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L337_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L339_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L339_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L340_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L340_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L341_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L341_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L342_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L341_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L343_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L341_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L344_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L341_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L345_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L341_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L346_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L346_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L347_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L346_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L348_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L346_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L349_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:If_L346_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Assign_L350_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:While_L341_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L351_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L340_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L353_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L339_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L354_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:For_L339_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L355_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L357_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99311:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99311:Expr_L358_C4"}]
#!/usr/bin/env python # # A format checker for LIBSVM # # # Copyright (c) 2007, Rong-En Fan # # All rights reserved. # # This program is distributed under the same license of the LIBSVM package. # from sys import argv, exit import os.path def err(line_no, msg): print("line %d: %s" % (line_no, msg)) # works like float() but does not accept nan and inf def my_float(x): if x.lower().find("nan") != -1 or x.lower().find("inf") != -1: raise ValueError return float(x) def main(): if len(argv) != 2: print("Usage: %s dataset" % (argv[0])) exit(1) dataset = argv[1] if not os.path.exists(dataset): print("dataset %s not found" % (dataset)) exit(1) line_no = 1 error_line_count = 0 for line in open(dataset, 'r'): line_error = False # each line must end with a newline character if line[-1] != '\n': err(line_no, "missing a newline character in the end") line_error = True nodes = line.split() # check label try: label = nodes.pop(0) if label.find(',') != -1: # multi-label format try: for l in label.split(','): l = my_float(l) except: err(line_no, "label %s is not a valid multi-label form" % label) line_error = True else: try: label = my_float(label) except: err(line_no, "label %s is not a number" % label) line_error = True except: err(line_no, "missing label, perhaps an empty line?") line_error = True # check features prev_index = -1 for i in range(len(nodes)): try: (index, value) = nodes[i].split(':') index = int(index) value = my_float(value) # precomputed kernel's index starts from 0 and LIBSVM # checks it. Hence, don't treat index 0 as an error. if index < 0: err(line_no, "feature index must be positive; wrong feature %s" % nodes[i]) line_error = True elif index < prev_index: err(line_no, "feature indices must be in an ascending order, previous/current features %s %s" % (nodes[i-1], nodes[i])) line_error = True prev_index = index except: err(line_no, "feature '%s' not an <index>:<value> pair, <index> integer, <value> real number " % nodes[i]) line_error = True line_no += 1 if line_error: error_line_count += 1 if error_line_count > 0: print("Found %d lines with error." % (error_line_count)) return 1 else: print("No error.") return 0 if __name__ == "__main__": exit(main())
ajibawa-2023/Python-Code-Large/train/row_99312
60
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_99312:ImportFrom_L15_C0", "label": "from sys import argv, exit", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1389, 0.0093, 0, 0.66, 0.0, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["argv", "exit"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sys import argv, exit"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Import_L16_C0", "label": "os.path import os.path", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1481, 0.0093, 0, 0.66, 0.2, 79, 0, 1, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["os.path"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os.path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:FunctionDef_L18_C0", "label": "err", "type": "function", "loc": [18, 19], "level": 0, "parent": null, "vector": [2, 0, 0.1713, 0.0185, 0, 0.66, 0.4, 541, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "err", "arg_names": ["line_no", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def err(line_no, msg):\n\tprint(\"line %d: %s\" % (line_no, msg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L19_C1", "label": "print()", "type": "expression", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:FunctionDef_L18_C0", "vector": [8, 1, 0.1759, 0.0093, 1, 0.23, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint(\"line %d: %s\" % (line_no, msg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:FunctionDef_L22_C0", "label": "my_float", "type": "function", "loc": [22, 26], "level": 0, "parent": null, "vector": [2, 0, 0.2222, 0.0463, 0, 0.66, 0.6, 969, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "my_float", "arg_names": ["x"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def my_float(x):\n\tif x.lower().find(\"nan\") != -1 or x.lower().find(\"inf\") != -1:\n\t\traise ValueError\n\n\treturn float(x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L23_C1", "label": "if", "type": "if", "loc": [23, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:FunctionDef_L22_C0", "vector": [4, 1, 0.2176, 0.0185, 1, 0.74, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif x.lower().find(\"nan\") != -1 or x.lower().find(\"inf\") != -1:\n\t\traise ValueError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Return_L26_C1", "label": "return", "type": "return", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:FunctionDef_L22_C0", "vector": [13, 1, 0.2407, 0.0093, 1, 0.74, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn float(x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:FunctionDef_L28_C0", "label": "main", "type": "function", "loc": [28, 105], "level": 0, "parent": null, "vector": [2, 0, 0.6157, 0.7222, 0, 0.66, 0.8, 624, 0, 0, 1, 0, 0, 0, 27], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n\tif len(argv) != 2:\n\t\tprint(\"Usage: %s dataset\" % (argv[0]))\n\t\texit(1)\n\n\tdataset = argv[1]\n\n\tif not os.path.exists(dataset):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L29_C1", "label": "if", "type": "if", "loc": [29, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:FunctionDef_L28_C0", "vector": [4, 1, 0.2778, 0.0278, 1, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif len(argv) != 2:\n\t\tprint(\"Usage: %s dataset\" % (argv[0]))\n\t\texit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L30_C2", "label": "print()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L29_C1", "vector": [8, 2, 0.2778, 0.0093, 2, 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": "\t\tprint(\"Usage: %s dataset\" % (argv[0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L31_C2", "label": "exit()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L29_C1", "vector": [8, 2, 0.287, 0.0093, 2, 0.07, 1.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": "\t\texit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L33_C1", "label": "dataset =", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:FunctionDef_L28_C0", "vector": [14, 1, 0.3056, 0.0093, 1, 0.37, 0.1667, 603, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dataset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdataset = argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L35_C1", "label": "if", "type": "if", "loc": [35, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:FunctionDef_L28_C0", "vector": [4, 1, 0.3333, 0.0278, 1, 0.37, 0.3333, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif not os.path.exists(dataset):\n\t\tprint(\"dataset %s not found\" % (dataset))\n\t\texit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L36_C2", "label": "print()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L35_C1", "vector": [8, 2, 0.3333, 0.0093, 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": "\t\tprint(\"dataset %s not found\" % (dataset))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L37_C2", "label": "exit()", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L35_C1", "vector": [8, 2, 0.3426, 0.0093, 2, 0.73, 1.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": "\t\texit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L39_C1", "label": "line_no =", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:FunctionDef_L28_C0", "vector": [14, 1, 0.3611, 0.0093, 1, 0.37, 0.5, 966, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "line_no", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tline_no = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L40_C1", "label": "error_line_count =", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:FunctionDef_L28_C0", "vector": [14, 1, 0.3704, 0.0093, 1, 0.37, 0.6667, 735, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "error_line_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\terror_line_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:For_L41_C1", "label": "for line", "type": "for", "loc": [41, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:FunctionDef_L28_C0", "vector": [6, 1, 0.6435, 0.537, 1, 0.37, 0.8333, 373, 3, 0, 0, 0, 0, 0, 19], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor line in open(dataset, 'r'):\n\t\tline_error = False\n\n\t\t# each line must end with a newline character\n\t\tif line[-1] != '\\n':\n\t\t\terr(line_no, \"missing a newline character in the end\")\n\t\t\tline_error = True\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L42_C2", "label": "line_error =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:For_L41_C1", "vector": [14, 2, 0.3889, 0.0093, 2, 0.23, 0.0, 776, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "line_error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tline_error = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L45_C2", "label": "if", "type": "if", "loc": [45, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:For_L41_C1", "vector": [4, 2, 0.4259, 0.0278, 2, 0.23, 0.1667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif line[-1] != '\\n':\n\t\t\terr(line_no, \"missing a newline character in the end\")\n\t\t\tline_error = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L46_C3", "label": "err()", "type": "expression", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L45_C2", "vector": [8, 3, 0.4259, 0.0093, 3, 0.54, 0.0, 541, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "err", "annotation": ""}, "snippet": "\t\t\terr(line_no, \"missing a newline character in the end\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L47_C3", "label": "line_error =", "type": "assigned_variable", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L45_C2", "vector": [14, 3, 0.4352, 0.0093, 3, 0.54, 1.0, 776, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "line_error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tline_error = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L49_C2", "label": "nodes = split()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:For_L41_C1", "vector": [14, 2, 0.4537, 0.0093, 2, 0.23, 0.3333, 696, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "nodes", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tnodes = line.split()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L52_C2", "label": "try", "type": "try", "loc": [52, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:For_L41_C1", "vector": [7, 2, 0.5694, 0.1852, 2, 0.23, 0.5, 0, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\ttry:\n\t\t\tlabel = nodes.pop(0)\n\t\t\t\n\t\t\tif label.find(',') != -1:\n\t\t\t\t# multi-label format\n\t\t\t\ttry:\n\t\t\t\t\tfor l in label.split(','):\n\t\t\t\t\t\tl = my_float(l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L53_C3", "label": "label = pop()", "type": "assigned_variable", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L52_C2", "vector": [14, 3, 0.4907, 0.0093, 3, 0.11, 0.0, 811, 3, 1, 0, 0, 969, 10, 1], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": "\t\t\tlabel = nodes.pop(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L55_C3", "label": "if", "type": "if", "loc": [55, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L52_C2", "vector": [4, 3, 0.5694, 0.1296, 3, 0.11, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif label.find(',') != -1:\n\t\t\t\t# multi-label format\n\t\t\t\ttry:\n\t\t\t\t\tfor l in label.split(','):\n\t\t\t\t\t\tl = my_float(l)\n\t\t\t\texcept:\n\t\t\t\t\terr(line_no, \"label %s is not a valid multi-label form\" % label)\n\t\t\t\t\tline_error = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L57_C4", "label": "try", "type": "try", "loc": [57, 62], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L55_C3", "vector": [7, 4, 0.5509, 0.0556, 4, 0.36, 0.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ttry:\n\t\t\t\t\tfor l in label.split(','):\n\t\t\t\t\t\tl = my_float(l)\n\t\t\t\texcept:\n\t\t\t\t\terr(line_no, \"label %s is not a valid multi-label form\" % label)\n\t\t\t\t\tline_error = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:For_L58_C5", "label": "for l", "type": "for", "loc": [58, 59], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L57_C4", "vector": [6, 5, 0.5417, 0.0185, 5, 0.13, 0.0, 810, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tfor l in label.split(','):\n\t\t\t\t\t\tl = my_float(l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L59_C6", "label": "l = my_float()", "type": "assigned_variable", "loc": [59, 59], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:For_L58_C5", "vector": [14, 6, 0.5463, 0.0093, 6, 0.23, 0.0, 810, 3, 1, 0, 0, 969, 10, 1], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "my_float", "annotation": ""}, "snippet": "\t\t\t\t\t\tl = my_float(l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L61_C5", "label": "err()", "type": "expression", "loc": [61, 61], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L57_C4", "vector": [8, 5, 0.5648, 0.0093, 5, 0.13, 0.0, 541, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "err", "annotation": ""}, "snippet": "\t\t\t\t\terr(line_no, \"label %s is not a valid multi-label form\" % label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L62_C5", "label": "line_error =", "type": "assigned_variable", "loc": [62, 62], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L57_C4", "vector": [14, 5, 0.5741, 0.0093, 5, 0.13, 1.0, 776, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "line_error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tline_error = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L64_C4", "label": "try", "type": "try", "loc": [64, 68], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L55_C3", "vector": [7, 4, 0.6111, 0.0463, 4, 0.36, 1.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ttry:\n\t\t\t\t\tlabel = my_float(label)\n\t\t\t\texcept:\n\t\t\t\t\terr(line_no, \"label %s is not a number\" % label)\n\t\t\t\t\tline_error = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L65_C5", "label": "label = my_float()", "type": "assigned_variable", "loc": [65, 65], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L64_C4", "vector": [14, 5, 0.6019, 0.0093, 5, 0.28, 0.0, 811, 3, 1, 0, 0, 969, 10, 1], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "my_float", "annotation": ""}, "snippet": "\t\t\t\t\tlabel = my_float(label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L67_C5", "label": "err()", "type": "expression", "loc": [67, 67], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L64_C4", "vector": [8, 5, 0.6204, 0.0093, 5, 0.28, 0.0, 541, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "err", "annotation": ""}, "snippet": "\t\t\t\t\terr(line_no, \"label %s is not a number\" % label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L68_C5", "label": "line_error =", "type": "assigned_variable", "loc": [68, 68], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L64_C4", "vector": [14, 5, 0.6296, 0.0093, 5, 0.28, 1.0, 776, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "line_error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tline_error = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L70_C3", "label": "err()", "type": "expression", "loc": [70, 70], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L52_C2", "vector": [8, 3, 0.6481, 0.0093, 3, 0.11, 0.0, 541, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "err", "annotation": ""}, "snippet": "\t\t\terr(line_no, \"missing label, perhaps an empty line?\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L71_C3", "label": "line_error =", "type": "assigned_variable", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L52_C2", "vector": [14, 3, 0.6574, 0.0093, 3, 0.11, 1.0, 776, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "line_error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tline_error = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L74_C2", "label": "prev_index =", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:For_L41_C1", "vector": [14, 2, 0.6852, 0.0093, 2, 0.23, 0.6667, 726, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prev_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tprev_index = -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:For_L75_C2", "label": "for i", "type": "for", "loc": [75, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:For_L41_C1", "vector": [6, 2, 0.7778, 0.1759, 2, 0.23, 0.8333, 826, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in range(len(nodes)):\n\t\t\ttry:\n\t\t\t\t(index, value) = nodes[i].split(':')\n\n\t\t\t\tindex = int(index)\n\t\t\t\tvalue = my_float(value)\n\n\t\t\t\t# precomputed kernel's index starts from 0 and LIBSVM"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L76_C3", "label": "try", "type": "try", "loc": [76, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:For_L75_C2", "vector": [7, 3, 0.7824, 0.1667, 3, 0.93, 0.0, 0, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\ttry:\n\t\t\t\t(index, value) = nodes[i].split(':')\n\n\t\t\t\tindex = int(index)\n\t\t\t\tvalue = my_float(value)\n\n\t\t\t\t# precomputed kernel's index starts from 0 and LIBSVM\n\t\t\t\t# checks it. Hence, don't treat index 0 as an error."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L77_C4", "label": "index, value = split()", "type": "assigned_variable", "loc": [77, 77], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L76_C3", "vector": [14, 4, 0.713, 0.0093, 4, 0.41, 0.0, 827, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "index, value", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\t\t\t(index, value) = nodes[i].split(':')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L79_C4", "label": "index = int()", "type": "assigned_variable", "loc": [79, 79], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L76_C3", "vector": [14, 4, 0.7315, 0.0093, 4, 0.41, 0.25, 780, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "index", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\t\tindex = int(index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L80_C4", "label": "value = my_float()", "type": "assigned_variable", "loc": [80, 80], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L76_C3", "vector": [14, 4, 0.7407, 0.0093, 4, 0.41, 0.5, 441, 3, 1, 0, 0, 969, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "my_float", "annotation": ""}, "snippet": "\t\t\t\tvalue = my_float(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L84_C4", "label": "if", "type": "if", "loc": [84, 89], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L76_C3", "vector": [4, 4, 0.8009, 0.0556, 4, 0.41, 0.75, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif index < 0:\n\t\t\t\t\terr(line_no, \"feature index must be positive; wrong feature %s\" % nodes[i])\n\t\t\t\t\tline_error = True\n\t\t\t\telif index < prev_index:\n\t\t\t\t\terr(line_no, \"feature indices must be in an ascending order, previous/current features %s %s\" % (nodes[i-1], nodes[i]))\n\t\t\t\t\tline_error = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L85_C5", "label": "err()", "type": "expression", "loc": [85, 85], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L84_C4", "vector": [8, 5, 0.787, 0.0093, 5, 0.07, 0.0, 541, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "err", "annotation": ""}, "snippet": "\t\t\t\t\terr(line_no, \"feature index must be positive; wrong feature %s\" % nodes[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L86_C5", "label": "line_error =", "type": "assigned_variable", "loc": [86, 86], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L84_C4", "vector": [14, 5, 0.7963, 0.0093, 5, 0.07, 0.5, 776, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "line_error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tline_error = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L87_C4", "label": "if", "type": "if", "loc": [87, 89], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L84_C4", "vector": [4, 5, 0.8148, 0.0278, 5, 0.07, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\telif index < prev_index:\n\t\t\t\t\terr(line_no, \"feature indices must be in an ascending order, previous/current features %s %s\" % (nodes[i-1], nodes[i]))\n\t\t\t\t\tline_error = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L88_C5", "label": "err()", "type": "expression", "loc": [88, 88], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L87_C4", "vector": [8, 6, 0.8148, 0.0093, 6, 0.74, 0.0, 541, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "err", "annotation": ""}, "snippet": "\t\t\t\t\terr(line_no, \"feature indices must be in an ascending order, previous/current features %s %s\" % (nodes[i-1], nodes[i]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L89_C5", "label": "line_error =", "type": "assigned_variable", "loc": [89, 89], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L87_C4", "vector": [14, 6, 0.8241, 0.0093, 6, 0.74, 1.0, 776, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "line_error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tline_error = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L90_C4", "label": "prev_index =", "type": "assigned_variable", "loc": [90, 90], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L76_C3", "vector": [14, 4, 0.8333, 0.0093, 4, 0.41, 1.0, 726, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prev_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tprev_index = index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L92_C4", "label": "err()", "type": "expression", "loc": [92, 92], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L76_C3", "vector": [8, 4, 0.8519, 0.0093, 4, 0.41, 0.0, 541, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "err", "annotation": ""}, "snippet": "\t\t\t\terr(line_no, \"feature '%s' not an <index>:<value> pair, <index> integer, <value> real number \" % nodes[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L93_C4", "label": "line_error =", "type": "assigned_variable", "loc": [93, 93], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L76_C3", "vector": [14, 4, 0.8611, 0.0093, 4, 0.41, 1.0, 776, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "line_error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tline_error = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L97_C2", "label": "if", "type": "if", "loc": [97, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:For_L41_C1", "vector": [4, 2, 0.9028, 0.0185, 2, 0.23, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif line_error:\n\t\t\terror_line_count += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L100_C1", "label": "if", "type": "if", "loc": [100, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:FunctionDef_L28_C0", "vector": [4, 1, 0.9491, 0.0556, 1, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif error_line_count > 0:\n\t\tprint(\"Found %d lines with error.\" % (error_line_count))\n\t\treturn 1\n\telse:\n\t\tprint(\"No error.\")\n\t\treturn 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L101_C2", "label": "print()", "type": "expression", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L100_C1", "vector": [8, 2, 0.9352, 0.0093, 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": "\t\tprint(\"Found %d lines with error.\" % (error_line_count))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Return_L102_C2", "label": "return", "type": "return", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L100_C1", "vector": [13, 2, 0.9444, 0.0093, 2, 0.53, 0.3333, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L104_C2", "label": "print()", "type": "expression", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L100_C1", "vector": [8, 2, 0.963, 0.0093, 2, 0.53, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint(\"No error.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Return_L105_C2", "label": "return", "type": "return", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L100_C1", "vector": [13, 2, 0.9722, 0.0093, 2, 0.53, 1.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L107_C0", "label": "if", "type": "if", "loc": [107, 108], "level": 0, "parent": null, "vector": [4, 0, 0.9954, 0.0185, 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\texit(main())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L108_C1", "label": "exit()", "type": "expression", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L107_C0", "vector": [8, 1, 1.0, 0.0093, 1, 0.84, 0.0, 436, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": "\texit(main())"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99312:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L19_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L23_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Return_L26_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L29_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L33_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L35_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L35_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L36_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L35_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L37_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L39_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L40_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:For_L41_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:For_L41_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L42_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:For_L41_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L45_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L45_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L46_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L45_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L47_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:For_L41_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L49_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:For_L41_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L52_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L52_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L53_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L52_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L55_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L55_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:For_L58_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:For_L58_C5", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L59_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L61_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L62_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L55_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L65_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L67_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L68_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L52_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L70_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L52_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L71_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:For_L41_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L74_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:For_L41_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:For_L75_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:For_L75_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L76_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L76_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L76_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L76_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L76_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L85_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L86_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L88_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L89_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L76_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L76_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:Try_L76_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Assign_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:For_L41_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L97_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L100_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L100_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L101_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L100_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Return_L102_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L100_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L104_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L100_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Return_L105_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99312:If_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99312:Expr_L108_C1"}]
#!/usr/bin/env python from sys import argv, exit, stdout, stderr from random import randint method = 0 global n global dataset_filename subset_filename = "" rest_filename = "" def exit_with_help(): print("""\ Usage: %s [options] dataset number [output1] [output2] This script selects a subset of the given dataset. options: -s method : method of selection (default 0) 0 -- stratified selection (classification only) 1 -- random selection output1 : the subset (optional) output2 : rest of the data (optional) If output1 is omitted, the subset will be printed on the screen.""" % argv[0]) exit(1) def process_options(): global method, n global dataset_filename, subset_filename, rest_filename argc = len(argv) if argc < 3: exit_with_help() i = 1 while i < len(argv): if argv[i][0] != "-": break if argv[i] == "-s": i = i + 1 method = int(argv[i]) if method < 0 or method > 1: print("Unknown selection method %d" % (method)) exit_with_help() i = i + 1 dataset_filename = argv[i] n = int(argv[i+1]) if i+2 < argc: subset_filename = argv[i+2] if i+3 < argc: rest_filename = argv[i+3] def main(): class Label: def __init__(self, label, index, selected): self.label = label self.index = index self.selected = selected process_options() # get labels i = 0 labels = [] f = open(dataset_filename, 'r') for line in f: labels.append(Label(float((line.split())[0]), i, 0)) i = i + 1 f.close() l = i # determine where to output if subset_filename != "": file1 = open(subset_filename, 'w') else: file1 = stdout split = 0 if rest_filename != "": split = 1 file2 = open(rest_filename, 'w') # select the subset warning = 0 if method == 0: # stratified labels.sort(key = lambda x: x.label) label_end = labels[l-1].label + 1 labels.append(Label(label_end, l, 0)) begin = 0 label = labels[begin].label for i in range(l+1): new_label = labels[i].label if new_label != label: nr_class = i - begin k = i*n//l - begin*n//l # at least one instance per class if k == 0: k = 1 warning = warning + 1 for j in range(nr_class): if randint(0, nr_class-j-1) < k: labels[begin+j].selected = 1 k = k - 1 begin = i label = new_label elif method == 1: # random k = n for i in range(l): if randint(0,l-i-1) < k: labels[i].selected = 1 k = k - 1 i = i + 1 # output i = 0 if method == 0: labels.sort(key = lambda x: int(x.index)) f = open(dataset_filename, 'r') for line in f: if labels[i].selected == 1: file1.write(line) else: if split == 1: file2.write(line) i = i + 1 if warning > 0: stderr.write("""\ Warning: 1. You may have regression data. Please use -s 1. 2. Classification data unbalanced or too small. We select at least 1 per class. The subset thus contains %d instances. """ % (n+warning)) # cleanup f.close() file1.close() if split == 1: file2.close() main()
ajibawa-2023/Python-Code-Large/train/row_99313
95
146
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99313:ImportFrom_L2_C0", "label": "from sys import argv, exit, stdout\u2026", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0137, 0.0068, 0, 0.66, 0.0, 509, 0, 4, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["argv", "exit", "stdout", "stderr"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sys import argv, exit, stdout, stderr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:ImportFrom_L3_C0", "label": "from random import randint", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0205, 0.0068, 0, 0.66, 0.125, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["randint"], "rhs_call_name": "", "annotation": ""}, "snippet": "from random import randint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L5_C0", "label": "method =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.0342, 0.0068, 0, 0.66, 0.25, 445, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "method", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "method = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L8_C0", "label": "subset_filename =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.0548, 0.0068, 0, 0.66, 0.625, 383, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "subset_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "subset_filename = \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L9_C0", "label": "rest_filename =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.0616, 0.0068, 0, 0.66, 0.75, 341, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "rest_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "rest_filename = \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L11_C0", "label": "exit_with_help", "type": "function", "loc": [11, 25], "level": 0, "parent": null, "vector": [2, 0, 0.1233, 0.1027, 0, 0.66, 0.875, 174, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "exit_with_help", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def exit_with_help():\n\tprint(\"\"\"\\\nUsage: %s [options] dataset number [output1] [output2]\n\nThis script selects a subset of the given dataset.\n\noptions:\n-s method : method of selection (default 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L12_C1", "label": "print()", "type": "expression", "loc": [12, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L11_C0", "vector": [8, 1, 0.1233, 0.089, 1, 0.68, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint(\"\"\"\\\nUsage: %s [options] dataset number [output1] [output2]\n\nThis script selects a subset of the given dataset.\n\noptions:\n-s method : method of selection (default 0)\n 0 -- stratified selection (classification only)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L25_C1", "label": "exit()", "type": "expression", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L11_C0", "vector": [8, 1, 0.1712, 0.0068, 1, 0.68, 1.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": "\texit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L27_C0", "label": "process_options", "type": "function", "loc": [27, 52], "level": 0, "parent": null, "vector": [2, 0, 0.2705, 0.1781, 0, 0.66, 1.0, 955, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "process_options", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def process_options():\n\tglobal method, n\n\tglobal dataset_filename, subset_filename, rest_filename\n\t\n\targc = len(argv)\n\tif argc < 3:\n\t\texit_with_help()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L31_C1", "label": "argc = len()", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L27_C0", "vector": [14, 1, 0.2123, 0.0068, 1, 0.74, 0.0, 123, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "argc", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": "\targc = len(argv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L32_C1", "label": "if", "type": "if", "loc": [32, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L27_C0", "vector": [4, 1, 0.2226, 0.0137, 1, 0.74, 0.1429, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif argc < 3:\n\t\texit_with_help()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L33_C2", "label": "exit_with_help()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L32_C1", "vector": [8, 2, 0.226, 0.0068, 2, 0.29, 0.0, 174, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "exit_with_help", "arg_names": [], "import_names": [], "rhs_call_name": "exit_with_help", "annotation": ""}, "snippet": "\t\texit_with_help()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L35_C1", "label": "i =", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L27_C0", "vector": [14, 1, 0.2397, 0.0068, 1, 0.74, 0.2857, 826, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\ti = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:While_L36_C1", "label": "while", "type": "while", "loc": [36, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L27_C0", "vector": [5, 1, 0.2774, 0.0685, 1, 0.74, 0.4286, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\twhile i < len(argv):\n\t\tif argv[i][0] != \"-\":\n\t\t\tbreak\n\t\tif argv[i] == \"-s\":\n\t\t\ti = i + 1\n\t\t\tmethod = int(argv[i])\n\t\t\tif method < 0 or method > 1:\n\t\t\t\tprint(\"Unknown selection method %d\" % (method))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L37_C2", "label": "if", "type": "if", "loc": [37, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:While_L36_C1", "vector": [4, 2, 0.2568, 0.0137, 2, 0.75, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif argv[i][0] != \"-\":\n\t\t\tbreak"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L39_C2", "label": "if", "type": "if", "loc": [39, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:While_L36_C1", "vector": [4, 2, 0.2842, 0.0411, 2, 0.75, 0.5, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif argv[i] == \"-s\":\n\t\t\ti = i + 1\n\t\t\tmethod = int(argv[i])\n\t\t\tif method < 0 or method > 1:\n\t\t\t\tprint(\"Unknown selection method %d\" % (method))\n\t\t\t\texit_with_help()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L40_C3", "label": "i =", "type": "assigned_variable", "loc": [40, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L39_C2", "vector": [14, 3, 0.274, 0.0068, 3, 0.7, 0.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L41_C3", "label": "method = int()", "type": "assigned_variable", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L39_C2", "vector": [14, 3, 0.2808, 0.0068, 3, 0.7, 0.5, 445, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "method", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\tmethod = int(argv[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L42_C3", "label": "if", "type": "if", "loc": [42, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L39_C2", "vector": [4, 3, 0.2945, 0.0205, 3, 0.7, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif method < 0 or method > 1:\n\t\t\t\tprint(\"Unknown selection method %d\" % (method))\n\t\t\t\texit_with_help()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L43_C4", "label": "print()", "type": "expression", "loc": [43, 43], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L42_C3", "vector": [8, 4, 0.2945, 0.0068, 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": "\t\t\t\tprint(\"Unknown selection method %d\" % (method))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L44_C4", "label": "exit_with_help()", "type": "expression", "loc": [44, 44], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L42_C3", "vector": [8, 4, 0.3014, 0.0068, 4, 0.82, 1.0, 174, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "exit_with_help", "arg_names": [], "import_names": [], "rhs_call_name": "exit_with_help", "annotation": ""}, "snippet": "\t\t\t\texit_with_help()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L45_C2", "label": "i =", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:While_L36_C1", "vector": [14, 2, 0.3082, 0.0068, 2, 0.75, 1.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L47_C1", "label": "dataset_filename =", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L27_C0", "vector": [14, 1, 0.3219, 0.0068, 1, 0.74, 0.5714, 917, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dataset_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdataset_filename = argv[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L48_C1", "label": "n = int()", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L27_C0", "vector": [14, 1, 0.3288, 0.0068, 1, 0.74, 0.7143, 773, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\tn = int(argv[i+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L49_C1", "label": "if", "type": "if", "loc": [49, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L27_C0", "vector": [4, 1, 0.339, 0.0137, 1, 0.74, 0.8571, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif i+2 < argc:\n\t\tsubset_filename = argv[i+2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L50_C2", "label": "subset_filename =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L49_C1", "vector": [14, 2, 0.3425, 0.0068, 2, 0.61, 0.0, 383, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "subset_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tsubset_filename = argv[i+2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L51_C1", "label": "if", "type": "if", "loc": [51, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L27_C0", "vector": [4, 1, 0.3527, 0.0137, 1, 0.74, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif i+3 < argc:\n\t\trest_filename = argv[i+3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L52_C2", "label": "rest_filename =", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L51_C1", "vector": [14, 2, 0.3562, 0.0068, 2, 0.35, 0.0, 341, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rest_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\trest_filename = argv[i+3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "label": "main", "type": "function", "loc": [54, 144], "level": 0, "parent": null, "vector": [2, 0, 0.6781, 0.6233, 0, 0.66, 1.125, 624, 0, 0, 0, 0, 0, 0, 26], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n\tclass Label:\n\t\tdef __init__(self, label, index, selected):\n\t\t\tself.label = label\n\t\t\tself.index = index\n\t\t\tself.selected = selected\n\n\tprocess_options()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:ClassDef_L55_C1", "label": "Label", "type": "class", "loc": [55, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "vector": [3, 1, 0.3904, 0.0342, 1, 0.39, 0.0, 413, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "Label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tclass Label:\n\t\tdef __init__(self, label, index, selected):\n\t\t\tself.label = label\n\t\t\tself.index = index\n\t\t\tself.selected = selected"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L56_C2", "label": "__init__", "type": "function", "loc": [56, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:ClassDef_L55_C1", "vector": [2, 2, 0.3938, 0.0274, 2, 0.27, 0.0, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "label", "index", "selected"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdef __init__(self, label, index, selected):\n\t\t\tself.label = label\n\t\t\tself.index = index\n\t\t\tself.selected = selected"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L57_C3", "label": "self.label =", "type": "assigned_variable", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L56_C2", "vector": [14, 3, 0.3904, 0.0068, 3, 0.71, 0.0, 51, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.label = label"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L58_C3", "label": "self.index =", "type": "assigned_variable", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L56_C2", "vector": [14, 3, 0.3973, 0.0068, 3, 0.71, 0.5, 777, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.index = index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L59_C3", "label": "self.selected =", "type": "assigned_variable", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L56_C2", "vector": [14, 3, 0.4041, 0.0068, 3, 0.71, 1.0, 432, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.selected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.selected = selected"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L61_C1", "label": "process_options()", "type": "expression", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "vector": [8, 1, 0.4178, 0.0068, 1, 0.39, 0.05, 955, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "process_options", "arg_names": [], "import_names": [], "rhs_call_name": "process_options", "annotation": ""}, "snippet": "\tprocess_options()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L64_C1", "label": "i =", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "vector": [14, 1, 0.4384, 0.0068, 1, 0.39, 0.1, 826, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\ti = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L65_C1", "label": "labels =", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "vector": [14, 1, 0.4452, 0.0068, 1, 0.39, 0.15, 283, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "labels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tlabels = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L66_C1", "label": "f = open()", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "vector": [14, 1, 0.4521, 0.0068, 1, 0.39, 0.2, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\tf = open(dataset_filename, 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L67_C1", "label": "for line", "type": "for", "loc": [67, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "vector": [6, 1, 0.4658, 0.0205, 1, 0.39, 0.25, 373, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor line in f:\n\t\tlabels.append(Label(float((line.split())[0]), i, 0))\n\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L68_C2", "label": "append()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L67_C1", "vector": [8, 2, 0.4658, 0.0068, 2, 0.81, 0.0, 243, 3, 1, 0, 0, 0, 0, 4], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\tlabels.append(Label(float((line.split())[0]), i, 0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L69_C2", "label": "i =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L67_C1", "vector": [14, 2, 0.4726, 0.0068, 2, 0.81, 1.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L70_C1", "label": "close()", "type": "expression", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "vector": [8, 1, 0.4795, 0.0068, 1, 0.39, 0.3, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L71_C1", "label": "l =", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "vector": [14, 1, 0.4863, 0.0068, 1, 0.39, 0.35, 810, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tl = i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L74_C1", "label": "if", "type": "if", "loc": [74, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "vector": [4, 1, 0.5171, 0.0274, 1, 0.39, 0.4, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif subset_filename != \"\":\n\t\tfile1 = open(subset_filename, 'w')\n\telse:\n\t\tfile1 = stdout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L75_C2", "label": "file1 = open()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L74_C1", "vector": [14, 2, 0.5137, 0.0068, 2, 0.53, 0.0, 127, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "file1", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\tfile1 = open(subset_filename, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L77_C2", "label": "file1 =", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L74_C1", "vector": [14, 2, 0.5274, 0.0068, 2, 0.53, 1.0, 127, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "file1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfile1 = stdout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L78_C1", "label": "split =", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "vector": [14, 1, 0.5342, 0.0068, 1, 0.39, 0.45, 908, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "split", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tsplit = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L79_C1", "label": "if", "type": "if", "loc": [79, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "vector": [4, 1, 0.5479, 0.0205, 1, 0.39, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif rest_filename != \"\":\n\t\tsplit = 1\t\n\t\tfile2 = open(rest_filename, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L80_C2", "label": "split =", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L79_C1", "vector": [14, 2, 0.5479, 0.0068, 2, 0.9, 0.0, 908, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "split", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tsplit = 1\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L81_C2", "label": "file2 = open()", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L79_C1", "vector": [14, 2, 0.5548, 0.0068, 2, 0.9, 1.0, 147, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "file2", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\tfile2 = open(rest_filename, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L84_C1", "label": "warning =", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "vector": [14, 1, 0.5753, 0.0068, 1, 0.39, 0.55, 320, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\twarning = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L85_C1", "label": "if", "type": "if", "loc": [85, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "vector": [4, 1, 0.6815, 0.2055, 1, 0.39, 0.6, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif method == 0: # stratified\n\t\tlabels.sort(key = lambda x: x.label)\n\t\t\n\t\tlabel_end = labels[l-1].label + 1\n\t\tlabels.append(Label(label_end, l, 0))\n\n\t\tbegin = 0\n\t\tlabel = labels[begin].label"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L86_C2", "label": "sort()", "type": "expression", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L85_C1", "vector": [8, 2, 0.589, 0.0068, 2, 0.39, 0.0, 489, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": "\t\tlabels.sort(key = lambda x: x.label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L88_C2", "label": "label_end =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L85_C1", "vector": [14, 2, 0.6027, 0.0068, 2, 0.39, 0.1667, 88, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "label_end", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tlabel_end = labels[l-1].label + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L89_C2", "label": "append()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L85_C1", "vector": [8, 2, 0.6096, 0.0068, 2, 0.39, 0.3333, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\tlabels.append(Label(label_end, l, 0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L91_C2", "label": "begin =", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L85_C1", "vector": [14, 2, 0.6233, 0.0068, 2, 0.39, 0.5, 969, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "begin", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tbegin = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L92_C2", "label": "label =", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L85_C1", "vector": [14, 2, 0.6301, 0.0068, 2, 0.39, 0.6667, 811, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tlabel = labels[begin].label"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L93_C2", "label": "for i", "type": "for", "loc": [93, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L85_C1", "vector": [6, 2, 0.6849, 0.1027, 2, 0.39, 0.8333, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in range(l+1):\n\t\t\tnew_label = labels[i].label\n\t\t\tif new_label != label:\n\t\t\t\tnr_class = i - begin\n\t\t\t\tk = i*n//l - begin*n//l\n\t\t\t\t# at least one instance per class\n\t\t\t\tif k == 0:\n\t\t\t\t\tk = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L94_C3", "label": "new_label =", "type": "assigned_variable", "loc": [94, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L93_C2", "vector": [14, 3, 0.6438, 0.0068, 3, 0.79, 0.0, 961, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "new_label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tnew_label = labels[i].label"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L95_C3", "label": "if", "type": "if", "loc": [95, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L93_C2", "vector": [4, 3, 0.6918, 0.089, 3, 0.79, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif new_label != label:\n\t\t\t\tnr_class = i - begin\n\t\t\t\tk = i*n//l - begin*n//l\n\t\t\t\t# at least one instance per class\n\t\t\t\tif k == 0:\n\t\t\t\t\tk = 1\n\t\t\t\t\twarning = warning + 1\n\t\t\t\tfor j in range(nr_class):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L96_C4", "label": "nr_class =", "type": "assigned_variable", "loc": [96, 96], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L95_C3", "vector": [14, 4, 0.6575, 0.0068, 4, 0.75, 0.0, 123, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "nr_class", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tnr_class = i - begin"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L97_C4", "label": "k =", "type": "assigned_variable", "loc": [97, 97], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L95_C3", "vector": [14, 4, 0.6644, 0.0068, 4, 0.75, 0.2, 954, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tk = i*n//l - begin*n//l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L99_C4", "label": "if", "type": "if", "loc": [99, 101], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L95_C3", "vector": [4, 4, 0.6849, 0.0205, 4, 0.75, 0.4, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif k == 0:\n\t\t\t\t\tk = 1\n\t\t\t\t\twarning = warning + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L100_C5", "label": "k =", "type": "assigned_variable", "loc": [100, 100], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L99_C4", "vector": [14, 5, 0.6849, 0.0068, 5, 0.48, 0.0, 954, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tk = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L101_C5", "label": "warning =", "type": "assigned_variable", "loc": [101, 101], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L99_C4", "vector": [14, 5, 0.6918, 0.0068, 5, 0.48, 1.0, 320, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\twarning = warning + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L102_C4", "label": "for j", "type": "for", "loc": [102, 105], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L95_C3", "vector": [6, 4, 0.7089, 0.0274, 4, 0.75, 0.6, 100, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tfor j in range(nr_class):\n\t\t\t\t\tif randint(0, nr_class-j-1) < k:\n\t\t\t\t\t\tlabels[begin+j].selected = 1\n\t\t\t\t\t\tk = k - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L103_C5", "label": "if", "type": "if", "loc": [103, 105], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L102_C4", "vector": [4, 5, 0.7123, 0.0205, 5, 0.64, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tif randint(0, nr_class-j-1) < k:\n\t\t\t\t\t\tlabels[begin+j].selected = 1\n\t\t\t\t\t\tk = k - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L104_C6", "label": "labels[begin + j].selected =", "type": "assigned_variable", "loc": [104, 104], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L103_C5", "vector": [14, 6, 0.7123, 0.0068, 6, 0.55, 0.0, 70, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "labels[begin + j].selected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\t\tlabels[begin+j].selected = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L105_C6", "label": "k =", "type": "assigned_variable", "loc": [105, 105], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L103_C5", "vector": [14, 6, 0.7192, 0.0068, 6, 0.55, 1.0, 954, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\t\tk = k - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L106_C4", "label": "begin =", "type": "assigned_variable", "loc": [106, 106], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L95_C3", "vector": [14, 4, 0.726, 0.0068, 4, 0.75, 0.8, 969, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "begin", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tbegin = i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L107_C4", "label": "label =", "type": "assigned_variable", "loc": [107, 107], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L95_C3", "vector": [14, 4, 0.7329, 0.0068, 4, 0.75, 1.0, 811, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tlabel = new_label"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L108_C1", "label": "if", "type": "if", "loc": [108, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L85_C1", "vector": [4, 2, 0.7603, 0.0479, 2, 0.39, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\telif method == 1: # random\n\t\tk = n\n\t\tfor i in range(l):\n\t\t\tif randint(0,l-i-1) < k:\n\t\t\t\tlabels[i].selected = 1\n\t\t\t\tk = k - 1\n\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L109_C2", "label": "k =", "type": "assigned_variable", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L108_C1", "vector": [14, 3, 0.7466, 0.0068, 3, 0.02, 0.0, 954, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tk = n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L110_C2", "label": "for i", "type": "for", "loc": [110, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L108_C1", "vector": [6, 3, 0.7671, 0.0342, 3, 0.02, 1.0, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in range(l):\n\t\t\tif randint(0,l-i-1) < k:\n\t\t\t\tlabels[i].selected = 1\n\t\t\t\tk = k - 1\n\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L111_C3", "label": "if", "type": "if", "loc": [111, 113], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L110_C2", "vector": [4, 4, 0.7671, 0.0205, 4, 0.57, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif randint(0,l-i-1) < k:\n\t\t\t\tlabels[i].selected = 1\n\t\t\t\tk = k - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L112_C4", "label": "labels[i].selected =", "type": "assigned_variable", "loc": [112, 112], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L111_C3", "vector": [14, 5, 0.7671, 0.0068, 5, 0.2, 0.0, 549, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "labels[i].selected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tlabels[i].selected = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L113_C4", "label": "k =", "type": "assigned_variable", "loc": [113, 113], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L111_C3", "vector": [14, 5, 0.774, 0.0068, 5, 0.2, 1.0, 954, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tk = k - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L114_C3", "label": "i =", "type": "assigned_variable", "loc": [114, 114], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L110_C2", "vector": [14, 4, 0.7808, 0.0068, 4, 0.57, 1.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L117_C1", "label": "i =", "type": "assigned_variable", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "vector": [14, 1, 0.8014, 0.0068, 1, 0.39, 0.65, 826, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\ti = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L118_C1", "label": "if", "type": "if", "loc": [118, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "vector": [4, 1, 0.8116, 0.0137, 1, 0.39, 0.7, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif method == 0:\n\t\tlabels.sort(key = lambda x: int(x.index))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L119_C2", "label": "sort()", "type": "expression", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L118_C1", "vector": [8, 2, 0.8151, 0.0068, 2, 0.24, 0.0, 489, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": "\t\tlabels.sort(key = lambda x: int(x.index))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L121_C1", "label": "f = open()", "type": "assigned_variable", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "vector": [14, 1, 0.8288, 0.0068, 1, 0.39, 0.75, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\tf = open(dataset_filename, 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L122_C1", "label": "for line", "type": "for", "loc": [122, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "vector": [6, 1, 0.8562, 0.0479, 1, 0.39, 0.8, 373, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor line in f:\n\t\tif labels[i].selected == 1:\n\t\t\tfile1.write(line)\n\t\telse:\n\t\t\tif split == 1:\n\t\t\t\tfile2.write(line)\n\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L123_C2", "label": "if", "type": "if", "loc": [123, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L122_C1", "vector": [4, 2, 0.8562, 0.0342, 2, 0.55, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif labels[i].selected == 1:\n\t\t\tfile1.write(line)\n\t\telse:\n\t\t\tif split == 1:\n\t\t\t\tfile2.write(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L124_C3", "label": "write()", "type": "expression", "loc": [124, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L123_C2", "vector": [8, 3, 0.8493, 0.0068, 3, 0.32, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\tfile1.write(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L126_C3", "label": "if", "type": "if", "loc": [126, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L123_C2", "vector": [4, 3, 0.8664, 0.0137, 3, 0.32, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif split == 1:\n\t\t\t\tfile2.write(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L127_C4", "label": "write()", "type": "expression", "loc": [127, 127], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L126_C3", "vector": [8, 4, 0.8699, 0.0068, 4, 0.02, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\t\tfile2.write(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L128_C2", "label": "i =", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L122_C1", "vector": [14, 2, 0.8767, 0.0068, 2, 0.55, 1.0, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\ti = i + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L130_C1", "label": "if", "type": "if", "loc": [130, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "vector": [4, 1, 0.911, 0.0479, 1, 0.39, 0.85, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif warning > 0:\n\t\tstderr.write(\"\"\"\\\nWarning:\n1. You may have regression data. Please use -s 1.\n2. Classification data unbalanced or too small. We select at least 1 per class.\n The subset thus contains %d instances.\n\"\"\" % (n+warning))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L131_C2", "label": "write()", "type": "expression", "loc": [131, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L130_C1", "vector": [8, 2, 0.9144, 0.0411, 2, 0.85, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\tstderr.write(\"\"\"\\\nWarning:\n1. You may have regression data. Please use -s 1.\n2. Classification data unbalanced or too small. We select at least 1 per class.\n The subset thus contains %d instances.\n\"\"\" % (n+warning))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L139_C1", "label": "close()", "type": "expression", "loc": [139, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "vector": [8, 1, 0.9521, 0.0068, 1, 0.39, 0.9, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L141_C1", "label": "close()", "type": "expression", "loc": [141, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "vector": [8, 1, 0.9658, 0.0068, 1, 0.39, 0.95, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\tfile1.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L143_C1", "label": "if", "type": "if", "loc": [143, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "vector": [4, 1, 0.9829, 0.0137, 1, 0.39, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif split == 1:\n\t\tfile2.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L144_C2", "label": "close()", "type": "expression", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L143_C1", "vector": [8, 2, 0.9863, 0.0068, 2, 0.34, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\tfile2.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L146_C0", "label": "main()", "type": "expression", "loc": [146, 146], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.0068, 0, 0.66, 1.25, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": "main()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L12_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L25_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L31_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L32_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L32_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L33_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L35_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:While_L36_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:While_L36_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L37_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:While_L36_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L39_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L40_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L41_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L42_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L42_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L42_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:While_L36_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L45_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L47_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L48_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L49_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L49_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L50_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L51_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L51_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L52_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:ClassDef_L55_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:ClassDef_L55_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L56_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L56_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L57_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L56_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L58_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L56_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L59_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L61_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L64_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L65_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L66_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L67_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L67_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L68_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L67_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L69_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L70_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L71_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L74_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L74_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L75_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L74_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L77_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L78_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L79_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L79_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L80_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L79_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L81_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L84_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L85_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L85_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L86_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L85_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L88_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L85_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L89_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L85_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L91_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L85_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L92_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L85_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L93_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L93_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L94_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L93_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L95_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L95_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L95_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L95_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L100_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L101_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L95_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L103_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L103_C5", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L104_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L103_C5", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L105_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L95_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L95_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L85_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L108_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L108_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L109_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L108_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L110_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L110_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L111_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L111_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L111_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L110_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L114_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L117_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L118_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L118_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L119_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L121_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L122_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L122_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L123_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L124_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L126_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L126_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:For_L122_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Assign_L128_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L130_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L130_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L131_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L139_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L141_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L143_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99313:If_L143_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99313:Expr_L144_C2"}]
import numpy as np import roslib roslib.load_manifest('hrl_generic_arms') import rospy from equilibrium_point_control.ep_control import EPGenerator, EPC, EPStopConditions ## # Returns a minimum jerk trajectory from x=0..1 given # the number of samples in the trajectory. Assumes # x_i = 0, x_f = 1, v_i = 0, v_f = 0. def min_jerk_traj(n): return [(10 * t**3 - 15 * t**4 + 6 * t**5) for t in np.linspace(0, 1, n)] ## # Implements a generic equilibirum point generator given a list # of EPs and the arm object to execute them on. class EPTrajectoryControl(EPGenerator): def __init__(self, control_arm, trajectory, time_step=0.1): self.control_arm = control_arm self.trajectory = trajectory self.time_step = time_step self.t_i = 0 def generate_ep(self): ep_new = self.trajectory[self.t_i] self.t_i += 1 return EPStopConditions.CONTINUE, ep_new def control_ep(self, ep): self.control_arm.set_ep(ep, self.time_step) def clamp_ep(self, ep): return ep def terminate_check(self): if self.t_i == len(self.trajectory): return EPStopConditions.SUCCESSFUL return EPStopConditions.CONTINUE ## # Equilbrium Point Control object used to execute a trajectory from # the current EP to the end EP using a minimum jerk interpolation. class EPArmController(EPC): def __init__(self, arm, time_step=0.1, epc_name='epc_arm_controller'): super(EPArmController, self).__init__(epc_name) self.arm = arm self.time_step = time_step def execute_interpolated_ep(self, end_ep, duration, blocking=True): num_samps = duration / self.time_step joint_traj = self.arm.interpolate_ep(self.arm.get_ep(), end_ep, min_jerk_traj(num_samps)) ep_traj_control = EPTrajectoryControl(self.arm, joint_traj, self.time_step) def exec_motion(event): self.epc_motion(ep_traj_control, self.time_step) if blocking: exec_motion(None) else: rospy.Timer(rospy.Duration(0.01), exec_motion, oneshot=True)
ajibawa-2023/Python-Code-Large/train/row_99314
38
62
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99314:Import_L2_C0", "label": "numpy import np", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0323, 0.0161, 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_99314:Import_L4_C0", "label": "roslib import roslib", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0645, 0.0161, 0, 0.66, 0.1429, 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_99314:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0806, 0.0161, 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": "roslib.load_manifest('hrl_generic_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:Import_L6_C0", "label": "rospy import rospy", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0968, 0.0161, 0, 0.66, 0.4286, 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_99314:ImportFrom_L8_C0", "label": "from equilibrium_point_control.ep_control import EPGenerator, EPC, EPStopConditions", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.129, 0.0161, 0, 0.66, 0.5714, 301, 0, 3, 0, 0, 301, 0, 0], "semantic": {"name": "equilibrium_point_control.ep_control", "arg_names": [], "import_names": ["EPGenerator", "EPC", "EPStopConditions"], "rhs_call_name": "", "annotation": ""}, "snippet": "from equilibrium_point_control.ep_control import EPGenerator, EPC, EPStopConditions"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L14_C0", "label": "min_jerk_traj", "type": "function", "loc": [14, 16], "level": 0, "parent": null, "vector": [2, 0, 0.2419, 0.0484, 0, 0.66, 0.7143, 636, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "min_jerk_traj", "arg_names": ["n"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def min_jerk_traj(n):\n return [(10 * t**3 - 15 * t**4 + 6 * t**5)\n for t in np.linspace(0, 1, n)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:Return_L15_C4", "label": "return", "type": "return", "loc": [15, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L14_C0", "vector": [13, 1, 0.25, 0.0323, 1, 0.92, 0.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [(10 * t**3 - 15 * t**4 + 6 * t**5)\n for t in np.linspace(0, 1, n)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:ClassDef_L21_C0", "label": "EPTrajectoryControl", "type": "class", "loc": [21, 42], "level": 0, "parent": null, "vector": [3, 0, 0.5081, 0.3548, 0, 0.66, 0.8571, 391, 0, 5, 0, 0, 49, 0, 2], "semantic": {"name": "EPTrajectoryControl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class EPTrajectoryControl(EPGenerator):\n def __init__(self, control_arm, trajectory, time_step=0.1):\n self.control_arm = control_arm\n self.trajectory = trajectory\n self.time_step = time_step\n self.t_i = 0\n\n def generate_ep(self):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L22_C4", "label": "__init__", "type": "function", "loc": [22, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:ClassDef_L21_C0", "vector": [2, 1, 0.3871, 0.0806, 1, 0.92, 0.0, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "control_arm", "trajectory", "time_step"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, control_arm, trajectory, time_step=0.1):\n self.control_arm = control_arm\n self.trajectory = trajectory\n self.time_step = time_step\n self.t_i = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:Assign_L23_C8", "label": "self.control_arm =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L22_C4", "vector": [14, 2, 0.371, 0.0161, 2, 0.84, 0.0, 559, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.control_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.control_arm = control_arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:Assign_L24_C8", "label": "self.trajectory =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L22_C4", "vector": [14, 2, 0.3871, 0.0161, 2, 0.84, 0.3333, 642, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.trajectory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.trajectory = trajectory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:Assign_L25_C8", "label": "self.time_step =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L22_C4", "vector": [14, 2, 0.4032, 0.0161, 2, 0.84, 0.6667, 358, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.time_step", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.time_step = time_step"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:Assign_L26_C8", "label": "self.t_i =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L22_C4", "vector": [14, 2, 0.4194, 0.0161, 2, 0.84, 1.0, 310, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.t_i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.t_i = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L28_C4", "label": "generate_ep", "type": "function", "loc": [28, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:ClassDef_L21_C0", "vector": [2, 1, 0.4758, 0.0645, 1, 0.92, 0.25, 218, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "generate_ep", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def generate_ep(self):\n ep_new = self.trajectory[self.t_i]\n self.t_i += 1\n return EPStopConditions.CONTINUE, ep_new"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:Assign_L29_C8", "label": "ep_new =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L28_C4", "vector": [14, 2, 0.4677, 0.0161, 2, 0.89, 0.0, 112, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ep_new", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ep_new = self.trajectory[self.t_i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:Return_L31_C8", "label": "return", "type": "return", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L28_C4", "vector": [13, 2, 0.5, 0.0161, 2, 0.89, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return EPStopConditions.CONTINUE, ep_new"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L33_C4", "label": "control_ep", "type": "function", "loc": [33, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:ClassDef_L21_C0", "vector": [2, 1, 0.5403, 0.0323, 1, 0.92, 0.5, 752, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "control_ep", "arg_names": ["self", "ep"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def control_ep(self, ep):\n self.control_arm.set_ep(ep, self.time_step)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:Expr_L34_C8", "label": "set_ep()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L33_C4", "vector": [8, 2, 0.5484, 0.0161, 2, 0.1, 0.0, 547, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_ep", "arg_names": [], "import_names": [], "rhs_call_name": "set_ep", "annotation": ""}, "snippet": " self.control_arm.set_ep(ep, self.time_step)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L36_C4", "label": "clamp_ep", "type": "function", "loc": [36, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:ClassDef_L21_C0", "vector": [2, 1, 0.5887, 0.0323, 1, 0.92, 0.75, 692, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "clamp_ep", "arg_names": ["self", "ep"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def clamp_ep(self, ep):\n return ep"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:Return_L37_C8", "label": "return", "type": "return", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L36_C4", "vector": [13, 2, 0.5968, 0.0161, 2, 0.73, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ep"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L39_C4", "label": "terminate_check", "type": "function", "loc": [39, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:ClassDef_L21_C0", "vector": [2, 1, 0.6532, 0.0645, 1, 0.92, 1.0, 980, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "terminate_check", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def terminate_check(self):\n if self.t_i == len(self.trajectory):\n return EPStopConditions.SUCCESSFUL\n return EPStopConditions.CONTINUE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:If_L40_C8", "label": "if", "type": "if", "loc": [40, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L39_C4", "vector": [4, 2, 0.6532, 0.0323, 2, 0.96, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.t_i == len(self.trajectory):\n return EPStopConditions.SUCCESSFUL"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:Return_L41_C12", "label": "return", "type": "return", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:If_L40_C8", "vector": [13, 3, 0.6613, 0.0161, 3, 0.75, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return EPStopConditions.SUCCESSFUL"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:Return_L42_C8", "label": "return", "type": "return", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L39_C4", "vector": [13, 2, 0.6774, 0.0161, 2, 0.96, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return EPStopConditions.CONTINUE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:ClassDef_L47_C0", "label": "EPArmController", "type": "class", "loc": [47, 62], "level": 0, "parent": null, "vector": [3, 0, 0.879, 0.2581, 0, 0.66, 1.0, 201, 0, 3, 0, 0, 417, 0, 10], "semantic": {"name": "EPArmController", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class EPArmController(EPC):\n def __init__(self, arm, time_step=0.1, epc_name='epc_arm_controller'):\n super(EPArmController, self).__init__(epc_name)\n self.arm = arm\n self.time_step = time_step\n\n def execute_interpolated_ep(self, end_ep, duration, blocking=True):\n num_samps = duration / self.time_step"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L48_C4", "label": "__init__", "type": "function", "loc": [48, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:ClassDef_L47_C0", "vector": [2, 1, 0.7984, 0.0645, 1, 0.87, 0.0, 555, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "arm", "time_step", "epc_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arm, time_step=0.1, epc_name='epc_arm_controller'):\n super(EPArmController, self).__init__(epc_name)\n self.arm = arm\n self.time_step = time_step"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:Expr_L49_C8", "label": "__init__()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L48_C4", "vector": [8, 2, 0.7903, 0.0161, 2, 0.42, 0.0, 555, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(EPArmController, self).__init__(epc_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:Assign_L50_C8", "label": "self.arm =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L48_C4", "vector": [14, 2, 0.8065, 0.0161, 2, 0.42, 0.5, 720, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm = arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:Assign_L51_C8", "label": "self.time_step =", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L48_C4", "vector": [14, 2, 0.8226, 0.0161, 2, 0.42, 1.0, 358, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.time_step", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.time_step = time_step"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L53_C4", "label": "execute_interpolated_ep", "type": "function", "loc": [53, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:ClassDef_L47_C0", "vector": [2, 1, 0.9274, 0.1613, 1, 0.87, 1.0, 215, 0, 4, 0, 0, 0, 0, 8], "semantic": {"name": "execute_interpolated_ep", "arg_names": ["self", "end_ep", "duration", "blocking"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute_interpolated_ep(self, end_ep, duration, blocking=True):\n num_samps = duration / self.time_step\n joint_traj = self.arm.interpolate_ep(self.arm.get_ep(), end_ep, min_jerk_traj(num_samps))\n ep_traj_control = EPTrajectoryControl(self.arm, joint_traj, self.time_step)\n def exec_motion(event):\n self.epc_motion(ep_traj_control, self.time_step)\n if blocking:\n exec_motion(None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:Assign_L54_C8", "label": "num_samps =", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L53_C4", "vector": [14, 2, 0.871, 0.0161, 2, 0.17, 0.0, 575, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "num_samps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " num_samps = duration / self.time_step"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:Assign_L55_C8", "label": "joint_traj = interpolate_ep()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L53_C4", "vector": [14, 2, 0.8871, 0.0161, 2, 0.17, 0.25, 460, 3, 3, 0, 0, 794, 10, 3], "semantic": {"name": "joint_traj", "arg_names": [], "import_names": [], "rhs_call_name": "interpolate_ep", "annotation": ""}, "snippet": " joint_traj = self.arm.interpolate_ep(self.arm.get_ep(), end_ep, min_jerk_traj(num_samps))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:Assign_L56_C8", "label": "ep_traj_control = EPTrajectoryControl()", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L53_C4", "vector": [14, 2, 0.9032, 0.0161, 2, 0.17, 0.5, 622, 3, 3, 0, 0, 391, 10, 1], "semantic": {"name": "ep_traj_control", "arg_names": [], "import_names": [], "rhs_call_name": "EPTrajectoryControl", "annotation": ""}, "snippet": " ep_traj_control = EPTrajectoryControl(self.arm, joint_traj, self.time_step)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L57_C8", "label": "exec_motion", "type": "function", "loc": [57, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L53_C4", "vector": [2, 2, 0.9274, 0.0323, 2, 0.17, 0.75, 545, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exec_motion", "arg_names": ["event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def exec_motion(event):\n self.epc_motion(ep_traj_control, self.time_step)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:Expr_L58_C12", "label": "epc_motion()", "type": "expression", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L57_C8", "vector": [8, 3, 0.9355, 0.0161, 3, 0.92, 0.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_motion(ep_traj_control, self.time_step)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:If_L59_C8", "label": "if", "type": "if", "loc": [59, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L53_C4", "vector": [4, 2, 0.9758, 0.0645, 2, 0.17, 1.0, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if blocking:\n exec_motion(None)\n else:\n rospy.Timer(rospy.Duration(0.01), exec_motion, oneshot=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:Expr_L60_C12", "label": "exec_motion()", "type": "expression", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:If_L59_C8", "vector": [8, 3, 0.9677, 0.0161, 3, 0.27, 0.0, 545, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exec_motion", "arg_names": [], "import_names": [], "rhs_call_name": "exec_motion", "annotation": ""}, "snippet": " exec_motion(None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99314:Expr_L62_C12", "label": "Timer()", "type": "expression", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99314:If_L59_C8", "vector": [8, 3, 1.0, 0.0161, 3, 0.27, 1.0, 771, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "Timer", "arg_names": [], "import_names": [], "rhs_call_name": "Timer", "annotation": ""}, "snippet": " rospy.Timer(rospy.Duration(0.01), exec_motion, oneshot=True)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:Return_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:Return_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:Return_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:If_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:Return_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:Return_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L57_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:Expr_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:If_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:Expr_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99314:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99314:Expr_L62_C12"}]
import numpy as np import copy import roslib; roslib.load_manifest('hrl_generic_arms') import rospy from std_msgs.msg import Header from geometry_msgs.msg import PoseStamped, Pose, Point, Quaternion, PointStamped from geometry_msgs.msg import Transform, TransformStamped, Vector3 from geometry_msgs.msg import Twist, TwistStamped import tf.transformations as tf_trans class PoseConverter: @staticmethod def _make_generic(args): if type(args[0]) == str: frame_id = args[0] header, homo_mat, rot_quat, rot_euler = PoseConverter._make_generic(args[1:]) if header is None: header = [0, rospy.Time.now(), ''] header[2] = frame_id return header, homo_mat, rot_quat, rot_euler if len(args) == 1: if type(args[0]) is Pose: homo_mat, rot_quat, rot_euler = PoseConverter._extract_pose_msg(args[0]) return None, homo_mat, rot_quat, rot_euler elif type(args[0]) is PoseStamped: homo_mat, rot_quat, rot_euler = PoseConverter._extract_pose_msg(args[0].pose) seq = args[0].header.seq stamp = args[0].header.stamp frame_id = args[0].header.frame_id return [seq, stamp, frame_id], homo_mat, rot_quat, rot_euler elif type(args[0]) is Transform: homo_mat, rot_quat, rot_euler = PoseConverter._extract_tf_msg(args[0]) return None, homo_mat, rot_quat, rot_euler elif type(args[0]) is TransformStamped: homo_mat, rot_quat, rot_euler = PoseConverter._extract_tf_msg(args[0].transform) seq = args[0].header.seq stamp = args[0].header.stamp frame_id = args[0].header.frame_id return [seq, stamp, frame_id], homo_mat, rot_quat, rot_euler elif type(args[0]) is Twist: homo_mat, rot_quat, rot_euler = PoseConverter._extract_twist_msg(args[0]) return None, homo_mat, rot_quat, rot_euler elif type(args[0]) is TwistStamped: homo_mat, rot_quat, rot_euler = PoseConverter._extract_twist_msg(args[0].twist) seq = args[0].header.seq stamp = args[0].header.stamp frame_id = args[0].header.frame_id return [seq, stamp, frame_id], homo_mat, rot_quat, rot_euler elif isinstance(args[0], (np.matrix, np.ndarray)) and np.shape(args[0]) == (4, 4): return (None, np.mat(args[0]), tf_trans.quaternion_from_matrix(args[0]).tolist(), tf_trans.euler_from_matrix(args[0])) elif isinstance(args[0], (tuple, list)) and len(args[0]) == 2: pos_arg = np.mat(args[0][0]) rot_arg = np.mat(args[0][1]) if pos_arg.shape == (1, 3): # matrix is row, convert to column pos = pos_arg.T elif pos_arg.shape == (3, 1): pos = pos_arg else: return None, None, None, None if rot_arg.shape == (3, 3): # rotation matrix homo_mat = np.mat(np.eye(4)) homo_mat[:3,:3] = rot_arg quat = tf_trans.quaternion_from_matrix(homo_mat) rot_euler = tf_trans.euler_from_matrix(homo_mat) else: if rot_arg.shape[1] == 1: # make into row matrix rot_arg = rot_arg.T else: rot_arg = rot_arg.tolist()[0] if len(rot_arg) == 3: # Euler angles rotation homo_mat = np.mat(tf_trans.euler_matrix(*rot_arg)) quat = tf_trans.quaternion_from_euler(*rot_arg) rot_euler = rot_arg elif len(rot_arg) == 4: # quaternion rotation homo_mat = np.mat(tf_trans.quaternion_matrix(rot_arg)) quat = rot_arg rot_euler = tf_trans.euler_from_quaternion(quat) else: return None, None, None, None homo_mat[:3, 3] = pos return None, homo_mat, np.array(quat), rot_euler elif len(args) == 2: header, homo_mat, rot_quat, rot_euler = PoseConverter._make_generic( ((args[0], args[1]),)) if homo_mat is not None: return header, homo_mat, rot_quat, rot_euler return None, None, None, None @staticmethod def _extract_pose_msg(pose): px = pose.position.x; py = pose.position.y; pz = pose.position.z ox = pose.orientation.x; oy = pose.orientation.y oz = pose.orientation.z; ow = pose.orientation.w quat = [ox, oy, oz, ow] rot_euler = tf_trans.euler_from_quaternion(quat) homo_mat = np.mat(tf_trans.quaternion_matrix(quat)) homo_mat[:3,3] = np.mat([[px, py, pz]]).T return homo_mat, quat, rot_euler @staticmethod def _extract_tf_msg(tf_msg): px = tf_msg.translation.x; py = tf_msg.translation.y; pz = tf_msg.translation.z ox = tf_msg.rotation.x; oy = tf_msg.rotation.y oz = tf_msg.rotation.z; ow = tf_msg.rotation.w quat = [ox, oy, oz, ow] rot_euler = tf_trans.euler_from_quaternion(quat) homo_mat = np.mat(tf_trans.quaternion_matrix(quat)) homo_mat[:3,3] = np.mat([[px, py, pz]]).T return homo_mat, quat, rot_euler @staticmethod def _extract_twist_msg(twist_msg): pos = [twist_msg.linear.x, twist_msg.linear.y, twist_msg.linear.z] rot_euler = [twist_msg.angular.x, twist_msg.angular.y, twist_msg.angular.z] quat = tf_trans.quaternion_from_euler(*rot_euler, axes='sxyz') homo_mat = np.mat(tf_trans.euler_matrix(*rot_euler)) homo_mat[:3,3] = np.mat([pos]).T return homo_mat, quat, rot_euler ## # @return geometry_msgs.Pose @staticmethod def to_pose_msg(*args): header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args) if homo_mat is None: rospy.logwarn("[pose_converter] Unknown pose type.") return None, None, None, None else: return Pose(Point(*homo_mat[:3,3].T.A[0]), Quaternion(*quat_rot)) ## # @return geometry_msgs.PoseStamped @staticmethod def to_pose_stamped_msg(*args): header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args) if homo_mat is None: rospy.logwarn("[pose_converter] Unknown pose type.") return None, None, None, None ps = PoseStamped() if header is None: ps.header.stamp = rospy.Time.now() else: ps.header.seq = header[0] ps.header.stamp = header[1] ps.header.frame_id = header[2] ps.pose = Pose(Point(*homo_mat[:3,3].T.A[0]), Quaternion(*quat_rot)) return ps ## # @return geometry_msgs.Point @staticmethod def to_point_msg(*args): header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args) if homo_mat is None: rospy.logwarn("[pose_converter] Unknown pose type.") return None, None, None, None return Point(*homo_mat[:3,3].T.A[0]) ## # @return geometry_msgs.PointStamped @staticmethod def to_point_stamped_msg(*args): header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args) if homo_mat is None: rospy.logwarn("[pose_converter] Unknown pose type.") return None, None, None, None ps = PointStamped() if header is None: ps.header.stamp = rospy.Time.now() else: ps.header.seq = header[0] ps.header.stamp = header[1] ps.header.frame_id = header[2] ps.point = Point(*homo_mat[:3,3].T.A[0]) return ps ## # @return geometry_msgs.Transform @staticmethod def to_tf_msg(*args): header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args) if homo_mat is None: rospy.logwarn("[pose_converter] Unknown pose type.") return None, None, None, None else: return Transform(Vector3(*homo_mat[:3,3].T.A[0]), Quaternion(*quat_rot)) ## # @return geometry_msgs.TransformStamped @staticmethod def to_tf_stamped_msg(*args): header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args) if homo_mat is None: rospy.logwarn("[pose_converter] Unknown pose type.") return None, None, None, None tf_stamped = TransformStamped() if header is None: tf_stamped.header.stamp = rospy.Time.now() else: tf_stamped.header.seq = header[0] tf_stamped.header.stamp = header[1] tf_stamped.header.frame_id = header[2] tf_stamped.transform = Transform(Vector3(*homo_mat[:3,3].T.A[0]), Quaternion(*quat_rot)) return tf_stamped ## # @return geometry_msgs.Twist @staticmethod def to_twist_msg(*args): _, homo_mat, _, euler_rot = PoseConverter._make_generic(args) if homo_mat is None: rospy.logwarn("[pose_converter] Unknown pose type.") return None, None, None, None else: return Twist(Vector3(*homo_mat[:3,3].T.A[0]), Vector3(*euler_rot)) ## # @return geometry_msgs.TwistStamped @staticmethod def to_twist_stamped_msg(*args): header, homo_mat, _, euler_rot = PoseConverter._make_generic(args) if homo_mat is None: rospy.logwarn("[pose_converter] Unknown pose type.") return None, None, None, None twist_stamped = TwistStamped() header_msg = Header() if header is None: header_msg.stamp = rospy.Time.now() else: header_msg.seq = header[0] header_msg.stamp = header[1] header_msg.frame_id = header[2] return TwistStamped(header_msg, Twist(Vector3(*homo_mat[:3,3].T.A[0]), Vector3(*euler_rot))) ## # @return 4x4 numpy mat @staticmethod def to_homo_mat(*args): header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args) if homo_mat is None: rospy.logwarn("[pose_converter] Unknown pose type.") return None, None, None, None else: return homo_mat.copy() ## # @return (3x1 numpy mat, 3x3 numpy mat) @staticmethod def to_pos_rot(*args): header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args) if homo_mat is None: rospy.logwarn("[pose_converter] Unknown pose type.") return None, None, None, None else: return homo_mat[:3,3].copy(), homo_mat[:3,:3].copy() ## # @return (3 list, 4 list) @staticmethod def to_pos_quat(*args): header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args) if homo_mat is None: rospy.logwarn("[pose_converter] Unknown pose type.") return None, None, None, None else: return copy.copy(list(homo_mat[:3,3].T.A[0])), copy.copy(quat_rot) ## # @return (3 list, 3 list) @staticmethod def to_pos_euler(*args): header, homo_mat, quat_rot, euler_rot = PoseConverter._make_generic(args) if homo_mat is None: rospy.logwarn("[pose_converter] Unknown pose type.") return None, None, None, None else: return copy.copy(list(homo_mat[:3,3].T.A[0])), copy.copy(euler_rot)
ajibawa-2023/Python-Code-Large/train/row_99315
214
296
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Import_L1_C0", "label": "numpy import np", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0034, 0.0034, 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_99315:Import_L2_C0", "label": "copy import copy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0068, 0.0034, 0, 0.66, 0.1, 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_99315:Import_L4_C0", "label": "roslib import roslib", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0135, 0.0034, 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('hrl_generic_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L4_C15", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0135, 0.0034, 0, 0.66, 0.3, 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_generic_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0169, 0.0034, 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_99315:ImportFrom_L6_C0", "label": "from std_msgs.msg import Header", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0203, 0.0034, 0, 0.66, 0.5, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Header"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Header"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:ImportFrom_L7_C0", "label": "from geometry_msgs.msg import PoseStamped, Pose, Point\u2026", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0236, 0.0034, 0, 0.66, 0.6, 951, 0, 5, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["PoseStamped", "Pose", "Point", "Quaternion", "PointStamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import PoseStamped, Pose, Point, Quaternion, PointStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:ImportFrom_L8_C0", "label": "from geometry_msgs.msg import Transform, TransformStamped, Vector3", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.027, 0.0034, 0, 0.66, 0.7, 951, 0, 3, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Transform", "TransformStamped", "Vector3"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Transform, TransformStamped, Vector3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:ImportFrom_L9_C0", "label": "from geometry_msgs.msg import Twist, TwistStamped", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0304, 0.0034, 0, 0.66, 0.8, 951, 0, 2, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Twist", "TwistStamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Twist, TwistStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Import_L10_C0", "label": "tf.transformations import tf_trans", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0338, 0.0034, 0, 0.66, 0.9, 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_99315:ClassDef_L12_C0", "label": "PoseConverter", "type": "class", "loc": [12, 296], "level": 0, "parent": null, "vector": [3, 0, 0.5203, 0.9628, 0, 0.66, 1.0, 882, 0, 16, 0, 0, 0, 0, 99], "semantic": {"name": "PoseConverter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PoseConverter:\n @staticmethod\n def _make_generic(args):\n if type(args[0]) == str:\n frame_id = args[0]\n header, homo_mat, rot_quat, rot_euler = PoseConverter._make_generic(args[1:])\n if header is None:\n header = [0, rospy.Time.now(), '']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L14_C4", "label": "_make_generic", "type": "function", "loc": [14, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "vector": [2, 1, 0.2027, 0.3142, 1, 0.92, 0.0, 785, 0, 1, 1, 0, 0, 0, 42], "semantic": {"name": "_make_generic", "arg_names": ["args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _make_generic(args):\n if type(args[0]) == str:\n frame_id = args[0]\n header, homo_mat, rot_quat, rot_euler = PoseConverter._make_generic(args[1:])\n if header is None:\n header = [0, rospy.Time.now(), '']\n header[2] = frame_id\n return header, homo_mat, rot_quat, rot_euler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L15_C8", "label": "if", "type": "if", "loc": [15, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L14_C4", "vector": [4, 2, 0.0608, 0.0236, 2, 0.58, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(args[0]) == str:\n frame_id = args[0]\n header, homo_mat, rot_quat, rot_euler = PoseConverter._make_generic(args[1:])\n if header is None:\n header = [0, rospy.Time.now(), '']\n header[2] = frame_id\n return header, homo_mat, rot_quat, rot_euler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L16_C12", "label": "frame_id =", "type": "assigned_variable", "loc": [16, 16], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L15_C8", "vector": [14, 3, 0.0541, 0.0034, 3, 0.54, 0.0, 487, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frame_id = args[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L17_C12", "label": "header, homo_mat, rot_quat, rot_euler = _make_generic()", "type": "assigned_variable", "loc": [17, 17], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L15_C8", "vector": [14, 3, 0.0574, 0.0034, 3, 0.54, 0.25, 629, 3, 1, 0, 0, 785, 10, 1], "semantic": {"name": "header, homo_mat, rot_quat, rot_euler", "arg_names": [], "import_names": [], "rhs_call_name": "_make_generic", "annotation": ""}, "snippet": " header, homo_mat, rot_quat, rot_euler = PoseConverter._make_generic(args[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L18_C12", "label": "if", "type": "if", "loc": [18, 19], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L15_C8", "vector": [4, 3, 0.0625, 0.0068, 3, 0.54, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if header is None:\n header = [0, rospy.Time.now(), '']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L19_C16", "label": "header =", "type": "assigned_variable", "loc": [19, 19], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L18_C12", "vector": [14, 4, 0.0642, 0.0034, 4, 0.43, 0.0, 481, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "header", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " header = [0, rospy.Time.now(), '']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L20_C12", "label": "assign", "type": "assigned_variable", "loc": [20, 20], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L15_C8", "vector": [14, 3, 0.0676, 0.0034, 3, 0.54, 0.75, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " header[2] = frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L21_C12", "label": "return", "type": "return", "loc": [21, 21], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L15_C8", "vector": [13, 3, 0.0709, 0.0034, 3, 0.54, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return header, homo_mat, rot_quat, rot_euler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L23_C8", "label": "if", "type": "if", "loc": [23, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L14_C4", "vector": [4, 2, 0.2145, 0.277, 2, 0.58, 0.5, 0, 0, 0, 0, 0, 0, 0, 39], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(args) == 1:\n if type(args[0]) is Pose:\n homo_mat, rot_quat, rot_euler = PoseConverter._extract_pose_msg(args[0])\n return None, homo_mat, rot_quat, rot_euler\n\n elif type(args[0]) is PoseStamped:\n homo_mat, rot_quat, rot_euler = PoseConverter._extract_pose_msg(args[0].pose)\n seq = args[0].header.seq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L24_C12", "label": "if", "type": "if", "loc": [24, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L23_C8", "vector": [4, 3, 0.2061, 0.2534, 3, 0.95, 0.0, 0, 0, 0, 0, 0, 0, 0, 36], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(args[0]) is Pose:\n homo_mat, rot_quat, rot_euler = PoseConverter._extract_pose_msg(args[0])\n return None, homo_mat, rot_quat, rot_euler\n\n elif type(args[0]) is PoseStamped:\n homo_mat, rot_quat, rot_euler = PoseConverter._extract_pose_msg(args[0].pose)\n seq = args[0].header.seq\n stamp = args[0].header.stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L25_C16", "label": "homo_mat, rot_quat, rot_euler = _extract_pose_msg()", "type": "assigned_variable", "loc": [25, 25], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L24_C12", "vector": [14, 4, 0.0845, 0.0034, 4, 0.62, 0.0, 44, 3, 1, 0, 0, 440, 10, 1], "semantic": {"name": "homo_mat, rot_quat, rot_euler", "arg_names": [], "import_names": [], "rhs_call_name": "_extract_pose_msg", "annotation": ""}, "snippet": " homo_mat, rot_quat, rot_euler = PoseConverter._extract_pose_msg(args[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L26_C16", "label": "return", "type": "return", "loc": [26, 26], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L24_C12", "vector": [13, 4, 0.0878, 0.0034, 4, 0.62, 0.5, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, homo_mat, rot_quat, rot_euler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L28_C12", "label": "if", "type": "if", "loc": [28, 98], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L24_C12", "vector": [4, 4, 0.2128, 0.2399, 4, 0.62, 1.0, 0, 0, 0, 0, 0, 0, 0, 34], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif type(args[0]) is PoseStamped:\n homo_mat, rot_quat, rot_euler = PoseConverter._extract_pose_msg(args[0].pose)\n seq = args[0].header.seq\n stamp = args[0].header.stamp\n frame_id = args[0].header.frame_id\n return [seq, stamp, frame_id], homo_mat, rot_quat, rot_euler\n\n elif type(args[0]) is Transform:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L29_C16", "label": "homo_mat, rot_quat, rot_euler = _extract_pose_msg()", "type": "assigned_variable", "loc": [29, 29], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L28_C12", "vector": [14, 5, 0.098, 0.0034, 5, 0.49, 0.0, 44, 3, 1, 0, 0, 440, 10, 1], "semantic": {"name": "homo_mat, rot_quat, rot_euler", "arg_names": [], "import_names": [], "rhs_call_name": "_extract_pose_msg", "annotation": ""}, "snippet": " homo_mat, rot_quat, rot_euler = PoseConverter._extract_pose_msg(args[0].pose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L30_C16", "label": "seq =", "type": "assigned_variable", "loc": [30, 30], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L28_C12", "vector": [14, 5, 0.1014, 0.0034, 5, 0.49, 0.2, 609, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "seq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " seq = args[0].header.seq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L31_C16", "label": "stamp =", "type": "assigned_variable", "loc": [31, 31], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L28_C12", "vector": [14, 5, 0.1047, 0.0034, 5, 0.49, 0.4, 897, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stamp = args[0].header.stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L32_C16", "label": "frame_id =", "type": "assigned_variable", "loc": [32, 32], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L28_C12", "vector": [14, 5, 0.1081, 0.0034, 5, 0.49, 0.6, 487, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frame_id = args[0].header.frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L33_C16", "label": "return", "type": "return", "loc": [33, 33], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L28_C12", "vector": [13, 5, 0.1115, 0.0034, 5, 0.49, 0.8, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [seq, stamp, frame_id], homo_mat, rot_quat, rot_euler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L35_C12", "label": "if", "type": "if", "loc": [35, 98], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L28_C12", "vector": [4, 5, 0.2247, 0.2162, 5, 0.49, 1.0, 0, 0, 0, 0, 0, 0, 0, 32], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif type(args[0]) is Transform:\n homo_mat, rot_quat, rot_euler = PoseConverter._extract_tf_msg(args[0])\n return None, homo_mat, rot_quat, rot_euler\n\n elif type(args[0]) is TransformStamped:\n homo_mat, rot_quat, rot_euler = PoseConverter._extract_tf_msg(args[0].transform)\n seq = args[0].header.seq\n stamp = args[0].header.stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L36_C16", "label": "homo_mat, rot_quat, rot_euler = _extract_tf_msg()", "type": "assigned_variable", "loc": [36, 36], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L35_C12", "vector": [14, 6, 0.1216, 0.0034, 6, 0.33, 0.0, 44, 3, 1, 0, 0, 555, 10, 1], "semantic": {"name": "homo_mat, rot_quat, rot_euler", "arg_names": [], "import_names": [], "rhs_call_name": "_extract_tf_msg", "annotation": ""}, "snippet": " homo_mat, rot_quat, rot_euler = PoseConverter._extract_tf_msg(args[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L37_C16", "label": "return", "type": "return", "loc": [37, 37], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L35_C12", "vector": [13, 6, 0.125, 0.0034, 6, 0.33, 0.5, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, homo_mat, rot_quat, rot_euler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L39_C12", "label": "if", "type": "if", "loc": [39, 98], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L35_C12", "vector": [4, 6, 0.2314, 0.2027, 6, 0.33, 1.0, 0, 0, 0, 0, 0, 0, 0, 30], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif type(args[0]) is TransformStamped:\n homo_mat, rot_quat, rot_euler = PoseConverter._extract_tf_msg(args[0].transform)\n seq = args[0].header.seq\n stamp = args[0].header.stamp\n frame_id = args[0].header.frame_id\n return [seq, stamp, frame_id], homo_mat, rot_quat, rot_euler\n \n elif type(args[0]) is Twist:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L40_C16", "label": "homo_mat, rot_quat, rot_euler = _extract_tf_msg()", "type": "assigned_variable", "loc": [40, 40], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L39_C12", "vector": [14, 7, 0.1351, 0.0034, 7, 0.77, 0.0, 44, 3, 1, 0, 0, 555, 10, 1], "semantic": {"name": "homo_mat, rot_quat, rot_euler", "arg_names": [], "import_names": [], "rhs_call_name": "_extract_tf_msg", "annotation": ""}, "snippet": " homo_mat, rot_quat, rot_euler = PoseConverter._extract_tf_msg(args[0].transform)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L41_C16", "label": "seq =", "type": "assigned_variable", "loc": [41, 41], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L39_C12", "vector": [14, 7, 0.1385, 0.0034, 7, 0.77, 0.2, 609, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "seq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " seq = args[0].header.seq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L42_C16", "label": "stamp =", "type": "assigned_variable", "loc": [42, 42], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L39_C12", "vector": [14, 7, 0.1419, 0.0034, 7, 0.77, 0.4, 897, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stamp = args[0].header.stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L43_C16", "label": "frame_id =", "type": "assigned_variable", "loc": [43, 43], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L39_C12", "vector": [14, 7, 0.1453, 0.0034, 7, 0.77, 0.6, 487, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frame_id = args[0].header.frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L44_C16", "label": "return", "type": "return", "loc": [44, 44], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L39_C12", "vector": [13, 7, 0.1486, 0.0034, 7, 0.77, 0.8, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [seq, stamp, frame_id], homo_mat, rot_quat, rot_euler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L46_C12", "label": "if", "type": "if", "loc": [46, 98], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L39_C12", "vector": [4, 7, 0.2432, 0.1791, 7, 0.77, 1.0, 0, 0, 0, 0, 0, 0, 0, 28], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif type(args[0]) is Twist:\n homo_mat, rot_quat, rot_euler = PoseConverter._extract_twist_msg(args[0])\n return None, homo_mat, rot_quat, rot_euler\n\n elif type(args[0]) is TwistStamped:\n homo_mat, rot_quat, rot_euler = PoseConverter._extract_twist_msg(args[0].twist)\n seq = args[0].header.seq\n stamp = args[0].header.stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L47_C16", "label": "homo_mat, rot_quat, rot_euler = _extract_twist_msg()", "type": "assigned_variable", "loc": [47, 47], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L46_C12", "vector": [14, 8, 0.1588, 0.0034, 8, 0.48, 0.0, 44, 3, 1, 0, 0, 124, 10, 1], "semantic": {"name": "homo_mat, rot_quat, rot_euler", "arg_names": [], "import_names": [], "rhs_call_name": "_extract_twist_msg", "annotation": ""}, "snippet": " homo_mat, rot_quat, rot_euler = PoseConverter._extract_twist_msg(args[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L48_C16", "label": "return", "type": "return", "loc": [48, 48], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L46_C12", "vector": [13, 8, 0.1622, 0.0034, 8, 0.48, 0.5, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, homo_mat, rot_quat, rot_euler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L50_C12", "label": "if", "type": "if", "loc": [50, 98], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L46_C12", "vector": [4, 8, 0.25, 0.1655, 8, 0.48, 1.0, 0, 0, 0, 0, 0, 0, 0, 26], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif type(args[0]) is TwistStamped:\n homo_mat, rot_quat, rot_euler = PoseConverter._extract_twist_msg(args[0].twist)\n seq = args[0].header.seq\n stamp = args[0].header.stamp\n frame_id = args[0].header.frame_id\n return [seq, stamp, frame_id], homo_mat, rot_quat, rot_euler\n\n elif isinstance(args[0], (np.matrix, np.ndarray)) and np.shape(args[0]) == (4, 4):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L51_C16", "label": "homo_mat, rot_quat, rot_euler = _extract_twist_msg()", "type": "assigned_variable", "loc": [51, 51], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L50_C12", "vector": [14, 9, 0.1723, 0.0034, 9, 0.2, 0.0, 44, 3, 1, 0, 0, 124, 10, 1], "semantic": {"name": "homo_mat, rot_quat, rot_euler", "arg_names": [], "import_names": [], "rhs_call_name": "_extract_twist_msg", "annotation": ""}, "snippet": " homo_mat, rot_quat, rot_euler = PoseConverter._extract_twist_msg(args[0].twist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L52_C16", "label": "seq =", "type": "assigned_variable", "loc": [52, 52], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L50_C12", "vector": [14, 9, 0.1757, 0.0034, 9, 0.2, 0.2, 609, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "seq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " seq = args[0].header.seq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L53_C16", "label": "stamp =", "type": "assigned_variable", "loc": [53, 53], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L50_C12", "vector": [14, 9, 0.1791, 0.0034, 9, 0.2, 0.4, 897, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stamp = args[0].header.stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L54_C16", "label": "frame_id =", "type": "assigned_variable", "loc": [54, 54], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L50_C12", "vector": [14, 9, 0.1824, 0.0034, 9, 0.2, 0.6, 487, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frame_id = args[0].header.frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L55_C16", "label": "return", "type": "return", "loc": [55, 55], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L50_C12", "vector": [13, 9, 0.1858, 0.0034, 9, 0.2, 0.8, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [seq, stamp, frame_id], homo_mat, rot_quat, rot_euler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L57_C12", "label": "if", "type": "if", "loc": [57, 98], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L50_C12", "vector": [4, 9, 0.2618, 0.1419, 9, 0.2, 1.0, 0, 0, 0, 0, 0, 0, 0, 24], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif isinstance(args[0], (np.matrix, np.ndarray)) and np.shape(args[0]) == (4, 4):\n return (None, np.mat(args[0]), tf_trans.quaternion_from_matrix(args[0]).tolist(),\n tf_trans.euler_from_matrix(args[0]))\n\n elif isinstance(args[0], (tuple, list)) and len(args[0]) == 2:\n pos_arg = np.mat(args[0][0])\n rot_arg = np.mat(args[0][1])\n if pos_arg.shape == (1, 3):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L58_C16", "label": "return", "type": "return", "loc": [58, 59], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L57_C12", "vector": [13, 10, 0.1976, 0.0068, 10, 0.27, 0.0, 0, 0, 0, 0, 0, 0, 8, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (None, np.mat(args[0]), tf_trans.quaternion_from_matrix(args[0]).tolist(),\n tf_trans.euler_from_matrix(args[0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L61_C12", "label": "if", "type": "if", "loc": [61, 98], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L57_C12", "vector": [4, 10, 0.2686, 0.1284, 10, 0.27, 1.0, 0, 0, 0, 0, 0, 0, 0, 18], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif isinstance(args[0], (tuple, list)) and len(args[0]) == 2:\n pos_arg = np.mat(args[0][0])\n rot_arg = np.mat(args[0][1])\n if pos_arg.shape == (1, 3):\n # matrix is row, convert to column\n pos = pos_arg.T\n elif pos_arg.shape == (3, 1):\n pos = pos_arg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L62_C16", "label": "pos_arg = mat()", "type": "assigned_variable", "loc": [62, 62], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L61_C12", "vector": [14, 11, 0.2095, 0.0034, 11, 0.01, 0.0, 909, 3, 1, 0, 0, 882, 10, 1], "semantic": {"name": "pos_arg", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " pos_arg = np.mat(args[0][0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L63_C16", "label": "rot_arg = mat()", "type": "assigned_variable", "loc": [63, 63], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L61_C12", "vector": [14, 11, 0.2128, 0.0034, 11, 0.01, 0.2, 545, 3, 1, 0, 0, 882, 10, 1], "semantic": {"name": "rot_arg", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " rot_arg = np.mat(args[0][1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L64_C16", "label": "if", "type": "if", "loc": [64, 70], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L61_C12", "vector": [4, 11, 0.2264, 0.0236, 11, 0.01, 0.4, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pos_arg.shape == (1, 3):\n # matrix is row, convert to column\n pos = pos_arg.T\n elif pos_arg.shape == (3, 1):\n pos = pos_arg\n else:\n return None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L66_C20", "label": "pos =", "type": "assigned_variable", "loc": [66, 66], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L64_C16", "vector": [14, 12, 0.223, 0.0034, 12, 0.93, 0.0, 627, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = pos_arg.T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L67_C16", "label": "if", "type": "if", "loc": [67, 70], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L64_C16", "vector": [4, 12, 0.2314, 0.0135, 12, 0.93, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif pos_arg.shape == (3, 1):\n pos = pos_arg\n else:\n return None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L68_C20", "label": "pos =", "type": "assigned_variable", "loc": [68, 68], "level": 13, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L67_C16", "vector": [14, 13, 0.2297, 0.0034, 13, 0.22, 0.0, 627, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = pos_arg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L70_C20", "label": "return", "type": "return", "loc": [70, 70], "level": 13, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L67_C16", "vector": [13, 13, 0.2365, 0.0034, 13, 0.22, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L72_C16", "label": "if", "type": "if", "loc": [72, 95], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L61_C12", "vector": [4, 11, 0.2821, 0.0811, 11, 0.01, 0.6, 0, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rot_arg.shape == (3, 3):\n # rotation matrix\n homo_mat = np.mat(np.eye(4))\n homo_mat[:3,:3] = rot_arg\n quat = tf_trans.quaternion_from_matrix(homo_mat)\n rot_euler = tf_trans.euler_from_matrix(homo_mat)\n else:\n if rot_arg.shape[1] == 1:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L74_C20", "label": "homo_mat = mat()", "type": "assigned_variable", "loc": [74, 74], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L72_C16", "vector": [14, 12, 0.25, 0.0034, 12, 0.36, 0.0, 775, 3, 1, 0, 0, 882, 10, 2], "semantic": {"name": "homo_mat", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " homo_mat = np.mat(np.eye(4))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L75_C20", "label": "assign", "type": "assigned_variable", "loc": [75, 75], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L72_C16", "vector": [14, 12, 0.2534, 0.0034, 12, 0.36, 0.25, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " homo_mat[:3,:3] = rot_arg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L76_C20", "label": "quat = quaternion_from_matrix()", "type": "assigned_variable", "loc": [76, 76], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L72_C16", "vector": [14, 12, 0.2568, 0.0034, 12, 0.36, 0.5, 367, 3, 1, 0, 0, 61, 10, 1], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_from_matrix", "annotation": ""}, "snippet": " quat = tf_trans.quaternion_from_matrix(homo_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L77_C20", "label": "rot_euler = euler_from_matrix()", "type": "assigned_variable", "loc": [77, 77], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L72_C16", "vector": [14, 12, 0.2601, 0.0034, 12, 0.36, 0.75, 400, 3, 1, 0, 0, 341, 10, 1], "semantic": {"name": "rot_euler", "arg_names": [], "import_names": [], "rhs_call_name": "euler_from_matrix", "annotation": ""}, "snippet": " rot_euler = tf_trans.euler_from_matrix(homo_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L79_C20", "label": "if", "type": "if", "loc": [79, 95], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L72_C16", "vector": [4, 12, 0.2939, 0.0574, 12, 0.36, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rot_arg.shape[1] == 1:\n # make into row matrix\n rot_arg = rot_arg.T\n else:\n rot_arg = rot_arg.tolist()[0]\n if len(rot_arg) == 3:\n # Euler angles rotation\n homo_mat = np.mat(tf_trans.euler_matrix(*rot_arg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L81_C24", "label": "rot_arg =", "type": "assigned_variable", "loc": [81, 81], "level": 13, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L79_C20", "vector": [14, 13, 0.2736, 0.0034, 13, 0.94, 0.0, 545, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rot_arg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_arg = rot_arg.T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L83_C24", "label": "rot_arg =", "type": "assigned_variable", "loc": [83, 83], "level": 13, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L79_C20", "vector": [14, 13, 0.2804, 0.0034, 13, 0.94, 0.5, 545, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rot_arg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_arg = rot_arg.tolist()[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L84_C24", "label": "if", "type": "if", "loc": [84, 95], "level": 13, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L79_C20", "vector": [4, 13, 0.3024, 0.0405, 13, 0.94, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(rot_arg) == 3:\n # Euler angles rotation\n homo_mat = np.mat(tf_trans.euler_matrix(*rot_arg))\n quat = tf_trans.quaternion_from_euler(*rot_arg)\n rot_euler = rot_arg\n elif len(rot_arg) == 4:\n # quaternion rotation\n homo_mat = np.mat(tf_trans.quaternion_matrix(rot_arg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L86_C28", "label": "homo_mat = mat()", "type": "assigned_variable", "loc": [86, 86], "level": 14, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L84_C24", "vector": [14, 14, 0.2905, 0.0034, 14, 0.78, 0.0, 775, 3, 1, 0, 0, 882, 10, 2], "semantic": {"name": "homo_mat", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " homo_mat = np.mat(tf_trans.euler_matrix(*rot_arg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L87_C28", "label": "quat = quaternion_from_euler()", "type": "assigned_variable", "loc": [87, 87], "level": 14, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L84_C24", "vector": [14, 14, 0.2939, 0.0034, 14, 0.78, 0.3333, 367, 3, 1, 0, 0, 561, 10, 1], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_from_euler", "annotation": ""}, "snippet": " quat = tf_trans.quaternion_from_euler(*rot_arg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L88_C28", "label": "rot_euler =", "type": "assigned_variable", "loc": [88, 88], "level": 14, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L84_C24", "vector": [14, 14, 0.2973, 0.0034, 14, 0.78, 0.6667, 400, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rot_euler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_euler = rot_arg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L89_C24", "label": "if", "type": "if", "loc": [89, 95], "level": 14, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L84_C24", "vector": [4, 14, 0.3108, 0.0236, 14, 0.78, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif len(rot_arg) == 4:\n # quaternion rotation\n homo_mat = np.mat(tf_trans.quaternion_matrix(rot_arg))\n quat = rot_arg\n rot_euler = tf_trans.euler_from_quaternion(quat)\n else:\n return None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L91_C28", "label": "homo_mat = mat()", "type": "assigned_variable", "loc": [91, 91], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L89_C24", "vector": [14, 15, 0.3074, 0.0034, 15, 0.85, 0.0, 775, 3, 1, 0, 0, 882, 10, 2], "semantic": {"name": "homo_mat", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " homo_mat = np.mat(tf_trans.quaternion_matrix(rot_arg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L92_C28", "label": "quat =", "type": "assigned_variable", "loc": [92, 92], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L89_C24", "vector": [14, 15, 0.3108, 0.0034, 15, 0.85, 0.3333, 367, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " quat = rot_arg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L93_C28", "label": "rot_euler = euler_from_quaternion()", "type": "assigned_variable", "loc": [93, 93], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L89_C24", "vector": [14, 15, 0.3142, 0.0034, 15, 0.85, 0.6667, 400, 3, 1, 0, 0, 409, 10, 1], "semantic": {"name": "rot_euler", "arg_names": [], "import_names": [], "rhs_call_name": "euler_from_quaternion", "annotation": ""}, "snippet": " rot_euler = tf_trans.euler_from_quaternion(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L95_C28", "label": "return", "type": "return", "loc": [95, 95], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L89_C24", "vector": [13, 15, 0.3209, 0.0034, 15, 0.85, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L97_C16", "label": "assign", "type": "assigned_variable", "loc": [97, 97], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L61_C12", "vector": [14, 11, 0.3277, 0.0034, 11, 0.01, 0.8, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " homo_mat[:3, 3] = pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L98_C16", "label": "return", "type": "return", "loc": [98, 98], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L61_C12", "vector": [13, 11, 0.3311, 0.0034, 11, 0.01, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, homo_mat, np.array(quat), rot_euler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L100_C8", "label": "if", "type": "if", "loc": [100, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L23_C8", "vector": [4, 3, 0.3446, 0.0169, 3, 0.95, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif len(args) == 2:\n header, homo_mat, rot_quat, rot_euler = PoseConverter._make_generic(\n ((args[0], args[1]),))\n if homo_mat is not None:\n return header, homo_mat, rot_quat, rot_euler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L101_C12", "label": "header, homo_mat, rot_quat, rot_euler = _make_generic()", "type": "assigned_variable", "loc": [101, 102], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L100_C8", "vector": [14, 4, 0.3429, 0.0068, 4, 0.84, 0.0, 629, 3, 1, 0, 0, 785, 10, 1], "semantic": {"name": "header, homo_mat, rot_quat, rot_euler", "arg_names": [], "import_names": [], "rhs_call_name": "_make_generic", "annotation": ""}, "snippet": " header, homo_mat, rot_quat, rot_euler = PoseConverter._make_generic(\n ((args[0], args[1]),))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L103_C12", "label": "if", "type": "if", "loc": [103, 104], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L100_C8", "vector": [4, 4, 0.3497, 0.0068, 4, 0.84, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if homo_mat is not None:\n return header, homo_mat, rot_quat, rot_euler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L104_C16", "label": "return", "type": "return", "loc": [104, 104], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L103_C12", "vector": [13, 5, 0.3514, 0.0034, 5, 0.74, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return header, homo_mat, rot_quat, rot_euler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L106_C8", "label": "return", "type": "return", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L14_C4", "vector": [13, 2, 0.3581, 0.0034, 2, 0.58, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "label": "_extract_pose_msg", "type": "function", "loc": [109, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "vector": [2, 1, 0.3818, 0.0304, 1, 0.92, 0.0667, 440, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "_extract_pose_msg", "arg_names": ["pose"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _extract_pose_msg(pose):\n px = pose.position.x; py = pose.position.y; pz = pose.position.z\n ox = pose.orientation.x; oy = pose.orientation.y\n oz = pose.orientation.z; ow = pose.orientation.w\n quat = [ox, oy, oz, ow]\n rot_euler = tf_trans.euler_from_quaternion(quat)\n homo_mat = np.mat(tf_trans.quaternion_matrix(quat))\n homo_mat[:3,3] = np.mat([[px, py, pz]]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L110_C8", "label": "px =", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "vector": [14, 2, 0.3716, 0.0034, 2, 0.74, 0.0, 422, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "px", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " px = pose.position.x; py = pose.position.y; pz = pose.position.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L110_C30", "label": "py =", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "vector": [14, 2, 0.3716, 0.0034, 2, 0.74, 0.0909, 368, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "py", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " px = pose.position.x; py = pose.position.y; pz = pose.position.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L110_C52", "label": "pz =", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "vector": [14, 2, 0.3716, 0.0034, 2, 0.74, 0.1818, 266, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " px = pose.position.x; py = pose.position.y; pz = pose.position.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L111_C8", "label": "ox =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "vector": [14, 2, 0.375, 0.0034, 2, 0.74, 0.2727, 467, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ox", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ox = pose.orientation.x; oy = pose.orientation.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L111_C33", "label": "oy =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "vector": [14, 2, 0.375, 0.0034, 2, 0.74, 0.3636, 199, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "oy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ox = pose.orientation.x; oy = pose.orientation.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L112_C8", "label": "oz =", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "vector": [14, 2, 0.3784, 0.0034, 2, 0.74, 0.4545, 417, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "oz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " oz = pose.orientation.z; ow = pose.orientation.w"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L112_C33", "label": "ow =", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "vector": [14, 2, 0.3784, 0.0034, 2, 0.74, 0.5455, 710, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ow", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " oz = pose.orientation.z; ow = pose.orientation.w"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L113_C8", "label": "quat =", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "vector": [14, 2, 0.3818, 0.0034, 2, 0.74, 0.6364, 367, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " quat = [ox, oy, oz, ow]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L114_C8", "label": "rot_euler = euler_from_quaternion()", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "vector": [14, 2, 0.3851, 0.0034, 2, 0.74, 0.7273, 400, 3, 1, 0, 0, 409, 10, 1], "semantic": {"name": "rot_euler", "arg_names": [], "import_names": [], "rhs_call_name": "euler_from_quaternion", "annotation": ""}, "snippet": " rot_euler = tf_trans.euler_from_quaternion(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L115_C8", "label": "homo_mat = mat()", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "vector": [14, 2, 0.3885, 0.0034, 2, 0.74, 0.8182, 775, 3, 1, 0, 0, 882, 10, 2], "semantic": {"name": "homo_mat", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " homo_mat = np.mat(tf_trans.quaternion_matrix(quat))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L116_C8", "label": "assign", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "vector": [14, 2, 0.3919, 0.0034, 2, 0.74, 0.9091, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " homo_mat[:3,3] = np.mat([[px, py, pz]]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L117_C8", "label": "return", "type": "return", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "vector": [13, 2, 0.3953, 0.0034, 2, 0.74, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return homo_mat, quat, rot_euler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "label": "_extract_tf_msg", "type": "function", "loc": [120, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "vector": [2, 1, 0.4189, 0.0304, 1, 0.92, 0.1333, 555, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "_extract_tf_msg", "arg_names": ["tf_msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _extract_tf_msg(tf_msg):\n px = tf_msg.translation.x; py = tf_msg.translation.y; pz = tf_msg.translation.z \n ox = tf_msg.rotation.x; oy = tf_msg.rotation.y\n oz = tf_msg.rotation.z; ow = tf_msg.rotation.w\n quat = [ox, oy, oz, ow]\n rot_euler = tf_trans.euler_from_quaternion(quat)\n homo_mat = np.mat(tf_trans.quaternion_matrix(quat))\n homo_mat[:3,3] = np.mat([[px, py, pz]]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L121_C8", "label": "px =", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "vector": [14, 2, 0.4088, 0.0034, 2, 0.07, 0.0, 422, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "px", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " px = tf_msg.translation.x; py = tf_msg.translation.y; pz = tf_msg.translation.z "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L121_C35", "label": "py =", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "vector": [14, 2, 0.4088, 0.0034, 2, 0.07, 0.0909, 368, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "py", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " px = tf_msg.translation.x; py = tf_msg.translation.y; pz = tf_msg.translation.z "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L121_C62", "label": "pz =", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "vector": [14, 2, 0.4088, 0.0034, 2, 0.07, 0.1818, 266, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " px = tf_msg.translation.x; py = tf_msg.translation.y; pz = tf_msg.translation.z "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L122_C8", "label": "ox =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "vector": [14, 2, 0.4122, 0.0034, 2, 0.07, 0.2727, 467, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ox", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ox = tf_msg.rotation.x; oy = tf_msg.rotation.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L122_C32", "label": "oy =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "vector": [14, 2, 0.4122, 0.0034, 2, 0.07, 0.3636, 199, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "oy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ox = tf_msg.rotation.x; oy = tf_msg.rotation.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L123_C8", "label": "oz =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "vector": [14, 2, 0.4155, 0.0034, 2, 0.07, 0.4545, 417, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "oz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " oz = tf_msg.rotation.z; ow = tf_msg.rotation.w"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L123_C32", "label": "ow =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "vector": [14, 2, 0.4155, 0.0034, 2, 0.07, 0.5455, 710, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ow", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " oz = tf_msg.rotation.z; ow = tf_msg.rotation.w"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L124_C8", "label": "quat =", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "vector": [14, 2, 0.4189, 0.0034, 2, 0.07, 0.6364, 367, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " quat = [ox, oy, oz, ow]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L125_C8", "label": "rot_euler = euler_from_quaternion()", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "vector": [14, 2, 0.4223, 0.0034, 2, 0.07, 0.7273, 400, 3, 1, 0, 0, 409, 10, 1], "semantic": {"name": "rot_euler", "arg_names": [], "import_names": [], "rhs_call_name": "euler_from_quaternion", "annotation": ""}, "snippet": " rot_euler = tf_trans.euler_from_quaternion(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L126_C8", "label": "homo_mat = mat()", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "vector": [14, 2, 0.4257, 0.0034, 2, 0.07, 0.8182, 775, 3, 1, 0, 0, 882, 10, 2], "semantic": {"name": "homo_mat", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " homo_mat = np.mat(tf_trans.quaternion_matrix(quat))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L127_C8", "label": "assign", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "vector": [14, 2, 0.4291, 0.0034, 2, 0.07, 0.9091, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " homo_mat[:3,3] = np.mat([[px, py, pz]]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L128_C8", "label": "return", "type": "return", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "vector": [13, 2, 0.4324, 0.0034, 2, 0.07, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return homo_mat, quat, rot_euler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L131_C4", "label": "_extract_twist_msg", "type": "function", "loc": [131, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "vector": [2, 1, 0.4527, 0.0236, 1, 0.92, 0.2, 124, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "_extract_twist_msg", "arg_names": ["twist_msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _extract_twist_msg(twist_msg):\n pos = [twist_msg.linear.x, twist_msg.linear.y, twist_msg.linear.z]\n rot_euler = [twist_msg.angular.x, twist_msg.angular.y, twist_msg.angular.z]\n quat = tf_trans.quaternion_from_euler(*rot_euler, axes='sxyz')\n homo_mat = np.mat(tf_trans.euler_matrix(*rot_euler))\n homo_mat[:3,3] = np.mat([pos]).T\n return homo_mat, quat, rot_euler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L132_C8", "label": "pos =", "type": "assigned_variable", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L131_C4", "vector": [14, 2, 0.4459, 0.0034, 2, 0.5, 0.0, 627, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = [twist_msg.linear.x, twist_msg.linear.y, twist_msg.linear.z]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L133_C8", "label": "rot_euler =", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L131_C4", "vector": [14, 2, 0.4493, 0.0034, 2, 0.5, 0.2, 400, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "rot_euler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_euler = [twist_msg.angular.x, twist_msg.angular.y, twist_msg.angular.z]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L134_C8", "label": "quat = quaternion_from_euler()", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L131_C4", "vector": [14, 2, 0.4527, 0.0034, 2, 0.5, 0.4, 367, 3, 2, 0, 0, 561, 10, 1], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_from_euler", "annotation": ""}, "snippet": " quat = tf_trans.quaternion_from_euler(*rot_euler, axes='sxyz')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L135_C8", "label": "homo_mat = mat()", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L131_C4", "vector": [14, 2, 0.4561, 0.0034, 2, 0.5, 0.6, 775, 3, 1, 0, 0, 882, 10, 2], "semantic": {"name": "homo_mat", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " homo_mat = np.mat(tf_trans.euler_matrix(*rot_euler))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L136_C8", "label": "assign", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L131_C4", "vector": [14, 2, 0.4595, 0.0034, 2, 0.5, 0.8, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " homo_mat[:3,3] = np.mat([pos]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L137_C8", "label": "return", "type": "return", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L131_C4", "vector": [13, 2, 0.4628, 0.0034, 2, 0.5, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return homo_mat, quat, rot_euler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L142_C4", "label": "to_pose_msg", "type": "function", "loc": [142, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "vector": [2, 1, 0.4899, 0.0236, 1, 0.92, 0.2667, 814, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "to_pose_msg", "arg_names": ["args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_pose_msg(*args):\n header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args)\n if homo_mat is None:\n rospy.logwarn(\"[pose_converter] Unknown pose type.\")\n return None, None, None, None\n else:\n return Pose(Point(*homo_mat[:3,3].T.A[0]), Quaternion(*quat_rot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L143_C8", "label": "header, homo_mat, quat_rot, _ = _make_generic()", "type": "assigned_variable", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L142_C4", "vector": [14, 2, 0.4831, 0.0034, 2, 0.28, 0.0, 825, 3, 1, 0, 0, 785, 10, 1], "semantic": {"name": "header, homo_mat, quat_rot, _", "arg_names": [], "import_names": [], "rhs_call_name": "_make_generic", "annotation": ""}, "snippet": " header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L144_C8", "label": "if", "type": "if", "loc": [144, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L142_C4", "vector": [4, 2, 0.4932, 0.0169, 2, 0.28, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if homo_mat is None:\n rospy.logwarn(\"[pose_converter] Unknown pose type.\")\n return None, None, None, None\n else:\n return Pose(Point(*homo_mat[:3,3].T.A[0]), Quaternion(*quat_rot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L145_C12", "label": "logwarn()", "type": "expression", "loc": [145, 145], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L144_C8", "vector": [8, 3, 0.4899, 0.0034, 3, 0.58, 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(\"[pose_converter] Unknown pose type.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L146_C12", "label": "return", "type": "return", "loc": [146, 146], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L144_C8", "vector": [13, 3, 0.4932, 0.0034, 3, 0.58, 0.5, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L148_C12", "label": "return", "type": "return", "loc": [148, 148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L144_C8", "vector": [13, 3, 0.5, 0.0034, 3, 0.58, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Pose(Point(*homo_mat[:3,3].T.A[0]), Quaternion(*quat_rot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L153_C4", "label": "to_pose_stamped_msg", "type": "function", "loc": [153, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "vector": [2, 1, 0.5389, 0.0473, 1, 0.92, 0.3333, 996, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "to_pose_stamped_msg", "arg_names": ["args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_pose_stamped_msg(*args):\n header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args)\n if homo_mat is None:\n rospy.logwarn(\"[pose_converter] Unknown pose type.\")\n return None, None, None, None\n ps = PoseStamped()\n if header is None:\n ps.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L154_C8", "label": "header, homo_mat, quat_rot, _ = _make_generic()", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L153_C4", "vector": [14, 2, 0.5203, 0.0034, 2, 0.13, 0.0, 825, 3, 1, 0, 0, 785, 10, 1], "semantic": {"name": "header, homo_mat, quat_rot, _", "arg_names": [], "import_names": [], "rhs_call_name": "_make_generic", "annotation": ""}, "snippet": " header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L155_C8", "label": "if", "type": "if", "loc": [155, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L153_C4", "vector": [4, 2, 0.527, 0.0101, 2, 0.13, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if homo_mat is None:\n rospy.logwarn(\"[pose_converter] Unknown pose type.\")\n return None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L156_C12", "label": "logwarn()", "type": "expression", "loc": [156, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L155_C8", "vector": [8, 3, 0.527, 0.0034, 3, 0.23, 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(\"[pose_converter] Unknown pose type.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L157_C12", "label": "return", "type": "return", "loc": [157, 157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L155_C8", "vector": [13, 3, 0.5304, 0.0034, 3, 0.23, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L158_C8", "label": "ps = PoseStamped()", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L153_C4", "vector": [14, 2, 0.5338, 0.0034, 2, 0.13, 0.4, 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_99315:If_L159_C8", "label": "if", "type": "if", "loc": [159, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L153_C4", "vector": [4, 2, 0.5456, 0.0203, 2, 0.13, 0.6, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if header is None:\n ps.header.stamp = rospy.Time.now()\n else:\n ps.header.seq = header[0]\n ps.header.stamp = header[1]\n ps.header.frame_id = header[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L160_C12", "label": "ps.header.stamp = now()", "type": "assigned_variable", "loc": [160, 160], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L159_C8", "vector": [14, 3, 0.5405, 0.0034, 3, 0.01, 0.0, 161, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " ps.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L162_C12", "label": "ps.header.seq =", "type": "assigned_variable", "loc": [162, 162], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L159_C8", "vector": [14, 3, 0.5473, 0.0034, 3, 0.01, 0.3333, 222, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.header.seq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.header.seq = header[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L163_C12", "label": "ps.header.stamp =", "type": "assigned_variable", "loc": [163, 163], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L159_C8", "vector": [14, 3, 0.5507, 0.0034, 3, 0.01, 0.6667, 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 = header[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L164_C12", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [164, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L159_C8", "vector": [14, 3, 0.5541, 0.0034, 3, 0.01, 1.0, 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 = header[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L165_C8", "label": "ps.pose = Pose()", "type": "assigned_variable", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L153_C4", "vector": [14, 2, 0.5574, 0.0034, 2, 0.13, 0.8, 529, 3, 2, 0, 0, 902, 10, 3], "semantic": {"name": "ps.pose", "arg_names": [], "import_names": [], "rhs_call_name": "Pose", "annotation": ""}, "snippet": " ps.pose = Pose(Point(*homo_mat[:3,3].T.A[0]), Quaternion(*quat_rot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L166_C8", "label": "return", "type": "return", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L153_C4", "vector": [13, 2, 0.5608, 0.0034, 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 ps"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L171_C4", "label": "to_point_msg", "type": "function", "loc": [171, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "vector": [2, 1, 0.5861, 0.0203, 1, 0.92, 0.4, 7, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "to_point_msg", "arg_names": ["args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_point_msg(*args):\n header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args)\n if homo_mat is None:\n rospy.logwarn(\"[pose_converter] Unknown pose type.\")\n return None, None, None, None\n return Point(*homo_mat[:3,3].T.A[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L172_C8", "label": "header, homo_mat, quat_rot, _ = _make_generic()", "type": "assigned_variable", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L171_C4", "vector": [14, 2, 0.5811, 0.0034, 2, 0.64, 0.0, 825, 3, 1, 0, 0, 785, 10, 1], "semantic": {"name": "header, homo_mat, quat_rot, _", "arg_names": [], "import_names": [], "rhs_call_name": "_make_generic", "annotation": ""}, "snippet": " header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L173_C8", "label": "if", "type": "if", "loc": [173, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L171_C4", "vector": [4, 2, 0.5878, 0.0101, 2, 0.64, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if homo_mat is None:\n rospy.logwarn(\"[pose_converter] Unknown pose type.\")\n return None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L174_C12", "label": "logwarn()", "type": "expression", "loc": [174, 174], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L173_C8", "vector": [8, 3, 0.5878, 0.0034, 3, 0.22, 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(\"[pose_converter] Unknown pose type.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L175_C12", "label": "return", "type": "return", "loc": [175, 175], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L173_C8", "vector": [13, 3, 0.5912, 0.0034, 3, 0.22, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L176_C8", "label": "return", "type": "return", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L171_C4", "vector": [13, 2, 0.5946, 0.0034, 2, 0.64, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Point(*homo_mat[:3,3].T.A[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L181_C4", "label": "to_point_stamped_msg", "type": "function", "loc": [181, 194], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "vector": [2, 1, 0.6334, 0.0473, 1, 0.92, 0.4667, 618, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "to_point_stamped_msg", "arg_names": ["args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_point_stamped_msg(*args):\n header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args)\n if homo_mat is None:\n rospy.logwarn(\"[pose_converter] Unknown pose type.\")\n return None, None, None, None\n ps = PointStamped()\n if header is None:\n ps.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L182_C8", "label": "header, homo_mat, quat_rot, _ = _make_generic()", "type": "assigned_variable", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L181_C4", "vector": [14, 2, 0.6149, 0.0034, 2, 0.34, 0.0, 825, 3, 1, 0, 0, 785, 10, 1], "semantic": {"name": "header, homo_mat, quat_rot, _", "arg_names": [], "import_names": [], "rhs_call_name": "_make_generic", "annotation": ""}, "snippet": " header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L183_C8", "label": "if", "type": "if", "loc": [183, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L181_C4", "vector": [4, 2, 0.6216, 0.0101, 2, 0.34, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if homo_mat is None:\n rospy.logwarn(\"[pose_converter] Unknown pose type.\")\n return None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L184_C12", "label": "logwarn()", "type": "expression", "loc": [184, 184], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L183_C8", "vector": [8, 3, 0.6216, 0.0034, 3, 0.07, 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(\"[pose_converter] Unknown pose type.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L185_C12", "label": "return", "type": "return", "loc": [185, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L183_C8", "vector": [13, 3, 0.625, 0.0034, 3, 0.07, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L186_C8", "label": "ps = PointStamped()", "type": "assigned_variable", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L181_C4", "vector": [14, 2, 0.6284, 0.0034, 2, 0.34, 0.4, 232, 3, 0, 0, 0, 969, 10, 1], "semantic": {"name": "ps", "arg_names": [], "import_names": [], "rhs_call_name": "PointStamped", "annotation": ""}, "snippet": " ps = PointStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L187_C8", "label": "if", "type": "if", "loc": [187, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L181_C4", "vector": [4, 2, 0.6402, 0.0203, 2, 0.34, 0.6, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if header is None:\n ps.header.stamp = rospy.Time.now()\n else:\n ps.header.seq = header[0]\n ps.header.stamp = header[1]\n ps.header.frame_id = header[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L188_C12", "label": "ps.header.stamp = now()", "type": "assigned_variable", "loc": [188, 188], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L187_C8", "vector": [14, 3, 0.6351, 0.0034, 3, 0.25, 0.0, 161, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " ps.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L190_C12", "label": "ps.header.seq =", "type": "assigned_variable", "loc": [190, 190], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L187_C8", "vector": [14, 3, 0.6419, 0.0034, 3, 0.25, 0.3333, 222, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.header.seq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.header.seq = header[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L191_C12", "label": "ps.header.stamp =", "type": "assigned_variable", "loc": [191, 191], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L187_C8", "vector": [14, 3, 0.6453, 0.0034, 3, 0.25, 0.6667, 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 = header[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L192_C12", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [192, 192], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L187_C8", "vector": [14, 3, 0.6486, 0.0034, 3, 0.25, 1.0, 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 = header[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L193_C8", "label": "ps.point = Point()", "type": "assigned_variable", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L181_C4", "vector": [14, 2, 0.652, 0.0034, 2, 0.34, 0.8, 715, 3, 1, 0, 0, 652, 10, 1], "semantic": {"name": "ps.point", "arg_names": [], "import_names": [], "rhs_call_name": "Point", "annotation": ""}, "snippet": " ps.point = Point(*homo_mat[:3,3].T.A[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L194_C8", "label": "return", "type": "return", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L181_C4", "vector": [13, 2, 0.6554, 0.0034, 2, 0.34, 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_99315:FunctionDef_L199_C4", "label": "to_tf_msg", "type": "function", "loc": [199, 205], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "vector": [2, 1, 0.6824, 0.0236, 1, 0.92, 0.5333, 126, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "to_tf_msg", "arg_names": ["args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_tf_msg(*args):\n header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args)\n if homo_mat is None:\n rospy.logwarn(\"[pose_converter] Unknown pose type.\")\n return None, None, None, None\n else:\n return Transform(Vector3(*homo_mat[:3,3].T.A[0]), Quaternion(*quat_rot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L200_C8", "label": "header, homo_mat, quat_rot, _ = _make_generic()", "type": "assigned_variable", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L199_C4", "vector": [14, 2, 0.6757, 0.0034, 2, 0.09, 0.0, 825, 3, 1, 0, 0, 785, 10, 1], "semantic": {"name": "header, homo_mat, quat_rot, _", "arg_names": [], "import_names": [], "rhs_call_name": "_make_generic", "annotation": ""}, "snippet": " header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L201_C8", "label": "if", "type": "if", "loc": [201, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L199_C4", "vector": [4, 2, 0.6858, 0.0169, 2, 0.09, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if homo_mat is None:\n rospy.logwarn(\"[pose_converter] Unknown pose type.\")\n return None, None, None, None\n else:\n return Transform(Vector3(*homo_mat[:3,3].T.A[0]), Quaternion(*quat_rot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L202_C12", "label": "logwarn()", "type": "expression", "loc": [202, 202], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L201_C8", "vector": [8, 3, 0.6824, 0.0034, 3, 0.75, 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(\"[pose_converter] Unknown pose type.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L203_C12", "label": "return", "type": "return", "loc": [203, 203], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L201_C8", "vector": [13, 3, 0.6858, 0.0034, 3, 0.75, 0.5, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L205_C12", "label": "return", "type": "return", "loc": [205, 205], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L201_C8", "vector": [13, 3, 0.6926, 0.0034, 3, 0.75, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Transform(Vector3(*homo_mat[:3,3].T.A[0]), Quaternion(*quat_rot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L210_C4", "label": "to_tf_stamped_msg", "type": "function", "loc": [210, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "vector": [2, 1, 0.7314, 0.0473, 1, 0.92, 0.6, 100, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "to_tf_stamped_msg", "arg_names": ["args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_tf_stamped_msg(*args):\n header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args)\n if homo_mat is None:\n rospy.logwarn(\"[pose_converter] Unknown pose type.\")\n return None, None, None, None\n tf_stamped = TransformStamped()\n if header is None:\n tf_stamped.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L211_C8", "label": "header, homo_mat, quat_rot, _ = _make_generic()", "type": "assigned_variable", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L210_C4", "vector": [14, 2, 0.7128, 0.0034, 2, 0.71, 0.0, 825, 3, 1, 0, 0, 785, 10, 1], "semantic": {"name": "header, homo_mat, quat_rot, _", "arg_names": [], "import_names": [], "rhs_call_name": "_make_generic", "annotation": ""}, "snippet": " header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L212_C8", "label": "if", "type": "if", "loc": [212, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L210_C4", "vector": [4, 2, 0.7196, 0.0101, 2, 0.71, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if homo_mat is None:\n rospy.logwarn(\"[pose_converter] Unknown pose type.\")\n return None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L213_C12", "label": "logwarn()", "type": "expression", "loc": [213, 213], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L212_C8", "vector": [8, 3, 0.7196, 0.0034, 3, 0.43, 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(\"[pose_converter] Unknown pose type.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L214_C12", "label": "return", "type": "return", "loc": [214, 214], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L212_C8", "vector": [13, 3, 0.723, 0.0034, 3, 0.43, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L215_C8", "label": "tf_stamped = TransformStamped()", "type": "assigned_variable", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L210_C4", "vector": [14, 2, 0.7264, 0.0034, 2, 0.71, 0.4, 561, 3, 0, 0, 0, 717, 10, 1], "semantic": {"name": "tf_stamped", "arg_names": [], "import_names": [], "rhs_call_name": "TransformStamped", "annotation": ""}, "snippet": " tf_stamped = TransformStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L216_C8", "label": "if", "type": "if", "loc": [216, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L210_C4", "vector": [4, 2, 0.7382, 0.0203, 2, 0.71, 0.6, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if header is None:\n tf_stamped.header.stamp = rospy.Time.now()\n else:\n tf_stamped.header.seq = header[0]\n tf_stamped.header.stamp = header[1]\n tf_stamped.header.frame_id = header[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L217_C12", "label": "tf_stamped.header.stamp = now()", "type": "assigned_variable", "loc": [217, 217], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L216_C8", "vector": [14, 3, 0.7331, 0.0034, 3, 0.04, 0.0, 601, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "tf_stamped.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " tf_stamped.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L219_C12", "label": "tf_stamped.header.seq =", "type": "assigned_variable", "loc": [219, 219], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L216_C8", "vector": [14, 3, 0.7399, 0.0034, 3, 0.04, 0.3333, 847, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tf_stamped.header.seq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tf_stamped.header.seq = header[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L220_C12", "label": "tf_stamped.header.stamp =", "type": "assigned_variable", "loc": [220, 220], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L216_C8", "vector": [14, 3, 0.7432, 0.0034, 3, 0.04, 0.6667, 601, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tf_stamped.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tf_stamped.header.stamp = header[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L221_C12", "label": "tf_stamped.header.frame_id =", "type": "assigned_variable", "loc": [221, 221], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L216_C8", "vector": [14, 3, 0.7466, 0.0034, 3, 0.04, 1.0, 579, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tf_stamped.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tf_stamped.header.frame_id = header[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L222_C8", "label": "tf_stamped.transform = Transform()", "type": "assigned_variable", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L210_C4", "vector": [14, 2, 0.75, 0.0034, 2, 0.71, 0.8, 537, 3, 2, 0, 0, 241, 10, 3], "semantic": {"name": "tf_stamped.transform", "arg_names": [], "import_names": [], "rhs_call_name": "Transform", "annotation": ""}, "snippet": " tf_stamped.transform = Transform(Vector3(*homo_mat[:3,3].T.A[0]), Quaternion(*quat_rot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L223_C8", "label": "return", "type": "return", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L210_C4", "vector": [13, 2, 0.7534, 0.0034, 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 tf_stamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L228_C4", "label": "to_twist_msg", "type": "function", "loc": [228, 234], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "vector": [2, 1, 0.7804, 0.0236, 1, 0.92, 0.6667, 6, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "to_twist_msg", "arg_names": ["args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_twist_msg(*args):\n _, homo_mat, _, euler_rot = PoseConverter._make_generic(args)\n if homo_mat is None:\n rospy.logwarn(\"[pose_converter] Unknown pose type.\")\n return None, None, None, None\n else:\n return Twist(Vector3(*homo_mat[:3,3].T.A[0]), Vector3(*euler_rot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L229_C8", "label": "_, homo_mat, _, euler_rot = _make_generic()", "type": "assigned_variable", "loc": [229, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L228_C4", "vector": [14, 2, 0.7736, 0.0034, 2, 0.91, 0.0, 600, 3, 1, 0, 0, 785, 10, 1], "semantic": {"name": "_, homo_mat, _, euler_rot", "arg_names": [], "import_names": [], "rhs_call_name": "_make_generic", "annotation": ""}, "snippet": " _, homo_mat, _, euler_rot = PoseConverter._make_generic(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L230_C8", "label": "if", "type": "if", "loc": [230, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L228_C4", "vector": [4, 2, 0.7838, 0.0169, 2, 0.91, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if homo_mat is None:\n rospy.logwarn(\"[pose_converter] Unknown pose type.\")\n return None, None, None, None\n else:\n return Twist(Vector3(*homo_mat[:3,3].T.A[0]), Vector3(*euler_rot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L231_C12", "label": "logwarn()", "type": "expression", "loc": [231, 231], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L230_C8", "vector": [8, 3, 0.7804, 0.0034, 3, 0.71, 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(\"[pose_converter] Unknown pose type.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L232_C12", "label": "return", "type": "return", "loc": [232, 232], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L230_C8", "vector": [13, 3, 0.7838, 0.0034, 3, 0.71, 0.5, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L234_C12", "label": "return", "type": "return", "loc": [234, 234], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L230_C8", "vector": [13, 3, 0.7905, 0.0034, 3, 0.71, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Twist(Vector3(*homo_mat[:3,3].T.A[0]), Vector3(*euler_rot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L239_C4", "label": "to_twist_stamped_msg", "type": "function", "loc": [239, 252], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "vector": [2, 1, 0.8294, 0.0473, 1, 0.92, 0.7333, 610, 0, 1, 1, 0, 0, 0, 9], "semantic": {"name": "to_twist_stamped_msg", "arg_names": ["args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_twist_stamped_msg(*args):\n header, homo_mat, _, euler_rot = PoseConverter._make_generic(args)\n if homo_mat is None:\n rospy.logwarn(\"[pose_converter] Unknown pose type.\")\n return None, None, None, None\n twist_stamped = TwistStamped()\n header_msg = Header()\n if header is None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L240_C8", "label": "header, homo_mat, _, euler_rot = _make_generic()", "type": "assigned_variable", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L239_C4", "vector": [14, 2, 0.8108, 0.0034, 2, 0.72, 0.0, 949, 3, 1, 0, 0, 785, 10, 1], "semantic": {"name": "header, homo_mat, _, euler_rot", "arg_names": [], "import_names": [], "rhs_call_name": "_make_generic", "annotation": ""}, "snippet": " header, homo_mat, _, euler_rot = PoseConverter._make_generic(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L241_C8", "label": "if", "type": "if", "loc": [241, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L239_C4", "vector": [4, 2, 0.8176, 0.0101, 2, 0.72, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if homo_mat is None:\n rospy.logwarn(\"[pose_converter] Unknown pose type.\")\n return None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L242_C12", "label": "logwarn()", "type": "expression", "loc": [242, 242], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L241_C8", "vector": [8, 3, 0.8176, 0.0034, 3, 0.97, 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(\"[pose_converter] Unknown pose type.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L243_C12", "label": "return", "type": "return", "loc": [243, 243], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L241_C8", "vector": [13, 3, 0.8209, 0.0034, 3, 0.97, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L244_C8", "label": "twist_stamped = TwistStamped()", "type": "assigned_variable", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L239_C4", "vector": [14, 2, 0.8243, 0.0034, 2, 0.72, 0.4, 450, 3, 0, 0, 0, 895, 10, 1], "semantic": {"name": "twist_stamped", "arg_names": [], "import_names": [], "rhs_call_name": "TwistStamped", "annotation": ""}, "snippet": " twist_stamped = TwistStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L245_C8", "label": "header_msg = Header()", "type": "assigned_variable", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L239_C4", "vector": [14, 2, 0.8277, 0.0034, 2, 0.72, 0.6, 732, 3, 0, 0, 0, 976, 10, 1], "semantic": {"name": "header_msg", "arg_names": [], "import_names": [], "rhs_call_name": "Header", "annotation": ""}, "snippet": " header_msg = Header()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L246_C8", "label": "if", "type": "if", "loc": [246, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L239_C4", "vector": [4, 2, 0.8395, 0.0203, 2, 0.72, 0.8, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if header is None:\n header_msg.stamp = rospy.Time.now()\n else:\n header_msg.seq = header[0]\n header_msg.stamp = header[1]\n header_msg.frame_id = header[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L247_C12", "label": "header_msg.stamp = now()", "type": "assigned_variable", "loc": [247, 247], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L246_C8", "vector": [14, 3, 0.8345, 0.0034, 3, 0.91, 0.0, 621, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "header_msg.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " header_msg.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L249_C12", "label": "header_msg.seq =", "type": "assigned_variable", "loc": [249, 249], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L246_C8", "vector": [14, 3, 0.8412, 0.0034, 3, 0.91, 0.3333, 896, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "header_msg.seq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " header_msg.seq = header[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L250_C12", "label": "header_msg.stamp =", "type": "assigned_variable", "loc": [250, 250], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L246_C8", "vector": [14, 3, 0.8446, 0.0034, 3, 0.91, 0.6667, 621, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "header_msg.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " header_msg.stamp = header[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L251_C12", "label": "header_msg.frame_id =", "type": "assigned_variable", "loc": [251, 251], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L246_C8", "vector": [14, 3, 0.848, 0.0034, 3, 0.91, 1.0, 947, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "header_msg.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " header_msg.frame_id = header[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L252_C8", "label": "return", "type": "return", "loc": [252, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L239_C4", "vector": [13, 2, 0.8514, 0.0034, 2, 0.72, 1.0, 0, 3, 0, 0, 0, 0, 10, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return TwistStamped(header_msg, Twist(Vector3(*homo_mat[:3,3].T.A[0]), Vector3(*euler_rot)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L257_C4", "label": "to_homo_mat", "type": "function", "loc": [257, 263], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "vector": [2, 1, 0.8784, 0.0236, 1, 0.92, 0.8, 32, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "to_homo_mat", "arg_names": ["args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_homo_mat(*args):\n header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args)\n if homo_mat is None:\n rospy.logwarn(\"[pose_converter] Unknown pose type.\")\n return None, None, None, None\n else:\n return homo_mat.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L258_C8", "label": "header, homo_mat, quat_rot, _ = _make_generic()", "type": "assigned_variable", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L257_C4", "vector": [14, 2, 0.8716, 0.0034, 2, 0.54, 0.0, 825, 3, 1, 0, 0, 785, 10, 1], "semantic": {"name": "header, homo_mat, quat_rot, _", "arg_names": [], "import_names": [], "rhs_call_name": "_make_generic", "annotation": ""}, "snippet": " header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L259_C8", "label": "if", "type": "if", "loc": [259, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L257_C4", "vector": [4, 2, 0.8818, 0.0169, 2, 0.54, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if homo_mat is None:\n rospy.logwarn(\"[pose_converter] Unknown pose type.\")\n return None, None, None, None\n else:\n return homo_mat.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L260_C12", "label": "logwarn()", "type": "expression", "loc": [260, 260], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L259_C8", "vector": [8, 3, 0.8784, 0.0034, 3, 0.14, 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(\"[pose_converter] Unknown pose type.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L261_C12", "label": "return", "type": "return", "loc": [261, 261], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L259_C8", "vector": [13, 3, 0.8818, 0.0034, 3, 0.14, 0.5, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L263_C12", "label": "return", "type": "return", "loc": [263, 263], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L259_C8", "vector": [13, 3, 0.8885, 0.0034, 3, 0.14, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return homo_mat.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L268_C4", "label": "to_pos_rot", "type": "function", "loc": [268, 274], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "vector": [2, 1, 0.9155, 0.0236, 1, 0.92, 0.8667, 204, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "to_pos_rot", "arg_names": ["args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_pos_rot(*args):\n header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args)\n if homo_mat is None:\n rospy.logwarn(\"[pose_converter] Unknown pose type.\")\n return None, None, None, None\n else:\n return homo_mat[:3,3].copy(), homo_mat[:3,:3].copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L269_C8", "label": "header, homo_mat, quat_rot, _ = _make_generic()", "type": "assigned_variable", "loc": [269, 269], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L268_C4", "vector": [14, 2, 0.9088, 0.0034, 2, 0.03, 0.0, 825, 3, 1, 0, 0, 785, 10, 1], "semantic": {"name": "header, homo_mat, quat_rot, _", "arg_names": [], "import_names": [], "rhs_call_name": "_make_generic", "annotation": ""}, "snippet": " header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L270_C8", "label": "if", "type": "if", "loc": [270, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L268_C4", "vector": [4, 2, 0.9189, 0.0169, 2, 0.03, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if homo_mat is None:\n rospy.logwarn(\"[pose_converter] Unknown pose type.\")\n return None, None, None, None\n else:\n return homo_mat[:3,3].copy(), homo_mat[:3,:3].copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L271_C12", "label": "logwarn()", "type": "expression", "loc": [271, 271], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L270_C8", "vector": [8, 3, 0.9155, 0.0034, 3, 0.97, 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(\"[pose_converter] Unknown pose type.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L272_C12", "label": "return", "type": "return", "loc": [272, 272], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L270_C8", "vector": [13, 3, 0.9189, 0.0034, 3, 0.97, 0.5, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L274_C12", "label": "return", "type": "return", "loc": [274, 274], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L270_C8", "vector": [13, 3, 0.9257, 0.0034, 3, 0.97, 1.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return homo_mat[:3,3].copy(), homo_mat[:3,:3].copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L279_C4", "label": "to_pos_quat", "type": "function", "loc": [279, 285], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "vector": [2, 1, 0.9527, 0.0236, 1, 0.92, 0.9333, 926, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "to_pos_quat", "arg_names": ["args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_pos_quat(*args):\n header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args)\n if homo_mat is None:\n rospy.logwarn(\"[pose_converter] Unknown pose type.\")\n return None, None, None, None\n else:\n return copy.copy(list(homo_mat[:3,3].T.A[0])), copy.copy(quat_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L280_C8", "label": "header, homo_mat, quat_rot, _ = _make_generic()", "type": "assigned_variable", "loc": [280, 280], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L279_C4", "vector": [14, 2, 0.9459, 0.0034, 2, 0.22, 0.0, 825, 3, 1, 0, 0, 785, 10, 1], "semantic": {"name": "header, homo_mat, quat_rot, _", "arg_names": [], "import_names": [], "rhs_call_name": "_make_generic", "annotation": ""}, "snippet": " header, homo_mat, quat_rot, _ = PoseConverter._make_generic(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L281_C8", "label": "if", "type": "if", "loc": [281, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L279_C4", "vector": [4, 2, 0.9561, 0.0169, 2, 0.22, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if homo_mat is None:\n rospy.logwarn(\"[pose_converter] Unknown pose type.\")\n return None, None, None, None\n else:\n return copy.copy(list(homo_mat[:3,3].T.A[0])), copy.copy(quat_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L282_C12", "label": "logwarn()", "type": "expression", "loc": [282, 282], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L281_C8", "vector": [8, 3, 0.9527, 0.0034, 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(\"[pose_converter] Unknown pose type.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L283_C12", "label": "return", "type": "return", "loc": [283, 283], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L281_C8", "vector": [13, 3, 0.9561, 0.0034, 3, 0.96, 0.5, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L285_C12", "label": "return", "type": "return", "loc": [285, 285], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L281_C8", "vector": [13, 3, 0.9628, 0.0034, 3, 0.96, 1.0, 0, 0, 0, 0, 0, 0, 8, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return copy.copy(list(homo_mat[:3,3].T.A[0])), copy.copy(quat_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L290_C4", "label": "to_pos_euler", "type": "function", "loc": [290, 296], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "vector": [2, 1, 0.9899, 0.0236, 1, 0.92, 1.0, 182, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "to_pos_euler", "arg_names": ["args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_pos_euler(*args):\n header, homo_mat, quat_rot, euler_rot = PoseConverter._make_generic(args)\n if homo_mat is None:\n rospy.logwarn(\"[pose_converter] Unknown pose type.\")\n return None, None, None, None\n else:\n return copy.copy(list(homo_mat[:3,3].T.A[0])), copy.copy(euler_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L291_C8", "label": "header, homo_mat, quat_rot, euler_rot = _make_generic()", "type": "assigned_variable", "loc": [291, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L290_C4", "vector": [14, 2, 0.9831, 0.0034, 2, 0.7, 0.0, 525, 3, 1, 0, 0, 785, 10, 1], "semantic": {"name": "header, homo_mat, quat_rot, euler_rot", "arg_names": [], "import_names": [], "rhs_call_name": "_make_generic", "annotation": ""}, "snippet": " header, homo_mat, quat_rot, euler_rot = PoseConverter._make_generic(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L292_C8", "label": "if", "type": "if", "loc": [292, 296], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L290_C4", "vector": [4, 2, 0.9932, 0.0169, 2, 0.7, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if homo_mat is None:\n rospy.logwarn(\"[pose_converter] Unknown pose type.\")\n return None, None, None, None\n else:\n return copy.copy(list(homo_mat[:3,3].T.A[0])), copy.copy(euler_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L293_C12", "label": "logwarn()", "type": "expression", "loc": [293, 293], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L292_C8", "vector": [8, 3, 0.9899, 0.0034, 3, 0.37, 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(\"[pose_converter] Unknown pose type.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L294_C12", "label": "return", "type": "return", "loc": [294, 294], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L292_C8", "vector": [13, 3, 0.9932, 0.0034, 3, 0.37, 0.5, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, None, None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L296_C12", "label": "return", "type": "return", "loc": [296, 296], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L292_C8", "vector": [13, 3, 1.0, 0.0034, 3, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 8, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return copy.copy(list(homo_mat[:3,3].T.A[0])), copy.copy(euler_rot)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L15_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L16_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L15_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L17_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L15_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L18_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L18_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L19_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L15_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L20_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L15_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L21_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L23_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L24_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L24_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L25_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L24_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L26_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L24_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L28_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L28_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L29_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L28_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L30_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L28_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L31_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L28_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L32_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L28_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L33_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L28_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L35_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L35_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L36_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L35_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L37_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L35_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L39_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L39_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L40_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L39_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L41_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L39_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L42_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L39_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L43_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L39_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L44_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L39_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L46_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L47_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L46_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L48_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L46_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L50_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L51_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L50_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L52_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L50_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L53_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L50_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L54_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L50_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L55_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L50_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L57_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L58_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L57_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L61_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L62_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L61_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L63_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L61_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L64_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L64_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L66_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L64_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L67_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L67_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L68_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L67_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L70_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L61_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L72_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L72_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L74_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L72_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L75_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L72_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L76_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L72_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L77_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L72_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L79_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L79_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L81_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L79_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L83_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L79_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L84_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L84_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L86_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L84_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L87_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L84_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L88_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L84_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L89_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L89_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L91_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L89_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L92_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L89_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L93_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L89_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L95_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L61_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L97_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L61_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L98_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L23_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L103_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L104_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L110_C30"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L110_C52"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L111_C33"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L112_C33"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L121_C35"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L121_C62"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L122_C32"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L123_C32"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L144_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L145_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L144_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L146_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L144_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L148_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L157_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L159_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L160_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L159_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L162_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L159_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L163_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L159_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L164_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L171_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L171_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L173_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L174_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L173_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L175_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L171_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L183_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L184_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L183_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L185_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L187_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L188_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L187_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L190_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L187_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L191_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L187_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L192_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L201_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L202_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L201_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L203_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L201_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L205_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L212_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L213_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L212_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L214_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L216_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L217_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L216_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L219_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L216_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L220_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L216_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L221_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L228_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L228_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L229_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L228_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L230_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L231_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L230_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L232_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L230_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L234_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L239_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L239_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L239_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L241_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L242_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L241_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L243_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L239_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L239_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L239_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L246_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L247_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L246_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L249_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L246_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L250_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L246_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L251_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L239_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L257_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L259_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L259_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L260_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L259_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L261_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L259_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L263_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L268_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L268_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L268_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L270_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L270_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L271_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L270_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L272_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L270_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L274_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L279_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L279_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L280_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L279_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L281_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L281_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L282_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L281_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L283_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L281_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L285_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L290_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L290_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Assign_L291_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:FunctionDef_L290_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L292_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L292_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Expr_L293_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L292_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L294_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99315:If_L292_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99315:Return_L296_C12"}]
# # Any robot that wants to use EPC should implement the functions # sketched out in the HRLArm and HRLArmKinematics # # Standards: # pos is a 3x1 numpy matrix representing a position # rot is a 3x3 numpy matrix represetning a rotation # All values are computed in the arm's reference frame (frame 0) # import numpy as np, math import copy from threading import RLock ## # Abstract class which represents a basic structure for controlling # an arm. An equilibrium point (ep) represents a commanded goal for the # arm which is passed to the underlying controller. A basic assumption of # equilibrium point control is that the underlying controller doesn't necessarily # reach the arm commanded goal due to contact, gravity, low gains in the controller, etc. # Thus we employ another layer of control which relocates the equilibrium point # based on the task at hand. class HRLArm(object): def __init__(self, kinematics): # object of class derived from HRLArmKinematics self.kinematics = kinematics self.ep = None # equilibrium point self.q = None # angles self.qdot = None # angular velocity self.lock = RLock() #----------------- abstract functions --------------------- ## # Commands the arm to move to desired equilbrium point def set_ep(self, *args): raise RuntimeError('Unimplemented Function') # publish different viz markers. def publish_rviz_markers(self): raise RuntimeError('Unimplemented Function') ## # Resets the equilibrium point based on some estimate def reset_ep(self): raise RuntimeError('Unimplemented Function') #---------------------------------------------------------- ## # Records the current joint angles. This must be updated regularly # by the child class. # @param q array-like of joint angles def set_joint_angles(self, q): with self.lock: self.q = copy.copy(q) ## # Returns the current joint angles of the arm # @return array-like of joint angles def get_joint_angles(self): with self.lock: return copy.copy(self.q) ## # Returns the current equilibrium point # @return equilibrium point def get_ep(self): with self.lock: return copy.copy(self.ep) ## # Returns the current pose of the tooltip # @return (pos, rot) def get_end_effector_pose(self): q = self.get_joint_angles() if q is None: return None else: return self.kinematics.FK(q) ## # Abstract class containing kinematics interfaces for an arm class HRLArmKinematics(object): ## # @param n_jts Number of joints of the arm # @param tool_pos Postion offset of the tool from the last link in the kinematic chain # @param tool_rot Rotation offset of the tool from the last link in the kinematic chain def __init__(self, n_jts, arm_base_pos=np.matrix([0.]*3).T, arm_base_rot=np.matrix(np.eye(3)), tool_pos=np.matrix([0.]*3).T, tool_rot=np.matrix(np.eye(3))): self.n_jts = n_jts self.set_arm_base(arm_base_pos, arm_base_rot) self.set_tooltip(tool_pos, tool_rot) #----------------- abstract functions --------------------- ## # Returns FK for the last link in the kinematic chain. # Must be implemented by child class. # @param q Joint angles in radians # @param link_number Link in the kinematic chain to return FK for # 0 represents the ground frame, 1 returns the first link's frame, ... # n_jts + 1 returns the tooltip's frame # @return pos (3x1) np matrix, rot (3x3) np matrix def FK_vanilla(self, q, link_number=None): raise RuntimeError('Unimplemented Function') ## # Computes IK for the last link in the kinematic chain. # Must be implemented by child class. # @param pos Desired link position (3x1 np matrix) # @param rot Desired link rotation (3x3 np matrix) # @param q_guess Estimate of the desired joint angles which seeds the IK solver def IK_vanilla(self, pos, rot, q_guess=None): raise RuntimeError('Unimplemented Function') ## # Computes Jacobian in the arm's frame given joint angles at the specified position. # Must be implemented by child class. # @param q Joint angles for Jacobian # @param pos Position at which the Jacobian is centered. If None, the tooltip # location from FK is used. # @return Jacobian 6xN np matrix def jacobian_vanilla(self, q, pos=None): raise RuntimeError('Unimplemented Function') #---------------------------------------------------------- ## # Returns FK for the last link in the kinematic chain. # Must be implemented by child class # @param q Joint angles in radians # @param link_number Link in the kinematic chain to return FK for # 0 represents the ground frame, 1 returns the first link's frame, ... # n_jts + 1 (and None) returns the tooltip's frame # @return pos (3x1) np matrix, rot (3x3) np matrix def FK(self, q, link_number=None): if link_number == None or link_number > self.n_jts: use_end_affector = True link_number = None else: use_end_affector = False pos, rot = self.FK_vanilla(q, link_number) # offset arm base to FK end pos = self.arm_base_pos + self.arm_base_rot * pos rot = self.arm_base_rot * rot if use_end_affector: # offset end location to tooltip tooltip_baseframe = rot * self.tooltip_pos pos += tooltip_baseframe rot = rot * self.tooltip_rot return pos, rot ## # Computes IK for the tooltip. The desired location is first transformed # back into the last link's frame and IK is performed on that location. # @param pos Desired link position (3x1 np matrix) # @param rot Desired link rotation (3x3 np matrix) # @param q_guess Estimate of the desired joint angles which seeds the IK solver def IK(self, pos, rot, q_guess=None): base_pos = self.arm_base_rot.T * pos - self.arm_base_rot.T * self.arm_base_pos base_rot = self.arm_base_rot.T * rot last_link_pos = base_pos - base_rot * self.tooltip_rot.T * self.tooltip_pos last_link_rot = base_rot * self.tooltip_rot.T return self.IK_vanilla(last_link_pos, last_link_rot, q_guess) ## # Computes Jacobian in the arm's frame given joint angles at the specified position. # @param q Joint angles for Jacobian # @param pos Position at which the Jacobian is centered. If None, the tooltip # location from FK is used. # @return Jacobian 6xN np matrix def jacobian(self, q, pos=None): if pos is None: pos = self.FK(q) return self.jacobian_vanilla(q, pos) ## # Sets the offset of the first link in the kinematic chain # @param arm_base_pos Postion offset of the first link in the kinematic chain # @param arm_base_rot Rotation offset of the first link in the kinematic chain def set_arm_base(self, arm_base_pos, arm_base_rot=np.matrix(np.eye(3))): self.arm_base_pos = arm_base_pos self.arm_base_rot = arm_base_rot ## # Sets the offset of the tool from the last link in the kinematic chain # @param tool_pos Postion offset of the tool from the last link in the kinematic chain # @param tool_rot Rotation offset of the tool from the last link in the kinematic chain def set_tooltip(self, tool_pos, tool_rot=np.matrix(np.eye(3))): self.tooltip_pos = tool_pos self.tooltip_rot = tool_rot
ajibawa-2023/Python-Code-Large/train/row_99316
60
193
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Import_L11_C0", "label": "numpy import np, math", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.057, 0.0052, 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_99316:Import_L12_C0", "label": "copy import copy", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0622, 0.0052, 0, 0.66, 0.25, 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_99316:ImportFrom_L13_C0", "label": "from threading import RLock", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0674, 0.0052, 0, 0.66, 0.5, 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_99316:ClassDef_L23_C0", "label": "HRLArm", "type": "class", "loc": [23, 78], "level": 0, "parent": null, "vector": [3, 0, 0.2617, 0.2902, 0, 0.66, 0.75, 794, 0, 8, 0, 0, 186, 0, 9], "semantic": {"name": "HRLArm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class HRLArm(object):\n def __init__(self, kinematics):\n # object of class derived from HRLArmKinematics\n self.kinematics = kinematics\n self.ep = None # equilibrium point\n self.q = None # angles\n self.qdot = None # angular velocity\n self.lock = RLock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L24_C4", "label": "__init__", "type": "function", "loc": [24, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L23_C0", "vector": [2, 1, 0.1399, 0.0363, 1, 0.66, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "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\n self.q = None # angles\n self.qdot = None # angular velocity\n self.lock = RLock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L26_C8", "label": "self.kinematics =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L24_C4", "vector": [14, 2, 0.1347, 0.0052, 2, 0.71, 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_99316:Assign_L27_C8", "label": "self.ep =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L24_C4", "vector": [14, 2, 0.1399, 0.0052, 2, 0.71, 0.25, 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_99316:Assign_L28_C8", "label": "self.q =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L24_C4", "vector": [14, 2, 0.1451, 0.0052, 2, 0.71, 0.5, 561, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q = None # angles"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L29_C8", "label": "self.qdot =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L24_C4", "vector": [14, 2, 0.1503, 0.0052, 2, 0.71, 0.75, 383, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.qdot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.qdot = None # angular velocity"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L30_C8", "label": "self.lock = RLock()", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L24_C4", "vector": [14, 2, 0.1554, 0.0052, 2, 0.71, 1.0, 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_99316:FunctionDef_L35_C4", "label": "set_ep", "type": "function", "loc": [35, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L23_C0", "vector": [2, 1, 0.1839, 0.0104, 1, 0.66, 0.1429, 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_99316:FunctionDef_L39_C4", "label": "publish_rviz_markers", "type": "function", "loc": [39, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L23_C0", "vector": [2, 1, 0.2047, 0.0104, 1, 0.66, 0.2857, 62, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish_rviz_markers", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def publish_rviz_markers(self):\n raise RuntimeError('Unimplemented Function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L44_C4", "label": "reset_ep", "type": "function", "loc": [44, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L23_C0", "vector": [2, 1, 0.2306, 0.0104, 1, 0.66, 0.4286, 456, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "reset_ep", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def reset_ep(self):\n raise RuntimeError('Unimplemented Function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L52_C4", "label": "set_joint_angles", "type": "function", "loc": [52, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L23_C0", "vector": [2, 1, 0.2746, 0.0155, 1, 0.66, 0.5714, 718, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_joint_angles", "arg_names": ["self", "q"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_joint_angles(self, q):\n with self.lock:\n self.q = copy.copy(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L54_C12", "label": "self.q = copy()", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L52_C4", "vector": [14, 2, 0.2798, 0.0052, 2, 0.16, 0.0, 561, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.q", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.q = copy.copy(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L59_C4", "label": "get_joint_angles", "type": "function", "loc": [59, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L23_C0", "vector": [2, 1, 0.3109, 0.0155, 1, 0.66, 0.7143, 820, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_joint_angles", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_joint_angles(self):\n with self.lock:\n return copy.copy(self.q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Return_L61_C12", "label": "return", "type": "return", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L59_C4", "vector": [13, 2, 0.3161, 0.0052, 2, 0.75, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return copy.copy(self.q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L66_C4", "label": "get_ep", "type": "function", "loc": [66, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L23_C0", "vector": [2, 1, 0.3472, 0.0155, 1, 0.66, 0.8571, 563, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_ep", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_ep(self):\n with self.lock:\n return copy.copy(self.ep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Return_L68_C12", "label": "return", "type": "return", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L66_C4", "vector": [13, 2, 0.3523, 0.0052, 2, 0.01, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return copy.copy(self.ep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L73_C4", "label": "get_end_effector_pose", "type": "function", "loc": [73, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L23_C0", "vector": [2, 1, 0.3912, 0.0311, 1, 0.66, 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 q = self.get_joint_angles()\n if q is None:\n return None\n else:\n return self.kinematics.FK(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L74_C8", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L73_C4", "vector": [14, 2, 0.3834, 0.0052, 2, 0.23, 0.0, 516, 3, 0, 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()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:If_L75_C8", "label": "if", "type": "if", "loc": [75, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L73_C4", "vector": [4, 2, 0.3964, 0.0207, 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 q is None:\n return None\n else:\n return self.kinematics.FK(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Return_L76_C12", "label": "return", "type": "return", "loc": [76, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:If_L75_C8", "vector": [13, 3, 0.3938, 0.0052, 3, 0.65, 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_99316:Return_L78_C12", "label": "return", "type": "return", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:If_L75_C8", "vector": [13, 3, 0.4041, 0.0052, 3, 0.65, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.kinematics.FK(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L83_C0", "label": "HRLArmKinematics", "type": "class", "loc": [83, 192], "level": 0, "parent": null, "vector": [3, 0, 0.7124, 0.5699, 0, 0.66, 1.0, 235, 0, 9, 0, 0, 186, 0, 19], "semantic": {"name": "HRLArmKinematics", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class HRLArmKinematics(object):\n ##\n # @param n_jts Number of joints of the arm\n # @param tool_pos Postion offset of the tool from the last link in the kinematic chain\n # @param tool_rot Rotation offset of the tool from the last link in the kinematic chain\n def __init__(self, n_jts, arm_base_pos=np.matrix([0.]*3).T, arm_base_rot=np.matrix(np.eye(3)), \n tool_pos=np.matrix([0.]*3).T, tool_rot=np.matrix(np.eye(3))):\n self.n_jts = n_jts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L88_C4", "label": "__init__", "type": "function", "loc": [88, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L83_C0", "vector": [2, 1, 0.4663, 0.0259, 1, 0.37, 0.0, 555, 0, 6, 0, 0, 0, 0, 8], "semantic": {"name": "__init__", "arg_names": ["self", "n_jts", "arm_base_pos", "arm_base_rot", "tool_pos", "tool_rot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, n_jts, arm_base_pos=np.matrix([0.]*3).T, arm_base_rot=np.matrix(np.eye(3)), \n tool_pos=np.matrix([0.]*3).T, tool_rot=np.matrix(np.eye(3))):\n self.n_jts = n_jts\n self.set_arm_base(arm_base_pos, arm_base_rot)\n self.set_tooltip(tool_pos, tool_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L90_C8", "label": "self.n_jts =", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L88_C4", "vector": [14, 2, 0.4663, 0.0052, 2, 0.61, 0.0, 778, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.n_jts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.n_jts = n_jts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Expr_L91_C8", "label": "set_arm_base()", "type": "expression", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L88_C4", "vector": [8, 2, 0.4715, 0.0052, 2, 0.61, 0.5, 257, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_arm_base", "arg_names": [], "import_names": [], "rhs_call_name": "set_arm_base", "annotation": ""}, "snippet": " self.set_arm_base(arm_base_pos, arm_base_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Expr_L92_C8", "label": "set_tooltip()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L88_C4", "vector": [8, 2, 0.4767, 0.0052, 2, 0.61, 1.0, 350, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_tooltip", "arg_names": [], "import_names": [], "rhs_call_name": "set_tooltip", "annotation": ""}, "snippet": " self.set_tooltip(tool_pos, tool_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L103_C4", "label": "FK_vanilla", "type": "function", "loc": [103, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L83_C0", "vector": [2, 1, 0.5363, 0.0104, 1, 0.37, 0.125, 646, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "FK_vanilla", "arg_names": ["self", "q", "link_number"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def FK_vanilla(self, q, link_number=None):\n raise RuntimeError('Unimplemented Function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L112_C4", "label": "IK_vanilla", "type": "function", "loc": [112, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L83_C0", "vector": [2, 1, 0.5829, 0.0104, 1, 0.37, 0.25, 969, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "IK_vanilla", "arg_names": ["self", "pos", "rot", "q_guess"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def IK_vanilla(self, pos, rot, q_guess=None):\n raise RuntimeError('Unimplemented Function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L122_C4", "label": "jacobian_vanilla", "type": "function", "loc": [122, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L83_C0", "vector": [2, 1, 0.6347, 0.0104, 1, 0.37, 0.375, 210, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "jacobian_vanilla", "arg_names": ["self", "q", "pos"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def jacobian_vanilla(self, q, pos=None):\n raise RuntimeError('Unimplemented Function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L134_C4", "label": "FK", "type": "function", "loc": [134, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L83_C0", "vector": [2, 1, 0.7409, 0.0984, 1, 0.37, 0.5, 252, 0, 3, 1, 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 if link_number == None or link_number > self.n_jts:\n use_end_affector = True\n link_number = None\n else:\n use_end_affector = False\n \n pos, rot = self.FK_vanilla(q, link_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:If_L135_C8", "label": "if", "type": "if", "loc": [135, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L134_C4", "vector": [4, 2, 0.7098, 0.0259, 2, 0.14, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if link_number == None or link_number > self.n_jts:\n use_end_affector = True\n link_number = None\n else:\n use_end_affector = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L136_C12", "label": "use_end_affector =", "type": "assigned_variable", "loc": [136, 136], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:If_L135_C8", "vector": [14, 3, 0.7047, 0.0052, 3, 0.37, 0.0, 84, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "use_end_affector", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " use_end_affector = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L137_C12", "label": "link_number =", "type": "assigned_variable", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:If_L135_C8", "vector": [14, 3, 0.7098, 0.0052, 3, 0.37, 0.5, 766, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "link_number", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " link_number = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L139_C12", "label": "use_end_affector =", "type": "assigned_variable", "loc": [139, 139], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:If_L135_C8", "vector": [14, 3, 0.7202, 0.0052, 3, 0.37, 1.0, 84, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "use_end_affector", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " use_end_affector = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L141_C8", "label": "pos, rot = FK_vanilla()", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L134_C4", "vector": [14, 2, 0.7306, 0.0052, 2, 0.14, 0.2, 298, 3, 2, 0, 0, 646, 10, 1], "semantic": {"name": "pos, rot", "arg_names": [], "import_names": [], "rhs_call_name": "FK_vanilla", "annotation": ""}, "snippet": " pos, rot = self.FK_vanilla(q, link_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L144_C8", "label": "pos =", "type": "assigned_variable", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L134_C4", "vector": [14, 2, 0.7461, 0.0052, 2, 0.14, 0.4, 627, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = self.arm_base_pos + self.arm_base_rot * pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L145_C8", "label": "rot =", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L134_C4", "vector": [14, 2, 0.7513, 0.0052, 2, 0.14, 0.6, 812, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot = self.arm_base_rot * rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:If_L147_C8", "label": "if", "type": "if", "loc": [147, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L134_C4", "vector": [4, 2, 0.772, 0.0259, 2, 0.14, 0.8, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if use_end_affector:\n # offset end location to tooltip\n tooltip_baseframe = rot * self.tooltip_pos\n pos += tooltip_baseframe\n rot = rot * self.tooltip_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L149_C12", "label": "tooltip_baseframe =", "type": "assigned_variable", "loc": [149, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:If_L147_C8", "vector": [14, 3, 0.772, 0.0052, 3, 0.51, 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.tooltip_pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L151_C12", "label": "rot =", "type": "assigned_variable", "loc": [151, 151], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:If_L147_C8", "vector": [14, 3, 0.7824, 0.0052, 3, 0.51, 1.0, 812, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot = rot * self.tooltip_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Return_L152_C8", "label": "return", "type": "return", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L134_C4", "vector": [13, 2, 0.7876, 0.0052, 2, 0.14, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pos, rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L160_C4", "label": "IK", "type": "function", "loc": [160, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L83_C0", "vector": [2, 1, 0.842, 0.0311, 1, 0.37, 0.625, 719, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "IK", "arg_names": ["self", "pos", "rot", "q_guess"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def IK(self, pos, rot, q_guess=None):\n base_pos = self.arm_base_rot.T * pos - self.arm_base_rot.T * self.arm_base_pos\n base_rot = self.arm_base_rot.T * rot\n last_link_pos = base_pos - base_rot * self.tooltip_rot.T * self.tooltip_pos\n last_link_rot = base_rot * self.tooltip_rot.T\n return self.IK_vanilla(last_link_pos, last_link_rot, q_guess)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L161_C8", "label": "base_pos =", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L160_C4", "vector": [14, 2, 0.8342, 0.0052, 2, 0.47, 0.0, 214, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "base_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " base_pos = self.arm_base_rot.T * pos - self.arm_base_rot.T * self.arm_base_pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L162_C8", "label": "base_rot =", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L160_C4", "vector": [14, 2, 0.8394, 0.0052, 2, 0.47, 0.25, 346, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "base_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " base_rot = self.arm_base_rot.T * rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L163_C8", "label": "last_link_pos =", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L160_C4", "vector": [14, 2, 0.8446, 0.0052, 2, 0.47, 0.5, 721, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "last_link_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " last_link_pos = base_pos - base_rot * self.tooltip_rot.T * self.tooltip_pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L164_C8", "label": "last_link_rot =", "type": "assigned_variable", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L160_C4", "vector": [14, 2, 0.8497, 0.0052, 2, 0.47, 0.75, 797, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "last_link_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " last_link_rot = base_rot * self.tooltip_rot.T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Return_L165_C8", "label": "return", "type": "return", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L160_C4", "vector": [13, 2, 0.8549, 0.0052, 2, 0.47, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.IK_vanilla(last_link_pos, last_link_rot, q_guess)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L173_C4", "label": "jacobian", "type": "function", "loc": [173, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L83_C0", "vector": [2, 1, 0.9041, 0.0207, 1, 0.37, 0.75, 8, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "jacobian", "arg_names": ["self", "q", "pos"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def jacobian(self, q, pos=None):\n if pos is None:\n pos = self.FK(q)\n return self.jacobian_vanilla(q, pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:If_L174_C8", "label": "if", "type": "if", "loc": [174, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L173_C4", "vector": [4, 2, 0.9041, 0.0104, 2, 0.99, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pos is None:\n pos = self.FK(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L175_C12", "label": "pos = FK()", "type": "assigned_variable", "loc": [175, 175], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:If_L174_C8", "vector": [14, 3, 0.9067, 0.0052, 3, 0.1, 0.0, 627, 3, 1, 0, 0, 252, 10, 1], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " pos = self.FK(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Return_L176_C8", "label": "return", "type": "return", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L173_C4", "vector": [13, 2, 0.9119, 0.0052, 2, 0.99, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.jacobian_vanilla(q, pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L182_C4", "label": "set_arm_base", "type": "function", "loc": [182, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L83_C0", "vector": [2, 1, 0.9482, 0.0155, 1, 0.37, 0.875, 257, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "set_arm_base", "arg_names": ["self", "arm_base_pos", "arm_base_rot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_arm_base(self, arm_base_pos, arm_base_rot=np.matrix(np.eye(3))):\n self.arm_base_pos = arm_base_pos\n self.arm_base_rot = arm_base_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L183_C8", "label": "self.arm_base_pos =", "type": "assigned_variable", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L182_C4", "vector": [14, 2, 0.9482, 0.0052, 2, 0.54, 0.0, 581, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arm_base_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_base_pos = arm_base_pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L184_C8", "label": "self.arm_base_rot =", "type": "assigned_variable", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L182_C4", "vector": [14, 2, 0.9534, 0.0052, 2, 0.54, 1.0, 918, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arm_base_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_base_rot = arm_base_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L190_C4", "label": "set_tooltip", "type": "function", "loc": [190, 192], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L83_C0", "vector": [2, 1, 0.9896, 0.0155, 1, 0.37, 1.0, 350, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "set_tooltip", "arg_names": ["self", "tool_pos", "tool_rot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_tooltip(self, tool_pos, tool_rot=np.matrix(np.eye(3))):\n self.tooltip_pos = tool_pos\n self.tooltip_rot = tool_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L191_C8", "label": "self.tooltip_pos =", "type": "assigned_variable", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L190_C4", "vector": [14, 2, 0.9896, 0.0052, 2, 0.38, 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 = tool_pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L192_C8", "label": "self.tooltip_rot =", "type": "assigned_variable", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L190_C4", "vector": [14, 2, 0.9948, 0.0052, 2, 0.38, 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 = tool_rot"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Return_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Return_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:If_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:If_L75_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Return_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:If_L75_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Return_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Expr_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:If_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:If_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L136_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:If_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:If_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L139_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:If_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:If_L147_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L149_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:If_L147_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L151_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Return_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L160_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L160_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L160_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L160_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L160_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Return_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:If_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:If_L174_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L175_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Return_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:ClassDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L190_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L190_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99316:FunctionDef_L190_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99316:Assign_L192_C8"}]
import numpy as np, math import roslib; roslib.load_manifest('hrl_generic_arms') import rospy from std_msgs.msg import Float64, Float64MultiArray ## # Classic PID controller with maximum integral thresholding to # prevent windup. class PIDController(object): def __init__(self, rate=100., k_p=0., k_i=0., k_d=0., i_max=None, feed_forward=0., init_integ=0., saturation=None, name=None): self.y = 0. self.k_p = k_p self.k_i = k_i self.k_d = k_d self.i_max = i_max self.feed_forward = feed_forward self.rate = rate self.saturation = saturation self.err_last = None self.integral = init_integ self.name = name if self.name is not None: self.err_pub = rospy.Publisher("/pid_controller/" + name + "_error", Float64) self.out_pub = rospy.Publisher("/pid_controller/" + name + "_output", Float64) self.diag_pub = rospy.Publisher("/pid_controller/" + name + "_diag", Float64MultiArray) ## # Updates the controller state and returns the current output. def update_state(self, err): last_integral = self.integral self.integral += err / self.rate if self.i_max is not None: self.integral = np.clip(self.integral, -self.i_max, self.i_max) if self.err_last is None: self.err_last = err propr = self.k_p * err integ = self.k_i * self.integral deriv = self.k_d * (err - self.err_last) * self.rate feedf = self.feed_forward raw_y = propr + integ + deriv + feedf self.err_last = err if self.saturation is not None: self.y = np.clip(raw_y, -self.saturation, self.saturation) if self.y in [-self.saturation, self.saturation]: self.integral = last_integral if self.name is not None: self.err_pub.publish(err) self.out_pub.publish(self.y) diag_msg = Float64MultiArray() diag_msg.data = [self.y, propr, integ, deriv, feedf, raw_y, self.saturation] self.diag_pub.publish(diag_msg) return self.y def reset_controller(self): self.err_last = None self.integral = 0
ajibawa-2023/Python-Code-Large/train/row_99318
48
58
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Import_L1_C0", "label": "numpy import np, math", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0172, 0.0172, 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_99318:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0517, 0.0172, 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('hrl_generic_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Expr_L3_C15", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0517, 0.0172, 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('hrl_generic_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.069, 0.0172, 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_99318:ImportFrom_L5_C0", "label": "from std_msgs.msg import Float64, Float64MultiArray", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0862, 0.0172, 0, 0.66, 0.8, 366, 0, 2, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Float64", "Float64MultiArray"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Float64, Float64MultiArray"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:ClassDef_L10_C0", "label": "PIDController", "type": "class", "loc": [10, 58], "level": 0, "parent": null, "vector": [3, 0, 0.5862, 0.8448, 0, 0.66, 1.0, 15, 0, 3, 0, 0, 186, 0, 9], "semantic": {"name": "PIDController", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PIDController(object):\n def __init__(self, rate=100., k_p=0., k_i=0., k_d=0., i_max=None, feed_forward=0.,\n init_integ=0., saturation=None, name=None):\n self.y = 0.\n self.k_p = k_p\n self.k_i = k_i\n self.k_d = k_d\n self.i_max = i_max"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "label": "__init__", "type": "function", "loc": [11, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:ClassDef_L10_C0", "vector": [2, 1, 0.3276, 0.2931, 1, 0.34, 0.0, 555, 0, 10, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "rate", "k_p", "k_i", "k_d", "i_max", "feed_forward", "init_integ", "saturation", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, rate=100., k_p=0., k_i=0., k_d=0., i_max=None, feed_forward=0.,\n init_integ=0., saturation=None, name=None):\n self.y = 0.\n self.k_p = k_p\n self.k_i = k_i\n self.k_d = k_d\n self.i_max = i_max\n self.feed_forward = feed_forward"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L13_C8", "label": "self.y =", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "vector": [14, 2, 0.2241, 0.0172, 2, 0.68, 0.0, 276, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.y = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L14_C8", "label": "self.k_p =", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "vector": [14, 2, 0.2414, 0.0172, 2, 0.68, 0.0909, 50, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.k_p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.k_p = k_p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L15_C8", "label": "self.k_i =", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "vector": [14, 2, 0.2586, 0.0172, 2, 0.68, 0.1818, 78, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.k_i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.k_i = k_i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L16_C8", "label": "self.k_d =", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "vector": [14, 2, 0.2759, 0.0172, 2, 0.68, 0.2727, 222, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.k_d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.k_d = k_d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L17_C8", "label": "self.i_max =", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "vector": [14, 2, 0.2931, 0.0172, 2, 0.68, 0.3636, 92, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.i_max", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.i_max = i_max"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L18_C8", "label": "self.feed_forward =", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "vector": [14, 2, 0.3103, 0.0172, 2, 0.68, 0.4545, 577, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.feed_forward", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.feed_forward = feed_forward"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L19_C8", "label": "self.rate =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "vector": [14, 2, 0.3276, 0.0172, 2, 0.68, 0.5455, 6, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rate = rate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L20_C8", "label": "self.saturation =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "vector": [14, 2, 0.3448, 0.0172, 2, 0.68, 0.6364, 286, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.saturation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.saturation = saturation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L21_C8", "label": "self.err_last =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "vector": [14, 2, 0.3621, 0.0172, 2, 0.68, 0.7273, 945, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.err_last", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.err_last = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L22_C8", "label": "self.integral =", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "vector": [14, 2, 0.3793, 0.0172, 2, 0.68, 0.8182, 40, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.integral", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.integral = init_integ"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L23_C8", "label": "self.name =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "vector": [14, 2, 0.3966, 0.0172, 2, 0.68, 0.9091, 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_99318:If_L24_C8", "label": "if", "type": "if", "loc": [24, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "vector": [4, 2, 0.4397, 0.069, 2, 0.68, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.name is not None:\n self.err_pub = rospy.Publisher(\"/pid_controller/\" + name + \"_error\", Float64)\n self.out_pub = rospy.Publisher(\"/pid_controller/\" + name + \"_output\", Float64)\n self.diag_pub = rospy.Publisher(\"/pid_controller/\" + name + \"_diag\", Float64MultiArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L25_C12", "label": "self.err_pub = Publisher()", "type": "assigned_variable", "loc": [25, 25], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L24_C8", "vector": [14, 3, 0.431, 0.0172, 3, 0.94, 0.0, 380, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.err_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.err_pub = rospy.Publisher(\"/pid_controller/\" + name + \"_error\", Float64)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L26_C12", "label": "self.out_pub = Publisher()", "type": "assigned_variable", "loc": [26, 26], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L24_C8", "vector": [14, 3, 0.4483, 0.0172, 3, 0.94, 0.5, 417, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.out_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.out_pub = rospy.Publisher(\"/pid_controller/\" + name + \"_output\", Float64)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L27_C12", "label": "self.diag_pub = Publisher()", "type": "assigned_variable", "loc": [27, 27], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L24_C8", "vector": [14, 3, 0.4655, 0.0172, 3, 0.94, 1.0, 664, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.diag_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.diag_pub = rospy.Publisher(\"/pid_controller/\" + name + \"_diag\", Float64MultiArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "label": "update_state", "type": "function", "loc": [31, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:ClassDef_L10_C0", "vector": [2, 1, 0.7328, 0.4138, 1, 0.34, 0.5, 502, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "update_state", "arg_names": ["self", "err"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update_state(self, err):\n last_integral = self.integral\n self.integral += err / self.rate\n if self.i_max is not None:\n self.integral = np.clip(self.integral, -self.i_max, self.i_max)\n if self.err_last is None:\n self.err_last = err\n propr = self.k_p * err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L32_C8", "label": "last_integral =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "vector": [14, 2, 0.5517, 0.0172, 2, 0.54, 0.0, 239, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "last_integral", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " last_integral = self.integral"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L34_C8", "label": "if", "type": "if", "loc": [34, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "vector": [4, 2, 0.5948, 0.0345, 2, 0.54, 0.0909, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.i_max is not None:\n self.integral = np.clip(self.integral, -self.i_max, self.i_max)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L35_C12", "label": "self.integral = clip()", "type": "assigned_variable", "loc": [35, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L34_C8", "vector": [14, 3, 0.6034, 0.0172, 3, 0.95, 0.0, 40, 3, 3, 0, 0, 689, 10, 1], "semantic": {"name": "self.integral", "arg_names": [], "import_names": [], "rhs_call_name": "clip", "annotation": ""}, "snippet": " self.integral = np.clip(self.integral, -self.i_max, self.i_max)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L36_C8", "label": "if", "type": "if", "loc": [36, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "vector": [4, 2, 0.6293, 0.0345, 2, 0.54, 0.1818, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.err_last is None:\n self.err_last = err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L37_C12", "label": "self.err_last =", "type": "assigned_variable", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L36_C8", "vector": [14, 3, 0.6379, 0.0172, 3, 0.04, 0.0, 945, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.err_last", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.err_last = err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L38_C8", "label": "propr =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "vector": [14, 2, 0.6552, 0.0172, 2, 0.54, 0.2727, 799, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "propr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " propr = self.k_p * err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L39_C8", "label": "integ =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "vector": [14, 2, 0.6724, 0.0172, 2, 0.54, 0.3636, 326, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "integ", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " integ = self.k_i * self.integral"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L40_C8", "label": "deriv =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "vector": [14, 2, 0.6897, 0.0172, 2, 0.54, 0.4545, 170, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "deriv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " deriv = self.k_d * (err - self.err_last) * self.rate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L41_C8", "label": "feedf =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "vector": [14, 2, 0.7069, 0.0172, 2, 0.54, 0.5455, 874, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "feedf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " feedf = self.feed_forward"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L42_C8", "label": "raw_y =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "vector": [14, 2, 0.7241, 0.0172, 2, 0.54, 0.6364, 706, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "raw_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " raw_y = propr + integ + deriv + feedf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L43_C8", "label": "self.err_last =", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "vector": [14, 2, 0.7414, 0.0172, 2, 0.54, 0.7273, 945, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.err_last", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.err_last = err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L44_C8", "label": "if", "type": "if", "loc": [44, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "vector": [4, 2, 0.7845, 0.069, 2, 0.54, 0.8182, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.saturation is not None:\n self.y = np.clip(raw_y, -self.saturation, self.saturation)\n if self.y in [-self.saturation, self.saturation]:\n self.integral = last_integral"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L45_C12", "label": "self.y = clip()", "type": "assigned_variable", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L44_C8", "vector": [14, 3, 0.7759, 0.0172, 3, 0.99, 0.0, 276, 3, 3, 0, 0, 689, 10, 1], "semantic": {"name": "self.y", "arg_names": [], "import_names": [], "rhs_call_name": "clip", "annotation": ""}, "snippet": " self.y = np.clip(raw_y, -self.saturation, self.saturation)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L46_C12", "label": "if", "type": "if", "loc": [46, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L44_C8", "vector": [4, 3, 0.8017, 0.0345, 3, 0.99, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.y in [-self.saturation, self.saturation]:\n self.integral = last_integral"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L47_C16", "label": "self.integral =", "type": "assigned_variable", "loc": [47, 47], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L46_C12", "vector": [14, 4, 0.8103, 0.0172, 4, 0.92, 0.0, 40, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.integral", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.integral = last_integral"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L48_C8", "label": "if", "type": "if", "loc": [48, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "vector": [4, 2, 0.8707, 0.1034, 2, 0.54, 0.9091, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.name is not None:\n self.err_pub.publish(err)\n self.out_pub.publish(self.y)\n diag_msg = Float64MultiArray()\n diag_msg.data = [self.y, propr, integ, deriv, feedf, raw_y, self.saturation]\n self.diag_pub.publish(diag_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Expr_L49_C12", "label": "publish()", "type": "expression", "loc": [49, 49], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L48_C8", "vector": [8, 3, 0.8448, 0.0172, 3, 0.58, 0.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.err_pub.publish(err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Expr_L50_C12", "label": "publish()", "type": "expression", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L48_C8", "vector": [8, 3, 0.8621, 0.0172, 3, 0.58, 0.25, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.out_pub.publish(self.y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L51_C12", "label": "diag_msg = Float64MultiArray()", "type": "assigned_variable", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L48_C8", "vector": [14, 3, 0.8793, 0.0172, 3, 0.58, 0.5, 292, 3, 0, 0, 0, 797, 10, 1], "semantic": {"name": "diag_msg", "arg_names": [], "import_names": [], "rhs_call_name": "Float64MultiArray", "annotation": ""}, "snippet": " diag_msg = Float64MultiArray()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L52_C12", "label": "diag_msg.data =", "type": "assigned_variable", "loc": [52, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L48_C8", "vector": [14, 3, 0.8966, 0.0172, 3, 0.58, 0.75, 141, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "diag_msg.data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " diag_msg.data = [self.y, propr, integ, deriv, feedf, raw_y, self.saturation]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Expr_L53_C12", "label": "publish()", "type": "expression", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L48_C8", "vector": [8, 3, 0.9138, 0.0172, 3, 0.58, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.diag_pub.publish(diag_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Return_L54_C8", "label": "return", "type": "return", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "vector": [13, 2, 0.931, 0.0172, 2, 0.54, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L56_C4", "label": "reset_controller", "type": "function", "loc": [56, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:ClassDef_L10_C0", "vector": [2, 1, 0.9828, 0.0517, 1, 0.34, 1.0, 273, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "reset_controller", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def reset_controller(self):\n self.err_last = None\n self.integral = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L57_C8", "label": "self.err_last =", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L56_C4", "vector": [14, 2, 0.9828, 0.0172, 2, 0.52, 0.0, 945, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.err_last", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.err_last = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L58_C8", "label": "self.integral =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L56_C4", "vector": [14, 2, 1.0, 0.0172, 2, 0.52, 1.0, 40, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.integral", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.integral = 0"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99318:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L24_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L25_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L24_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L26_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L24_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L27_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L34_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L35_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L36_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L46_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L47_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Expr_L49_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Expr_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:If_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Expr_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Return_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99318:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99318:Assign_L58_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_99319
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_99319: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_99319: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_99319: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_99319: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_99319: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_99319: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_99319: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_99319: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_99319:Assign_L41_C4", "label": "robot_name =", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99319:FunctionDef_L40_C0", "vector": [14, 1, 0.2789, 0.0068, 1, 0.97, 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_99319:Assign_L42_C4", "label": "chain_names =", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99319:FunctionDef_L40_C0", "vector": [14, 1, 0.2857, 0.0068, 1, 0.97, 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_99319:Assign_L43_C4", "label": "dynamatics_nms =", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99319:FunctionDef_L40_C0", "vector": [14, 1, 0.2925, 0.0068, 1, 0.97, 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_99319:Expr_L45_C4", "label": "make_safe_operational()", "type": "expression", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99319:FunctionDef_L40_C0", "vector": [8, 1, 0.3061, 0.0068, 1, 0.97, 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_99319:For_L46_C4", "label": "for c", "type": "for", "loc": [46, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99319:FunctionDef_L40_C0", "vector": [6, 1, 0.3163, 0.0136, 1, 0.97, 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_99319:Expr_L47_C8", "label": "make_safe_operational()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99319:For_L46_C4", "vector": [8, 2, 0.3197, 0.0068, 2, 0.97, 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_99319:For_L48_C4", "label": "for d", "type": "for", "loc": [48, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99319:FunctionDef_L40_C0", "vector": [6, 1, 0.3299, 0.0136, 1, 0.97, 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_99319:Expr_L49_C8", "label": "make_safe_operational()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99319:For_L48_C4", "vector": [8, 2, 0.3333, 0.0068, 2, 0.08, 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_99319: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_99319: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_99319: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_99319: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_99319: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_99319: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_99319: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_99319: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_99319: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_99319:Assign_L64_C4", "label": "comp = create_component()", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99319:For_L63_C0", "vector": [14, 1, 0.4354, 0.0068, 1, 0.8, 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_99319:Expr_L65_C4", "label": "append()", "type": "expression", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99319:For_L63_C0", "vector": [8, 1, 0.4422, 0.0068, 1, 0.8, 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_99319:Expr_L66_C4", "label": "publish_command()", "type": "expression", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99319:For_L63_C0", "vector": [8, 1, 0.449, 0.0068, 1, 0.8, 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_99319:If_L67_C4", "label": "if", "type": "if", "loc": [67, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99319:For_L63_C0", "vector": [4, 1, 0.466, 0.0272, 1, 0.8, 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_99319:Expr_L68_C8", "label": "set_control_mode()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99319:If_L67_C4", "vector": [8, 2, 0.4626, 0.0068, 2, 0.68, 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_99319:Expr_L70_C8", "label": "set_control_mode()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99319:If_L67_C4", "vector": [8, 2, 0.4762, 0.0068, 2, 0.68, 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_99319:Expr_L71_C4", "label": "set_stiffness()", "type": "expression", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99319:For_L63_C0", "vector": [8, 1, 0.483, 0.0068, 1, 0.8, 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_99319:Expr_L72_C4", "label": "set_slew_rate_proportion()", "type": "expression", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99319:For_L63_C0", "vector": [8, 1, 0.4898, 0.0068, 1, 0.8, 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_99319: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_99319: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_99319: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_99319: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_99319: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_99319: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_99319: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_99319: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_99319: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_99319: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_99319: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_99319: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_99319:Expr_L95_C4", "label": "set_theta_rad()", "type": "expression", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99319:For_L94_C0", "vector": [8, 1, 0.6463, 0.0068, 1, 0.73, 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_99319: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_99319: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_99319: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_99319: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_99319:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99319:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99319:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99319:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99319:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99319:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99319:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99319:Expr_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99319:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99319:For_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99319:For_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99319:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99319:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99319:For_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99319:For_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99319:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99319:For_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99319:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99319:For_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99319:Expr_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99319:For_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99319:Expr_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99319:For_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99319:If_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99319:If_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99319:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99319:If_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99319:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99319:For_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99319:Expr_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99319:For_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99319:Expr_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99319:For_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99319:Expr_L95_C4"}]
# # 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 import roslib; roslib.load_manifest('hrl_cody_arms') import rospy from cody_arm_kinematics import CodyArmKinematics from equilibrium_point_control.hrl_arm import HRLArm import hrl_lib.viz as hv from hrl_msgs.msg import FloatArray, FloatArrayBare from std_msgs.msg import Header, Bool, Empty from visualization_msgs.msg import Marker # used in client and server. def get_joint_name_list(arm): if arm == 'r': return ['m3joint_ma1_j%d'%i for i in range(7)] else: return ['m3joint_ma2_j%d'%i for i in range(7)] class CodyArmClient(HRLArm): # arm - 'r' or 'l' def __init__(self, arm): kinematics = CodyArmKinematics(arm) HRLArm.__init__(self, kinematics) #stiffness from .yaml file [1800., 1300., 350., 600., 60., 80., 60.] mN-meter/deg self.nom_kp = [103, 74.5, 20.1, 4.4, 3.44] #N-m/rad # NB: Original value for joint 4 was 34.4, changed to 4.4 # we don't use last two values becuase they are position controlled - 4.58, 3.44] if arm == 'r': #damping from .yaml file [100., 120., 10., 25., 1.25, 0.3, 0.25] mN-meter-sec/deg self.nom_kd = [5.73, 6.88, 0.573, 1.43, 0.0716] #N-m-s/deg # we don't use last two values becuase they are position controlled - 0.0172, 0.0143] elif arm == 'l': #damping from .yaml file [80., 60., 10., 15., 1.25, 0.3, 0.20] mN-meter-sec/deg self.nom_kd = [4.58, 3.44, 0.573, 0.859, 0.0716] #N-m-s/deg # we don't use last two values becuase they are position controlled - 0.0172, 0.0115 else: rospy.logerr("You didn't give me a 'r' or 'l' for which arm ... Exiting") assert(False) self.alpha = None self.torque = None self.motor_temps = None self.ft_val = None self.pwr_state = False self.fts_bias = {'force': np.matrix(np.zeros(3)).T, 'torque': np.matrix(np.zeros(3)).T} self.joint_names_list = get_joint_name_list(arm) self.jep_cmd_pub = rospy.Publisher('/'+arm+'_arm/command/jep', FloatArray) self.alph_cmd_pub = rospy.Publisher('/'+arm+'_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.marker_pub = rospy.Publisher('/'+arm+'_arm/viz/markers', Marker) ################## The following are for computing joint accelerations (added by Tapo, Jan 23-2013) ################## self.q_r = None self.q_l = None self.q_rHOT = None self.q_lHOT = None self.q_rHHOT = None self.q_lHHOT = None self.time_stamp = None ###################################################################################################################### rospy.Subscriber('/'+arm+'_arm/jep', FloatArray, self.ep_cb) rospy.Subscriber('/'+arm+'_arm/joint_impedance_scale', FloatArray, self.alpha_cb) rospy.Subscriber('/'+arm+'_arm/q', FloatArray, self.q_cb) rospy.Subscriber('/'+arm+'_arm/qdot', FloatArray, self.qdot_cb) rospy.Subscriber('/'+arm+'_arm/force', FloatArray, self.force_cb) rospy.Subscriber('/'+arm+'_arm/force_raw', FloatArray, self.raw_force_cb) rospy.Subscriber('/'+arm+'_arm/joint_torque', FloatArray, self.torque_cb) rospy.Subscriber('/'+arm+'_arm/joint_motor_temp', FloatArray, self.motor_temp_cb) rospy.Subscriber('/arms/pwr_state', Bool, self.pwr_state_cb) # Set desired joint angle - either through a delta from the current position, or as an absolute value. rospy.Subscriber ("/haptic_mpc/q_des", FloatArrayBare, self.set_ep_callback) rospy.Subscriber ("/haptic_mpc/delta_q_des", FloatArrayBare, self.set_delta_ep_callback) try: rospy.init_node(arm+'_arm_client', anonymous=False) except rospy.ROSException: pass #---------- ROS callbacks ----------------- def pwr_state_cb(self, msg): with self.lock: self.pwr_state = msg.data def ep_cb(self, msg): with self.lock: self.ep = copy.copy(msg.data) def alpha_cb(self, msg): with self.lock: self.alpha = copy.copy(msg.data) self.kp = (np.array(self.alpha)*np.array(self.nom_kp)).tolist() self.kd = (np.array(self.alpha)*np.array(self.nom_kd)).tolist() def torque_cb(self, msg): with self.lock: self.torque = copy.copy(msg.data) def motor_temp_cb(self, msg): with self.lock: self.motor_temps = copy.copy(msg.data) def q_cb(self, msg): with self.lock: self.q = copy.copy(msg.data) def qdot_cb(self, msg): with self.lock: self.qdot = copy.copy(msg.data) def force_cb(self, msg): with self.lock: self.ft_val = copy.copy(msg.data) def raw_force_cb(self, msg): with self.lock: self.raw_force = copy.copy(msg.data) #--------- functions to use ----------------- def publish_rviz_markers(self): # publish the CEP marker. o = np.matrix([0.,0.,0.,1.]).T jep = self.get_ep() cep, r = self.kinematics.FK(jep) 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., m_id=1) cep_marker.header.stamp = rospy.Time.now() self.marker_pub.publish(cep_marker) q = self.get_joint_angles() ee, r = self.kinematics.FK(q) ee_marker = hv.single_marker(ee, o, 'sphere', '/torso_lift_link', color=(0., 1., 0., 1.), scale = (0.02, 0.02, 0.02), duration=0., m_id=2) ee_marker.header.stamp = rospy.Time.now() self.marker_pub.publish(ee_marker) def get_wrist_force(self, bias=True, base_frame=True, filtered = True): with self.lock: if filtered: f = copy.copy(self.ft_val) else: f = copy.copy(self.raw_force) f_mat = np.matrix(f).T f_mat = f_mat[0:3,:] # ignoring the torques. if bias: f_mat = f_mat - self.fts_bias['force'] #Tiffany added an 's' to 'ft' if base_frame: q = self.get_joint_angles() rot = self.kinematics.FK(q)[1] f_mat = rot*f_mat return f_mat def bias_wrist_ft(self): f_list = [] t_list = [] rospy.loginfo('Starting biasing...') for i in range(20): f_list.append(self.get_wrist_force(bias=False, base_frame=False)) rospy.sleep(0.02) f_b = np.mean(np.column_stack(f_list), 1) # torque is unimplemented. t_b = self.get_wrist_torque(bias=False) #Tiffany Nov 8 2011 removed 'arm' arg self.fts_bias['force'] = f_b self.fts_bias['torque'] = t_b rospy.loginfo('...done') # @return array-like of floats b/w 0 and 1. def get_impedance_scale(self): with self.lock: sc = copy.copy(self.alpha) return sc # @param s - list of floats b/w 0 and 1. def set_impedance_scale(self, s): time_stamp = rospy.Time.now() h = Header() h.stamp = time_stamp self.alph_cmd_pub.publish(FloatArray(h, s)) def set_ep_callback(self, msg): des_jep = msg.data self.set_ep(des_jep) def set_delta_ep_callback(self, msg): delta_jep = msg.data if self.ep == None: self.ep = self.get_joint_angles() des_jep = (np.array(self.ep) + np.array(delta_jep)).tolist() self.set_ep(des_jep) # @param duration - for compatibility with the PR2 class. def set_ep(self, jep, duration=None): time_stamp = rospy.Time.now() h = Header() h.stamp = time_stamp self.jep_cmd_pub.publish(FloatArray(h, jep)) self.publish_rviz_markers() def is_motor_power_on(self): return self.pwr_state def motors_off(self): self.motors_off_pub.publish() #-------- unimplemented functions ----------------- # leaving this unimplemented for now. Advait Nov 14, 2010. # Implemented Now - Tapo, Jan 23 2013 def get_joint_accelerations(self, arm): t_now = rospy.get_time() q = self.get_joint_angles() if arm == 'r': if self.q_r != None and self.q_rHOT != None and self.q_rHHOT != None and self.time_stamp != None: dt = t_now - self.time_stamp qddot_r = (-np.array(q) + 4*np.array(self.q_r) - 5*np.array(self.q_rHOT) + 2*np.array(self.q_rHHOT)) / (dt*dt) else: qddot_r = np.zeros(7) self.q_rHHOT = self.q_rHOT self.q_rHOT = self.q_r self.q_r = q self.time_stamp = t_now return qddot_r elif arm == 'l': if self.q_l != None and self.q_lHOT != None and self.q_lHHOT != None and self.time_stamp != None: dt = t_now - self.time_stamp qddot_l = (-np.array(q) + 4*np.array(self.q_l) - 5*np.array(self.q_lHOT) + 2*np.array(self.q_lHHOT)) / (dt*dt) else: qddot_l = np.zeros(7) self.q_lHHOT = self.q_lHOT self.q_lHOT = self.q_l self.q_l = q self.time_stamp = t_now return qddot_l # now implemented - marc Jul 2012 def get_joint_torques(self): return self.torque # added this as a safety measure since fabrice skin is not # measuring real forces - marc Jul 2012 def get_joint_motor_temps(self): return self.motor_temps # leaving this unimplemented for now. Advait Nov 14, 2010. def get_wrist_torque(self, bias=True): #Tiffany Nov 8 2011 removed 'arm' arg pass # these two classes are specifically for the model predictive # controller that we developed for reaching in clutter with multiple # contacts. # We override the get_joint_impedance function to return values that # the model predictive controller will use. class CodyArmClient_7DOF(CodyArmClient): def __init__(self, arm): CodyArmClient.__init__(self, arm) # dummy kp values for the wrist, kd still of length five def get_joint_impedance(self): with self.lock: kp_t = [k for k in self.kp] kp_t[-1] = 30. kp_t.append(30.) kp_t.append(30.) return kp_t, copy.copy(self.kd) class CodyArmClient_5DOF(CodyArmClient): def __init__(self, arm): CodyArmClient.__init__(self, arm) def get_joint_impedance(self): with self.lock: return copy.copy(self.kp[0:5]), copy.copy(self.kd[0:5]) if __name__ == '__main__': import m3.toolbox as m3t import hrl_lib.transforms as tr import optparse p = optparse.OptionParser() p.add_option('--arm_to_use', action='store', dest='arm', type='string', help='which arm to use (l or r)', default=None) opt, args = p.parse_args() if opt.arm == None: print 'Please specify an arm_to_use' print 'Exiting...' sys.exit() ac = CodyArmClient(opt.arm) # print FT sensor readings. if False: ac.bias_wrist_ft() while not rospy.is_shutdown(): f = ac.get_wrist_force() print 'f:', f.A1 rospy.sleep(0.05) # print joint angles. if False: while not rospy.is_shutdown(): #jep = ac.get_ep() #print 'jep:', jep q = ac.get_joint_angles() print 'q:', np.degrees(q).tolist()[1] rospy.sleep(0.05) # publish end effector marker. useful to verify set_tooltip. if False: ac.kinematics.set_tooltip(np.matrix([0.,0.,-0.04]).T) # stub with mini45 while not rospy.is_shutdown(): ac.publish_rviz_markers() rospy.sleep(0.05) # print joint velocities if False: while not rospy.is_shutdown(): qdot = ac.get_joint_velocities() print 'qdot:', np.degrees(qdot) rospy.sleep(0.05) # testing changing the impedance if False: rospy.sleep(1.) isc = ac.get_impedance_scale() print isc isc[1] = 0.3 ac.set_impedance_scale(isc) rospy.sleep(1.) isc = ac.get_impedance_scale() print isc
ajibawa-2023/Python-Code-Large/train/row_99320
227
413
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Import_L33_C0", "label": "math import math", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.0799, 0.0024, 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_99320:Import_L34_C0", "label": "numpy import np", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0823, 0.0024, 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_99320:Import_L35_C0", "label": "copy import copy", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.0847, 0.0024, 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_99320:Import_L36_C0", "label": "sys import sys", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.0872, 0.0024, 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_99320:Import_L38_C0", "label": "roslib import roslib", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.092, 0.0024, 0, 0.66, 0.2353, 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_cody_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L38_C15", "label": "load_manifest()", "type": "expression", "loc": [38, 38], "level": 0, "parent": null, "vector": [8, 0, 0.092, 0.0024, 0, 0.66, 0.2941, 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_cody_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Import_L39_C0", "label": "rospy import rospy", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.0944, 0.0024, 0, 0.66, 0.3529, 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_99320:ImportFrom_L41_C0", "label": "from cody_arm_kinematics import CodyArmKinematics", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.0993, 0.0024, 0, 0.66, 0.4118, 201, 0, 1, 0, 0, 201, 0, 0], "semantic": {"name": "cody_arm_kinematics", "arg_names": [], "import_names": ["CodyArmKinematics"], "rhs_call_name": "", "annotation": ""}, "snippet": "from cody_arm_kinematics import CodyArmKinematics"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:ImportFrom_L42_C0", "label": "from equilibrium_point_control.hrl_arm import HRLArm", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.1017, 0.0024, 0, 0.66, 0.4706, 191, 0, 1, 0, 0, 191, 0, 0], "semantic": {"name": "equilibrium_point_control.hrl_arm", "arg_names": [], "import_names": ["HRLArm"], "rhs_call_name": "", "annotation": ""}, "snippet": "from equilibrium_point_control.hrl_arm import HRLArm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Import_L43_C0", "label": "hrl_lib.viz import hv", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.1041, 0.0024, 0, 0.66, 0.5294, 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_99320:ImportFrom_L45_C0", "label": "from hrl_msgs.msg import FloatArray, FloatArrayBare", "type": "import", "loc": [45, 45], "level": 0, "parent": null, "vector": [1, 0, 0.109, 0.0024, 0, 0.66, 0.5882, 513, 0, 2, 0, 0, 513, 0, 0], "semantic": {"name": "hrl_msgs.msg", "arg_names": [], "import_names": ["FloatArray", "FloatArrayBare"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_msgs.msg import FloatArray, FloatArrayBare"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:ImportFrom_L46_C0", "label": "from std_msgs.msg import Header, Bool, Empty", "type": "import", "loc": [46, 46], "level": 0, "parent": null, "vector": [1, 0, 0.1114, 0.0024, 0, 0.66, 0.6471, 366, 0, 3, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Header", "Bool", "Empty"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Header, Bool, Empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:ImportFrom_L48_C0", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [48, 48], "level": 0, "parent": null, "vector": [1, 0, 0.1162, 0.0024, 0, 0.66, 0.7059, 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_99320:FunctionDef_L52_C0", "label": "get_joint_name_list", "type": "function", "loc": [52, 56], "level": 0, "parent": null, "vector": [2, 0, 0.1308, 0.0121, 0, 0.66, 0.7647, 178, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "get_joint_name_list", "arg_names": ["arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_joint_name_list(arm):\n if arm == 'r':\n return ['m3joint_ma1_j%d'%i for i in range(7)]\n else:\n return ['m3joint_ma2_j%d'%i for i in range(7)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L53_C4", "label": "if", "type": "if", "loc": [53, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L52_C0", "vector": [4, 1, 0.132, 0.0097, 1, 0.58, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'r':\n return ['m3joint_ma1_j%d'%i for i in range(7)]\n else:\n return ['m3joint_ma2_j%d'%i for i in range(7)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Return_L54_C8", "label": "return", "type": "return", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L53_C4", "vector": [13, 2, 0.1308, 0.0024, 2, 0.75, 0.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ['m3joint_ma1_j%d'%i for i in range(7)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Return_L56_C8", "label": "return", "type": "return", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L53_C4", "vector": [13, 2, 0.1356, 0.0024, 2, 0.75, 1.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ['m3joint_ma2_j%d'%i for i in range(7)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "label": "CodyArmClient", "type": "class", "loc": [59, 315], "level": 0, "parent": null, "vector": [3, 0, 0.4528, 0.6223, 0, 0.66, 0.8235, 48, 0, 24, 0, 0, 794, 0, 93], "semantic": {"name": "CodyArmClient", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CodyArmClient(HRLArm):\n # arm - 'r' or 'l'\n def __init__(self, arm):\n kinematics = CodyArmKinematics(arm)\n HRLArm.__init__(self, kinematics)\n\n #stiffness from .yaml file [1800., 1300., 350., 600., 60., 80., 60.] mN-meter/deg\n self.nom_kp = [103, 74.5, 20.1, 4.4, 3.44] #N-m/rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "label": "__init__", "type": "function", "loc": [61, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "vector": [2, 1, 0.2337, 0.1743, 1, 0.71, 0.0, 555, 0, 2, 0, 0, 0, 0, 25], "semantic": {"name": "__init__", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arm):\n kinematics = CodyArmKinematics(arm)\n HRLArm.__init__(self, kinematics)\n\n #stiffness from .yaml file [1800., 1300., 350., 600., 60., 80., 60.] mN-meter/deg\n self.nom_kp = [103, 74.5, 20.1, 4.4, 3.44] #N-m/rad\n\t# NB: Original value for joint 4 was 34.4, changed to 4.4\n # we don't use last two values becuase they are position controlled - 4.58, 3.44] "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L62_C8", "label": "kinematics = CodyArmKinematics()", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [14, 2, 0.1501, 0.0024, 2, 0.51, 0.0, 154, 3, 1, 0, 0, 11, 10, 1], "semantic": {"name": "kinematics", "arg_names": [], "import_names": [], "rhs_call_name": "CodyArmKinematics", "annotation": ""}, "snippet": " kinematics = CodyArmKinematics(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L63_C8", "label": "__init__()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [8, 2, 0.1525, 0.0024, 2, 0.51, 0.0294, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " HRLArm.__init__(self, kinematics)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L66_C8", "label": "self.nom_kp =", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [14, 2, 0.1598, 0.0024, 2, 0.51, 0.0588, 184, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.nom_kp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.nom_kp = [103, 74.5, 20.1, 4.4, 3.44] #N-m/rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L70_C8", "label": "if", "type": "if", "loc": [70, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [4, 2, 0.1816, 0.0266, 2, 0.51, 0.0882, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'r':\n #damping from .yaml file [100., 120., 10., 25., 1.25, 0.3, 0.25] mN-meter-sec/deg\n self.nom_kd = [5.73, 6.88, 0.573, 1.43, 0.0716] #N-m-s/deg\n # we don't use last two values becuase they are position controlled - 0.0172, 0.0143]\n elif arm == 'l':\n #damping from .yaml file [80., 60., 10., 15., 1.25, 0.3, 0.20] mN-meter-sec/deg\n self.nom_kd = [4.58, 3.44, 0.573, 0.859, 0.0716] #N-m-s/deg\n # we don't use last two values becuase they are position controlled - 0.0172, 0.0115"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L72_C12", "label": "self.nom_kd =", "type": "assigned_variable", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L70_C8", "vector": [14, 3, 0.1743, 0.0024, 3, 0.37, 0.0, 525, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.nom_kd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.nom_kd = [5.73, 6.88, 0.573, 1.43, 0.0716] #N-m-s/deg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L74_C8", "label": "if", "type": "if", "loc": [74, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L70_C8", "vector": [4, 3, 0.1864, 0.0169, 3, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif arm == 'l':\n #damping from .yaml file [80., 60., 10., 15., 1.25, 0.3, 0.20] mN-meter-sec/deg\n self.nom_kd = [4.58, 3.44, 0.573, 0.859, 0.0716] #N-m-s/deg\n # we don't use last two values becuase they are position controlled - 0.0172, 0.0115\n else:\n rospy.logerr(\"You didn't give me a 'r' or 'l' for which arm ... Exiting\")\n assert(False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L76_C12", "label": "self.nom_kd =", "type": "assigned_variable", "loc": [76, 76], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L74_C8", "vector": [14, 4, 0.184, 0.0024, 4, 0.42, 0.0, 525, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.nom_kd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.nom_kd = [4.58, 3.44, 0.573, 0.859, 0.0716] #N-m-s/deg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L79_C12", "label": "logerr()", "type": "expression", "loc": [79, 79], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L74_C8", "vector": [8, 4, 0.1913, 0.0024, 4, 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(\"You didn't give me a 'r' or 'l' for which arm ... Exiting\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L82_C8", "label": "self.alpha =", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [14, 2, 0.1985, 0.0024, 2, 0.51, 0.1176, 337, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.alpha", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.alpha = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L83_C8", "label": "self.torque =", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [14, 2, 0.201, 0.0024, 2, 0.51, 0.1471, 286, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.torque", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.torque = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L84_C8", "label": "self.motor_temps =", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [14, 2, 0.2034, 0.0024, 2, 0.51, 0.1765, 648, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.motor_temps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.motor_temps = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L85_C8", "label": "self.ft_val =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [14, 2, 0.2058, 0.0024, 2, 0.51, 0.2059, 637, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.ft_val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ft_val = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L86_C8", "label": "self.pwr_state =", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [14, 2, 0.2082, 0.0024, 2, 0.51, 0.2353, 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_99320:Assign_L88_C8", "label": "self.fts_bias =", "type": "assigned_variable", "loc": [88, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [14, 2, 0.2143, 0.0048, 2, 0.51, 0.2647, 959, 0, 0, 0, 0, 0, 6, 4], "semantic": {"name": "self.fts_bias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.fts_bias = {'force': np.matrix(np.zeros(3)).T,\n 'torque': np.matrix(np.zeros(3)).T}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L91_C8", "label": "self.joint_names_list = get_joint_name_list()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [14, 2, 0.2203, 0.0024, 2, 0.51, 0.2941, 515, 3, 1, 0, 0, 178, 10, 1], "semantic": {"name": "self.joint_names_list", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_name_list", "annotation": ""}, "snippet": " self.joint_names_list = get_joint_name_list(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L93_C8", "label": "self.jep_cmd_pub = Publisher()", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [14, 2, 0.2252, 0.0024, 2, 0.51, 0.3235, 112, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.jep_cmd_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.jep_cmd_pub = rospy.Publisher('/'+arm+'_arm/command/jep', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L94_C8", "label": "self.alph_cmd_pub = Publisher()", "type": "assigned_variable", "loc": [94, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [14, 2, 0.2288, 0.0048, 2, 0.51, 0.3529, 305, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.alph_cmd_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.alph_cmd_pub = rospy.Publisher('/'+arm+'_arm/command/joint_impedance_scale',\n FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L96_C8", "label": "self.stop_pub = Publisher()", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [14, 2, 0.2324, 0.0024, 2, 0.51, 0.3824, 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_99320:Assign_L97_C8", "label": "self.motors_off_pub = Publisher()", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [14, 2, 0.2349, 0.0024, 2, 0.51, 0.4118, 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_99320:Assign_L99_C8", "label": "self.marker_pub = Publisher()", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [14, 2, 0.2397, 0.0024, 2, 0.51, 0.4412, 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('/'+arm+'_arm/viz/markers', Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L102_C8", "label": "self.q_r =", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [14, 2, 0.247, 0.0024, 2, 0.51, 0.4706, 707, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.q_r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_r = None "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L103_C8", "label": "self.q_l =", "type": "assigned_variable", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [14, 2, 0.2494, 0.0024, 2, 0.51, 0.5, 651, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.q_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_l = None "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L104_C8", "label": "self.q_rHOT =", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [14, 2, 0.2518, 0.0024, 2, 0.51, 0.5294, 355, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.q_rHOT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_rHOT = None "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L105_C8", "label": "self.q_lHOT =", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [14, 2, 0.2542, 0.0024, 2, 0.51, 0.5588, 934, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.q_lHOT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_lHOT = None "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L106_C8", "label": "self.q_rHHOT =", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [14, 2, 0.2567, 0.0024, 2, 0.51, 0.5882, 744, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.q_rHHOT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_rHHOT = None "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L107_C8", "label": "self.q_lHHOT =", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [14, 2, 0.2591, 0.0024, 2, 0.51, 0.6176, 164, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.q_lHHOT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_lHHOT = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L108_C8", "label": "self.time_stamp =", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [14, 2, 0.2615, 0.0024, 2, 0.51, 0.6471, 520, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.time_stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.time_stamp = None "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L111_C8", "label": "Subscriber()", "type": "expression", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [8, 2, 0.2688, 0.0024, 2, 0.51, 0.6765, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/'+arm+'_arm/jep', FloatArray, self.ep_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L112_C8", "label": "Subscriber()", "type": "expression", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [8, 2, 0.2712, 0.0024, 2, 0.51, 0.7059, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/'+arm+'_arm/joint_impedance_scale', FloatArray, self.alpha_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L114_C8", "label": "Subscriber()", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [8, 2, 0.276, 0.0024, 2, 0.51, 0.7353, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/'+arm+'_arm/q', FloatArray, self.q_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L115_C8", "label": "Subscriber()", "type": "expression", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [8, 2, 0.2785, 0.0024, 2, 0.51, 0.7647, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/'+arm+'_arm/qdot', FloatArray, self.qdot_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L117_C8", "label": "Subscriber()", "type": "expression", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [8, 2, 0.2833, 0.0024, 2, 0.51, 0.7941, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/'+arm+'_arm/force', FloatArray, self.force_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L118_C8", "label": "Subscriber()", "type": "expression", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [8, 2, 0.2857, 0.0024, 2, 0.51, 0.8235, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/'+arm+'_arm/force_raw', FloatArray, self.raw_force_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L120_C8", "label": "Subscriber()", "type": "expression", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [8, 2, 0.2906, 0.0024, 2, 0.51, 0.8529, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/'+arm+'_arm/joint_torque', FloatArray, self.torque_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L122_C8", "label": "Subscriber()", "type": "expression", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [8, 2, 0.2954, 0.0024, 2, 0.51, 0.8824, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/'+arm+'_arm/joint_motor_temp', FloatArray, self.motor_temp_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L123_C8", "label": "Subscriber()", "type": "expression", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [8, 2, 0.2978, 0.0024, 2, 0.51, 0.9118, 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_99320:Expr_L126_C8", "label": "Subscriber()", "type": "expression", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [8, 2, 0.3051, 0.0024, 2, 0.51, 0.9412, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber (\"/haptic_mpc/q_des\", FloatArrayBare, self.set_ep_callback)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L127_C8", "label": "Subscriber()", "type": "expression", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [8, 2, 0.3075, 0.0024, 2, 0.51, 0.9706, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber (\"/haptic_mpc/delta_q_des\", FloatArrayBare, self.set_delta_ep_callback)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Try_L129_C8", "label": "try", "type": "try", "loc": [129, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "vector": [7, 2, 0.316, 0.0097, 2, 0.51, 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(arm+'_arm_client', anonymous=False)\n except rospy.ROSException:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L130_C12", "label": "init_node()", "type": "expression", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:Try_L129_C8", "vector": [8, 3, 0.3148, 0.0024, 3, 0.8, 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(arm+'_arm_client', anonymous=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L135_C4", "label": "pwr_state_cb", "type": "function", "loc": [135, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "vector": [2, 1, 0.3293, 0.0073, 1, 0.71, 0.0435, 665, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "pwr_state_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pwr_state_cb(self, msg):\n with self.lock:\n self.pwr_state = msg.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L137_C12", "label": "self.pwr_state =", "type": "assigned_variable", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L135_C4", "vector": [14, 2, 0.3317, 0.0024, 2, 0.83, 0.0, 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_99320:FunctionDef_L139_C4", "label": "ep_cb", "type": "function", "loc": [139, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "vector": [2, 1, 0.339, 0.0073, 1, 0.71, 0.087, 592, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ep_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def ep_cb(self, msg):\n with self.lock:\n self.ep = copy.copy(msg.data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L141_C12", "label": "self.ep = copy()", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L139_C4", "vector": [14, 2, 0.3414, 0.0024, 2, 0.2, 0.0, 381, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.ep", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.ep = copy.copy(msg.data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L143_C4", "label": "alpha_cb", "type": "function", "loc": [143, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "vector": [2, 1, 0.3511, 0.0121, 1, 0.71, 0.1304, 649, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "alpha_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def alpha_cb(self, msg):\n with self.lock:\n self.alpha = copy.copy(msg.data)\n self.kp = (np.array(self.alpha)*np.array(self.nom_kp)).tolist()\n self.kd = (np.array(self.alpha)*np.array(self.nom_kd)).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L145_C12", "label": "self.alpha = copy()", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L143_C4", "vector": [14, 2, 0.3511, 0.0024, 2, 0.45, 0.0, 337, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.alpha", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.alpha = copy.copy(msg.data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L146_C12", "label": "self.kp = tolist()", "type": "assigned_variable", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L143_C4", "vector": [14, 2, 0.3535, 0.0024, 2, 0.45, 0.5, 126, 3, 0, 0, 0, 185, 10, 3], "semantic": {"name": "self.kp", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " self.kp = (np.array(self.alpha)*np.array(self.nom_kp)).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L147_C12", "label": "self.kd = tolist()", "type": "assigned_variable", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L143_C4", "vector": [14, 2, 0.3559, 0.0024, 2, 0.45, 1.0, 669, 3, 0, 0, 0, 185, 10, 3], "semantic": {"name": "self.kd", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " self.kd = (np.array(self.alpha)*np.array(self.nom_kd)).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L149_C4", "label": "torque_cb", "type": "function", "loc": [149, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "vector": [2, 1, 0.3632, 0.0073, 1, 0.71, 0.1739, 237, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "torque_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def torque_cb(self, msg):\n with self.lock:\n self.torque = copy.copy(msg.data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L151_C12", "label": "self.torque = copy()", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L149_C4", "vector": [14, 2, 0.3656, 0.0024, 2, 0.57, 0.0, 286, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.torque", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.torque = copy.copy(msg.data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L153_C4", "label": "motor_temp_cb", "type": "function", "loc": [153, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "vector": [2, 1, 0.3729, 0.0073, 1, 0.71, 0.2174, 292, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "motor_temp_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def motor_temp_cb(self, msg):\n with self.lock:\n self.motor_temps = copy.copy(msg.data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L155_C12", "label": "self.motor_temps = copy()", "type": "assigned_variable", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L153_C4", "vector": [14, 2, 0.3753, 0.0024, 2, 0.18, 0.0, 648, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.motor_temps", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.motor_temps = copy.copy(msg.data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L157_C4", "label": "q_cb", "type": "function", "loc": [157, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "vector": [2, 1, 0.3826, 0.0073, 1, 0.71, 0.2609, 513, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "q_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def q_cb(self, msg):\n with self.lock:\n self.q = copy.copy(msg.data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L159_C12", "label": "self.q = copy()", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L157_C4", "vector": [14, 2, 0.385, 0.0024, 2, 0.32, 0.0, 561, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.q", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.q = copy.copy(msg.data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L161_C4", "label": "qdot_cb", "type": "function", "loc": [161, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "vector": [2, 1, 0.3923, 0.0073, 1, 0.71, 0.3043, 980, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "qdot_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def qdot_cb(self, msg):\n with self.lock:\n self.qdot = copy.copy(msg.data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L163_C12", "label": "self.qdot = copy()", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L161_C4", "vector": [14, 2, 0.3947, 0.0024, 2, 0.62, 0.0, 383, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.qdot", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.qdot = copy.copy(msg.data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L165_C4", "label": "force_cb", "type": "function", "loc": [165, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "vector": [2, 1, 0.4019, 0.0073, 1, 0.71, 0.3478, 823, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "force_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def force_cb(self, msg):\n with self.lock:\n self.ft_val = copy.copy(msg.data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L167_C12", "label": "self.ft_val = copy()", "type": "assigned_variable", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L165_C4", "vector": [14, 2, 0.4044, 0.0024, 2, 0.02, 0.0, 637, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.ft_val", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.ft_val = copy.copy(msg.data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L169_C4", "label": "raw_force_cb", "type": "function", "loc": [169, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "vector": [2, 1, 0.4116, 0.0073, 1, 0.71, 0.3913, 606, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "raw_force_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def raw_force_cb(self, msg):\n with self.lock:\n self.raw_force = copy.copy(msg.data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L171_C12", "label": "self.raw_force = copy()", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L169_C4", "vector": [14, 2, 0.414, 0.0024, 2, 0.92, 0.0, 545, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.raw_force", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.raw_force = copy.copy(msg.data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L175_C4", "label": "publish_rviz_markers", "type": "function", "loc": [175, 194], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "vector": [2, 1, 0.4467, 0.0484, 1, 0.71, 0.4348, 62, 0, 1, 0, 0, 0, 0, 11], "semantic": {"name": "publish_rviz_markers", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def publish_rviz_markers(self):\n # publish the CEP marker.\n o = np.matrix([0.,0.,0.,1.]).T\n jep = self.get_ep()\n cep, r = self.kinematics.FK(jep)\n 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_99320:Assign_L177_C8", "label": "o =", "type": "assigned_variable", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L175_C4", "vector": [14, 2, 0.4286, 0.0024, 2, 0.0, 0.0, 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_99320:Assign_L178_C8", "label": "jep = get_ep()", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L175_C4", "vector": [14, 2, 0.431, 0.0024, 2, 0.0, 0.1, 838, 3, 0, 0, 0, 563, 10, 1], "semantic": {"name": "jep", "arg_names": [], "import_names": [], "rhs_call_name": "get_ep", "annotation": ""}, "snippet": " jep = self.get_ep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L179_C8", "label": "cep, r = FK()", "type": "assigned_variable", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L175_C4", "vector": [14, 2, 0.4334, 0.0024, 2, 0.0, 0.2, 805, 3, 1, 0, 0, 252, 10, 1], "semantic": {"name": "cep, r", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " cep, r = self.kinematics.FK(jep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L180_C8", "label": "cep_marker = single_marker()", "type": "assigned_variable", "loc": [180, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L175_C4", "vector": [14, 2, 0.4395, 0.0097, 2, 0.0, 0.3, 414, 3, 8, 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.,\n m_id=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L184_C8", "label": "cep_marker.header.stamp = now()", "type": "assigned_variable", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L175_C4", "vector": [14, 2, 0.4455, 0.0024, 2, 0.0, 0.4, 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_99320:Expr_L185_C8", "label": "publish()", "type": "expression", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L175_C4", "vector": [8, 2, 0.4479, 0.0024, 2, 0.0, 0.5, 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_99320:Assign_L187_C8", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L175_C4", "vector": [14, 2, 0.4528, 0.0024, 2, 0.0, 0.6, 516, 3, 0, 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()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L188_C8", "label": "ee, r = FK()", "type": "assigned_variable", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L175_C4", "vector": [14, 2, 0.4552, 0.0024, 2, 0.0, 0.7, 624, 3, 1, 0, 0, 252, 10, 1], "semantic": {"name": "ee, r", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " ee, r = self.kinematics.FK(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L189_C8", "label": "ee_marker = single_marker()", "type": "assigned_variable", "loc": [189, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L175_C4", "vector": [14, 2, 0.4613, 0.0097, 2, 0.0, 0.8, 569, 3, 8, 0, 0, 614, 10, 1], "semantic": {"name": "ee_marker", "arg_names": [], "import_names": [], "rhs_call_name": "single_marker", "annotation": ""}, "snippet": " ee_marker = hv.single_marker(ee, o, 'sphere',\n '/torso_lift_link', color=(0., 1., 0., 1.),\n scale = (0.02, 0.02, 0.02), duration=0.,\n m_id=2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L193_C8", "label": "ee_marker.header.stamp = now()", "type": "assigned_variable", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L175_C4", "vector": [14, 2, 0.4673, 0.0024, 2, 0.0, 0.9, 843, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "ee_marker.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " ee_marker.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L194_C8", "label": "publish()", "type": "expression", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L175_C4", "vector": [8, 2, 0.4697, 0.0024, 2, 0.0, 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(ee_marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L197_C4", "label": "get_wrist_force", "type": "function", "loc": [197, 215], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "vector": [2, 1, 0.4988, 0.046, 1, 0.71, 0.4783, 854, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "get_wrist_force", "arg_names": ["self", "bias", "base_frame", "filtered"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_wrist_force(self, bias=True, base_frame=True,\n filtered = True):\n with self.lock:\n if filtered:\n f = copy.copy(self.ft_val)\n else:\n f = copy.copy(self.raw_force)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L200_C12", "label": "if", "type": "if", "loc": [200, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L197_C4", "vector": [4, 2, 0.4879, 0.0097, 2, 0.65, 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.ft_val)\n else:\n f = copy.copy(self.raw_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L201_C16", "label": "f = copy()", "type": "assigned_variable", "loc": [201, 201], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L200_C12", "vector": [14, 3, 0.4867, 0.0024, 3, 0.35, 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.ft_val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L203_C16", "label": "f = copy()", "type": "assigned_variable", "loc": [203, 203], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L200_C12", "vector": [14, 3, 0.4915, 0.0024, 3, 0.35, 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.raw_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L205_C8", "label": "f_mat =", "type": "assigned_variable", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L197_C4", "vector": [14, 2, 0.4964, 0.0024, 2, 0.65, 0.0, 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_99320:Assign_L206_C8", "label": "f_mat =", "type": "assigned_variable", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L197_C4", "vector": [14, 2, 0.4988, 0.0024, 2, 0.65, 0.25, 37, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_mat = f_mat[0:3,:] # ignoring the torques."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L208_C8", "label": "if", "type": "if", "loc": [208, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L197_C4", "vector": [4, 2, 0.5048, 0.0048, 2, 0.65, 0.5, 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['force'] #Tiffany added an 's' to 'ft'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L209_C12", "label": "f_mat =", "type": "assigned_variable", "loc": [209, 209], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L208_C8", "vector": [14, 3, 0.5061, 0.0024, 3, 0.65, 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['force'] #Tiffany added an 's' to 'ft'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L211_C8", "label": "if", "type": "if", "loc": [211, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L197_C4", "vector": [4, 2, 0.5145, 0.0097, 2, 0.65, 0.75, 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()\n rot = self.kinematics.FK(q)[1]\n f_mat = rot*f_mat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L212_C12", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [212, 212], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L211_C8", "vector": [14, 3, 0.5133, 0.0024, 3, 0.45, 0.0, 516, 3, 0, 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()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L213_C12", "label": "rot =", "type": "assigned_variable", "loc": [213, 213], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L211_C8", "vector": [14, 3, 0.5157, 0.0024, 3, 0.45, 0.5, 812, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot = self.kinematics.FK(q)[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L214_C12", "label": "f_mat =", "type": "assigned_variable", "loc": [214, 214], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L211_C8", "vector": [14, 3, 0.5182, 0.0024, 3, 0.45, 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_99320:Return_L215_C8", "label": "return", "type": "return", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L197_C4", "vector": [13, 2, 0.5206, 0.0024, 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 f_mat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L217_C4", "label": "bias_wrist_ft", "type": "function", "loc": [217, 231], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "vector": [2, 1, 0.5424, 0.0363, 1, 0.71, 0.5217, 604, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "bias_wrist_ft", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def bias_wrist_ft(self):\n f_list = []\n t_list = []\n rospy.loginfo('Starting biasing...')\n for i in range(20):\n f_list.append(self.get_wrist_force(bias=False,\n base_frame=False))\n rospy.sleep(0.02)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L218_C8", "label": "f_list =", "type": "assigned_variable", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L217_C4", "vector": [14, 2, 0.5278, 0.0024, 2, 0.84, 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_99320:Assign_L219_C8", "label": "t_list =", "type": "assigned_variable", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L217_C4", "vector": [14, 2, 0.5303, 0.0024, 2, 0.84, 0.125, 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_99320:Expr_L220_C8", "label": "loginfo()", "type": "expression", "loc": [220, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L217_C4", "vector": [8, 2, 0.5327, 0.0024, 2, 0.84, 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('Starting biasing...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:For_L221_C8", "label": "for i", "type": "for", "loc": [221, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L217_C4", "vector": [6, 2, 0.5387, 0.0097, 2, 0.84, 0.375, 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(bias=False,\n base_frame=False))\n rospy.sleep(0.02)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L222_C12", "label": "append()", "type": "expression", "loc": [222, 223], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:For_L221_C8", "vector": [8, 3, 0.5387, 0.0048, 3, 0.02, 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(bias=False,\n base_frame=False))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L224_C12", "label": "sleep()", "type": "expression", "loc": [224, 224], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:For_L221_C8", "vector": [8, 3, 0.5424, 0.0024, 3, 0.02, 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_99320:Assign_L226_C8", "label": "f_b = mean()", "type": "assigned_variable", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L217_C4", "vector": [14, 2, 0.5472, 0.0024, 2, 0.84, 0.5, 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_99320:Assign_L228_C8", "label": "t_b = get_wrist_torque()", "type": "assigned_variable", "loc": [228, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L217_C4", "vector": [14, 2, 0.5521, 0.0024, 2, 0.84, 0.625, 306, 3, 1, 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(bias=False) #Tiffany Nov 8 2011 removed 'arm' arg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L229_C8", "label": "assign", "type": "assigned_variable", "loc": [229, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L217_C4", "vector": [14, 2, 0.5545, 0.0024, 2, 0.84, 0.75, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.fts_bias['force'] = f_b"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L230_C8", "label": "assign", "type": "assigned_variable", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L217_C4", "vector": [14, 2, 0.5569, 0.0024, 2, 0.84, 0.875, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.fts_bias['torque'] = t_b "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L231_C8", "label": "loginfo()", "type": "expression", "loc": [231, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L217_C4", "vector": [8, 2, 0.5593, 0.0024, 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('...done')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L234_C4", "label": "get_impedance_scale", "type": "function", "loc": [234, 237], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "vector": [2, 1, 0.5702, 0.0097, 1, 0.71, 0.5652, 730, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_impedance_scale", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_impedance_scale(self):\n with self.lock:\n sc = copy.copy(self.alpha)\n return sc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L236_C12", "label": "sc = copy()", "type": "assigned_variable", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L234_C4", "vector": [14, 2, 0.5714, 0.0024, 2, 0.15, 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.alpha)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Return_L237_C8", "label": "return", "type": "return", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L234_C4", "vector": [13, 2, 0.5738, 0.0024, 2, 0.15, 0.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_99320:FunctionDef_L240_C4", "label": "set_impedance_scale", "type": "function", "loc": [240, 244], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "vector": [2, 1, 0.586, 0.0121, 1, 0.71, 0.6087, 430, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "set_impedance_scale", "arg_names": ["self", "s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_impedance_scale(self, s):\n time_stamp = rospy.Time.now()\n h = Header()\n h.stamp = time_stamp\n self.alph_cmd_pub.publish(FloatArray(h, s))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L241_C8", "label": "time_stamp = now()", "type": "assigned_variable", "loc": [241, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L240_C4", "vector": [14, 2, 0.5835, 0.0024, 2, 0.34, 0.0, 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_99320:Assign_L242_C8", "label": "h = Header()", "type": "assigned_variable", "loc": [242, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L240_C4", "vector": [14, 2, 0.586, 0.0024, 2, 0.34, 0.3333, 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_99320:Assign_L243_C8", "label": "h.stamp =", "type": "assigned_variable", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L240_C4", "vector": [14, 2, 0.5884, 0.0024, 2, 0.34, 0.6667, 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_99320:Expr_L244_C8", "label": "publish()", "type": "expression", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L240_C4", "vector": [8, 2, 0.5908, 0.0024, 2, 0.34, 1.0, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.alph_cmd_pub.publish(FloatArray(h, s))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L246_C4", "label": "set_ep_callback", "type": "function", "loc": [246, 248], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "vector": [2, 1, 0.5981, 0.0073, 1, 0.71, 0.6522, 14, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_ep_callback", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_ep_callback(self, msg):\n des_jep = msg.data \n self.set_ep(des_jep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L247_C8", "label": "des_jep =", "type": "assigned_variable", "loc": [247, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L246_C4", "vector": [14, 2, 0.5981, 0.0024, 2, 0.66, 0.0, 291, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "des_jep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " des_jep = msg.data "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L248_C8", "label": "set_ep()", "type": "expression", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L246_C4", "vector": [8, 2, 0.6005, 0.0024, 2, 0.66, 1.0, 547, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_ep", "arg_names": [], "import_names": [], "rhs_call_name": "set_ep", "annotation": ""}, "snippet": " self.set_ep(des_jep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L250_C4", "label": "set_delta_ep_callback", "type": "function", "loc": [250, 256], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "vector": [2, 1, 0.6126, 0.0169, 1, 0.71, 0.6957, 966, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "set_delta_ep_callback", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_delta_ep_callback(self, msg):\n delta_jep = msg.data\n if self.ep == None:\n self.ep = self.get_joint_angles()\n des_jep = (np.array(self.ep) + np.array(delta_jep)).tolist()\n \n self.set_ep(des_jep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L251_C8", "label": "delta_jep =", "type": "assigned_variable", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L250_C4", "vector": [14, 2, 0.6077, 0.0024, 2, 0.43, 0.0, 602, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "delta_jep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " delta_jep = msg.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L252_C8", "label": "if", "type": "if", "loc": [252, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L250_C4", "vector": [4, 2, 0.6114, 0.0048, 2, 0.43, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.ep == None:\n self.ep = self.get_joint_angles()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L253_C12", "label": "self.ep = get_joint_angles()", "type": "assigned_variable", "loc": [253, 253], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L252_C8", "vector": [14, 3, 0.6126, 0.0024, 3, 0.96, 0.0, 381, 3, 0, 0, 0, 820, 10, 1], "semantic": {"name": "self.ep", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " self.ep = self.get_joint_angles()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L254_C8", "label": "des_jep = tolist()", "type": "assigned_variable", "loc": [254, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L250_C4", "vector": [14, 2, 0.615, 0.0024, 2, 0.43, 0.6667, 291, 3, 0, 0, 0, 185, 10, 3], "semantic": {"name": "des_jep", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " des_jep = (np.array(self.ep) + np.array(delta_jep)).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L256_C8", "label": "set_ep()", "type": "expression", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L250_C4", "vector": [8, 2, 0.6199, 0.0024, 2, 0.43, 1.0, 547, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_ep", "arg_names": [], "import_names": [], "rhs_call_name": "set_ep", "annotation": ""}, "snippet": " self.set_ep(des_jep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L259_C4", "label": "set_ep", "type": "function", "loc": [259, 264], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "vector": [2, 1, 0.6332, 0.0145, 1, 0.71, 0.7391, 547, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "set_ep", "arg_names": ["self", "jep", "duration"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_ep(self, jep, duration=None):\n time_stamp = rospy.Time.now()\n h = Header()\n h.stamp = time_stamp\n self.jep_cmd_pub.publish(FloatArray(h, jep))\n self.publish_rviz_markers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L260_C8", "label": "time_stamp = now()", "type": "assigned_variable", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L259_C4", "vector": [14, 2, 0.6295, 0.0024, 2, 0.53, 0.0, 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_99320:Assign_L261_C8", "label": "h = Header()", "type": "assigned_variable", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L259_C4", "vector": [14, 2, 0.632, 0.0024, 2, 0.53, 0.25, 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_99320:Assign_L262_C8", "label": "h.stamp =", "type": "assigned_variable", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L259_C4", "vector": [14, 2, 0.6344, 0.0024, 2, 0.53, 0.5, 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_99320:Expr_L263_C8", "label": "publish()", "type": "expression", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L259_C4", "vector": [8, 2, 0.6368, 0.0024, 2, 0.53, 0.75, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.jep_cmd_pub.publish(FloatArray(h, jep))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L264_C8", "label": "publish_rviz_markers()", "type": "expression", "loc": [264, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L259_C4", "vector": [8, 2, 0.6392, 0.0024, 2, 0.53, 1.0, 62, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "publish_rviz_markers", "arg_names": [], "import_names": [], "rhs_call_name": "publish_rviz_markers", "annotation": ""}, "snippet": " self.publish_rviz_markers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L266_C4", "label": "is_motor_power_on", "type": "function", "loc": [266, 267], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "vector": [2, 1, 0.6453, 0.0048, 1, 0.71, 0.7826, 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_99320:Return_L267_C8", "label": "return", "type": "return", "loc": [267, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L266_C4", "vector": [13, 2, 0.6465, 0.0024, 2, 0.19, 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_99320:FunctionDef_L269_C4", "label": "motors_off", "type": "function", "loc": [269, 270], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "vector": [2, 1, 0.6525, 0.0048, 1, 0.71, 0.8261, 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_99320:Expr_L270_C8", "label": "publish()", "type": "expression", "loc": [270, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L269_C4", "vector": [8, 2, 0.6538, 0.0024, 2, 0.01, 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_99320:FunctionDef_L277_C4", "label": "get_joint_accelerations", "type": "function", "loc": [277, 302], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "vector": [2, 1, 0.701, 0.063, 1, 0.71, 0.8696, 8, 0, 2, 1, 0, 0, 0, 12], "semantic": {"name": "get_joint_accelerations", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_joint_accelerations(self, arm):\n t_now = rospy.get_time()\n q = self.get_joint_angles()\n if arm == 'r':\n if self.q_r != None and self.q_rHOT != None and self.q_rHHOT != None and self.time_stamp != None:\n dt = t_now - self.time_stamp\n qddot_r = (-np.array(q) + 4*np.array(self.q_r) - 5*np.array(self.q_rHOT) + 2*np.array(self.q_rHHOT)) / (dt*dt)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L278_C8", "label": "t_now = get_time()", "type": "assigned_variable", "loc": [278, 278], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L277_C4", "vector": [14, 2, 0.6731, 0.0024, 2, 0.11, 0.0, 23, 3, 0, 0, 0, 164, 10, 1], "semantic": {"name": "t_now", "arg_names": [], "import_names": [], "rhs_call_name": "get_time", "annotation": ""}, "snippet": " t_now = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L279_C8", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [279, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L277_C4", "vector": [14, 2, 0.6755, 0.0024, 2, 0.11, 0.5, 516, 3, 0, 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()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L280_C8", "label": "if", "type": "if", "loc": [280, 302], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L277_C4", "vector": [4, 2, 0.7046, 0.0557, 2, 0.11, 1.0, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'r':\n if self.q_r != None and self.q_rHOT != None and self.q_rHHOT != None and self.time_stamp != None:\n dt = t_now - self.time_stamp\n qddot_r = (-np.array(q) + 4*np.array(self.q_r) - 5*np.array(self.q_rHOT) + 2*np.array(self.q_rHHOT)) / (dt*dt)\n else:\n qddot_r = np.zeros(7)\n self.q_rHHOT = self.q_rHOT\n self.q_rHOT = self.q_r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L281_C12", "label": "if", "type": "if", "loc": [281, 285], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L280_C8", "vector": [4, 3, 0.6852, 0.0121, 3, 0.23, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.q_r != None and self.q_rHOT != None and self.q_rHHOT != None and self.time_stamp != None:\n dt = t_now - self.time_stamp\n qddot_r = (-np.array(q) + 4*np.array(self.q_r) - 5*np.array(self.q_rHOT) + 2*np.array(self.q_rHHOT)) / (dt*dt)\n else:\n qddot_r = np.zeros(7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L282_C16", "label": "dt =", "type": "assigned_variable", "loc": [282, 282], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L281_C12", "vector": [14, 4, 0.6828, 0.0024, 4, 0.12, 0.0, 455, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dt = t_now - self.time_stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L283_C16", "label": "qddot_r =", "type": "assigned_variable", "loc": [283, 283], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L281_C12", "vector": [14, 4, 0.6852, 0.0024, 4, 0.12, 0.5, 627, 4, 0, 0, 0, 0, 0, 4], "semantic": {"name": "qddot_r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qddot_r = (-np.array(q) + 4*np.array(self.q_r) - 5*np.array(self.q_rHOT) + 2*np.array(self.q_rHHOT)) / (dt*dt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L285_C16", "label": "qddot_r = zeros()", "type": "assigned_variable", "loc": [285, 285], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L281_C12", "vector": [14, 4, 0.6901, 0.0024, 4, 0.12, 1.0, 627, 3, 1, 0, 0, 213, 10, 1], "semantic": {"name": "qddot_r", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " qddot_r = np.zeros(7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L286_C12", "label": "self.q_rHHOT =", "type": "assigned_variable", "loc": [286, 286], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L280_C8", "vector": [14, 3, 0.6925, 0.0024, 3, 0.23, 0.1667, 744, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.q_rHHOT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_rHHOT = self.q_rHOT"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L287_C12", "label": "self.q_rHOT =", "type": "assigned_variable", "loc": [287, 287], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L280_C8", "vector": [14, 3, 0.6949, 0.0024, 3, 0.23, 0.3333, 355, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.q_rHOT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_rHOT = self.q_r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L288_C12", "label": "self.q_r =", "type": "assigned_variable", "loc": [288, 288], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L280_C8", "vector": [14, 3, 0.6973, 0.0024, 3, 0.23, 0.5, 707, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.q_r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_r = q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L289_C12", "label": "self.time_stamp =", "type": "assigned_variable", "loc": [289, 289], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L280_C8", "vector": [14, 3, 0.6998, 0.0024, 3, 0.23, 0.6667, 520, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.time_stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.time_stamp = t_now"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Return_L290_C12", "label": "return", "type": "return", "loc": [290, 290], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L280_C8", "vector": [13, 3, 0.7022, 0.0024, 3, 0.23, 0.8333, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return qddot_r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L292_C8", "label": "if", "type": "if", "loc": [292, 302], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L280_C8", "vector": [4, 3, 0.7191, 0.0266, 3, 0.23, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif arm == 'l':\n if self.q_l != None and self.q_lHOT != None and self.q_lHHOT != None and self.time_stamp != None:\n dt = t_now - self.time_stamp\n qddot_l = (-np.array(q) + 4*np.array(self.q_l) - 5*np.array(self.q_lHOT) + 2*np.array(self.q_lHHOT)) / (dt*dt)\n else:\n qddot_l = np.zeros(7)\n self.q_lHHOT = self.q_lHOT\n self.q_lHOT = self.q_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L293_C12", "label": "if", "type": "if", "loc": [293, 297], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L292_C8", "vector": [4, 4, 0.7143, 0.0121, 4, 0.5, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.q_l != None and self.q_lHOT != None and self.q_lHHOT != None and self.time_stamp != None:\n dt = t_now - self.time_stamp\n qddot_l = (-np.array(q) + 4*np.array(self.q_l) - 5*np.array(self.q_lHOT) + 2*np.array(self.q_lHHOT)) / (dt*dt)\n else:\n qddot_l = np.zeros(7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L294_C16", "label": "dt =", "type": "assigned_variable", "loc": [294, 294], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L293_C12", "vector": [14, 5, 0.7119, 0.0024, 5, 0.7, 0.0, 455, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dt = t_now - self.time_stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L295_C16", "label": "qddot_l =", "type": "assigned_variable", "loc": [295, 295], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L293_C12", "vector": [14, 5, 0.7143, 0.0024, 5, 0.7, 0.5, 845, 4, 0, 0, 0, 0, 0, 4], "semantic": {"name": "qddot_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qddot_l = (-np.array(q) + 4*np.array(self.q_l) - 5*np.array(self.q_lHOT) + 2*np.array(self.q_lHHOT)) / (dt*dt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L297_C16", "label": "qddot_l = zeros()", "type": "assigned_variable", "loc": [297, 297], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L293_C12", "vector": [14, 5, 0.7191, 0.0024, 5, 0.7, 1.0, 845, 3, 1, 0, 0, 213, 10, 1], "semantic": {"name": "qddot_l", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " qddot_l = np.zeros(7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L298_C12", "label": "self.q_lHHOT =", "type": "assigned_variable", "loc": [298, 298], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L292_C8", "vector": [14, 4, 0.7215, 0.0024, 4, 0.5, 0.2, 164, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.q_lHHOT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_lHHOT = self.q_lHOT"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L299_C12", "label": "self.q_lHOT =", "type": "assigned_variable", "loc": [299, 299], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L292_C8", "vector": [14, 4, 0.724, 0.0024, 4, 0.5, 0.4, 934, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.q_lHOT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_lHOT = self.q_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L300_C12", "label": "self.q_l =", "type": "assigned_variable", "loc": [300, 300], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L292_C8", "vector": [14, 4, 0.7264, 0.0024, 4, 0.5, 0.6, 651, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.q_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_l = q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L301_C12", "label": "self.time_stamp =", "type": "assigned_variable", "loc": [301, 301], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L292_C8", "vector": [14, 4, 0.7288, 0.0024, 4, 0.5, 0.8, 520, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.time_stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.time_stamp = t_now"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Return_L302_C12", "label": "return", "type": "return", "loc": [302, 302], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L292_C8", "vector": [13, 4, 0.7312, 0.0024, 4, 0.5, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return qddot_l "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L305_C4", "label": "get_joint_torques", "type": "function", "loc": [305, 306], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "vector": [2, 1, 0.7397, 0.0048, 1, 0.71, 0.913, 216, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_joint_torques", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_joint_torques(self):\n return self.torque"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Return_L306_C8", "label": "return", "type": "return", "loc": [306, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L305_C4", "vector": [13, 2, 0.7409, 0.0024, 2, 0.95, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.torque"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L310_C4", "label": "get_joint_motor_temps", "type": "function", "loc": [310, 311], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "vector": [2, 1, 0.7518, 0.0048, 1, 0.71, 0.9565, 30, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_joint_motor_temps", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_joint_motor_temps(self):\n return self.motor_temps"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Return_L311_C8", "label": "return", "type": "return", "loc": [311, 311], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L310_C4", "vector": [13, 2, 0.753, 0.0024, 2, 0.68, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.motor_temps"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L314_C4", "label": "get_wrist_torque", "type": "function", "loc": [314, 315], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "vector": [2, 1, 0.7615, 0.0048, 1, 0.71, 1.0, 476, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "get_wrist_torque", "arg_names": ["self", "bias"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_wrist_torque(self, bias=True): #Tiffany Nov 8 2011 removed 'arm' arg\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L325_C0", "label": "CodyArmClient_7DOF", "type": "class", "loc": [325, 336], "level": 0, "parent": null, "vector": [3, 0, 0.8002, 0.0291, 0, 0.66, 0.8824, 836, 0, 2, 0, 0, 48, 0, 4], "semantic": {"name": "CodyArmClient_7DOF", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CodyArmClient_7DOF(CodyArmClient):\n def __init__(self, arm):\n CodyArmClient.__init__(self, arm)\n\n # dummy kp values for the wrist, kd still of length five\n def get_joint_impedance(self):\n with self.lock:\n kp_t = [k for k in self.kp]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L326_C4", "label": "__init__", "type": "function", "loc": [326, 327], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L325_C0", "vector": [2, 1, 0.7906, 0.0048, 1, 0.96, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arm):\n CodyArmClient.__init__(self, arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L327_C8", "label": "__init__()", "type": "expression", "loc": [327, 327], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L326_C4", "vector": [8, 2, 0.7918, 0.0024, 2, 0.96, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " CodyArmClient.__init__(self, arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L330_C4", "label": "get_joint_impedance", "type": "function", "loc": [330, 336], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L325_C0", "vector": [2, 1, 0.8063, 0.0169, 1, 0.96, 1.0, 822, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "get_joint_impedance", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_joint_impedance(self):\n with self.lock:\n kp_t = [k for k in self.kp]\n kp_t[-1] = 30.\n kp_t.append(30.)\n kp_t.append(30.)\n return kp_t, copy.copy(self.kd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L332_C12", "label": "kp_t =", "type": "assigned_variable", "loc": [332, 332], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L330_C4", "vector": [14, 2, 0.8039, 0.0024, 2, 0.37, 0.0, 568, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "kp_t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kp_t = [k for k in self.kp]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L333_C12", "label": "assign", "type": "assigned_variable", "loc": [333, 333], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L330_C4", "vector": [14, 2, 0.8063, 0.0024, 2, 0.37, 0.25, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kp_t[-1] = 30."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L334_C12", "label": "append()", "type": "expression", "loc": [334, 334], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L330_C4", "vector": [8, 2, 0.8087, 0.0024, 2, 0.37, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " kp_t.append(30.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L335_C12", "label": "append()", "type": "expression", "loc": [335, 335], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L330_C4", "vector": [8, 2, 0.8111, 0.0024, 2, 0.37, 0.75, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " kp_t.append(30.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Return_L336_C12", "label": "return", "type": "return", "loc": [336, 336], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L330_C4", "vector": [13, 2, 0.8136, 0.0024, 2, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return kp_t, copy.copy(self.kd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L338_C0", "label": "CodyArmClient_5DOF", "type": "class", "loc": [338, 344], "level": 0, "parent": null, "vector": [3, 0, 0.8257, 0.0169, 0, 0.66, 0.9412, 984, 0, 2, 0, 0, 48, 0, 3], "semantic": {"name": "CodyArmClient_5DOF", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CodyArmClient_5DOF(CodyArmClient):\n def __init__(self, arm):\n CodyArmClient.__init__(self, arm)\n\n def get_joint_impedance(self):\n with self.lock:\n return copy.copy(self.kp[0:5]), copy.copy(self.kd[0:5])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L339_C4", "label": "__init__", "type": "function", "loc": [339, 340], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L338_C0", "vector": [2, 1, 0.822, 0.0048, 1, 0.2, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arm):\n CodyArmClient.__init__(self, arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L340_C8", "label": "__init__()", "type": "expression", "loc": [340, 340], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L339_C4", "vector": [8, 2, 0.8232, 0.0024, 2, 0.62, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " CodyArmClient.__init__(self, arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L342_C4", "label": "get_joint_impedance", "type": "function", "loc": [342, 344], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L338_C0", "vector": [2, 1, 0.8305, 0.0073, 1, 0.2, 1.0, 822, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "get_joint_impedance", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_joint_impedance(self):\n with self.lock:\n return copy.copy(self.kp[0:5]), copy.copy(self.kd[0:5])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Return_L344_C12", "label": "return", "type": "return", "loc": [344, 344], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L342_C4", "vector": [13, 2, 0.8329, 0.0024, 2, 0.04, 0.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return copy.copy(self.kp[0:5]), copy.copy(self.kd[0:5])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "label": "if", "type": "if", "loc": [348, 406], "level": 0, "parent": null, "vector": [4, 0, 0.9128, 0.1429, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 35], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import m3.toolbox as m3t\n import hrl_lib.transforms as tr\n import optparse\n\n p = optparse.OptionParser()\n p.add_option('--arm_to_use', action='store', dest='arm',\n type='string', help='which arm to use (l or r)',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Import_L349_C4", "label": "m3.toolbox import m3t", "type": "import", "loc": [349, 349], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "vector": [1, 1, 0.845, 0.0024, 1, 0.04, 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_99320:Import_L350_C4", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [350, 350], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "vector": [1, 1, 0.8475, 0.0024, 1, 0.04, 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_99320:Import_L351_C4", "label": "optparse import optparse", "type": "import", "loc": [351, 351], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "vector": [1, 1, 0.8499, 0.0024, 1, 0.04, 0.1667, 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_99320:Assign_L353_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [353, 353], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "vector": [14, 1, 0.8547, 0.0024, 1, 0.04, 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_99320:Expr_L354_C4", "label": "add_option()", "type": "expression", "loc": [354, 356], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "vector": [8, 1, 0.8596, 0.0073, 1, 0.04, 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": " p.add_option('--arm_to_use', action='store', dest='arm',\n type='string', help='which arm to use (l or r)',\n default=None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L357_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [357, 357], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "vector": [14, 1, 0.8644, 0.0024, 1, 0.04, 0.4167, 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_99320:If_L359_C4", "label": "if", "type": "if", "loc": [359, 362], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "vector": [4, 1, 0.8729, 0.0097, 1, 0.04, 0.5, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.arm == None:\n print('Please specify an arm_to_use')\n print('Exiting...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L360_C8", "label": "print()", "type": "expression", "loc": [360, 360], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L359_C4", "vector": [8, 2, 0.8717, 0.0024, 2, 0.1, 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 an arm_to_use')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L361_C8", "label": "print()", "type": "expression", "loc": [361, 361], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L359_C4", "vector": [8, 2, 0.8741, 0.0024, 2, 0.1, 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_99320:Expr_L362_C8", "label": "exit()", "type": "expression", "loc": [362, 362], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L359_C4", "vector": [8, 2, 0.8765, 0.0024, 2, 0.1, 1.0, 436, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L364_C4", "label": "ac = CodyArmClient()", "type": "assigned_variable", "loc": [364, 364], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "vector": [14, 1, 0.8814, 0.0024, 1, 0.04, 0.5833, 651, 3, 1, 0, 0, 48, 10, 1], "semantic": {"name": "ac", "arg_names": [], "import_names": [], "rhs_call_name": "CodyArmClient", "annotation": ""}, "snippet": " ac = CodyArmClient(opt.arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L367_C4", "label": "if", "type": "if", "loc": [367, 372], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "vector": [4, 1, 0.8947, 0.0145, 1, 0.04, 0.6667, 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()\n while not rospy.is_shutdown():\n f = ac.get_wrist_force()\n print('f:', f.A1)\n rospy.sleep(0.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L368_C8", "label": "bias_wrist_ft()", "type": "expression", "loc": [368, 368], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L367_C4", "vector": [8, 2, 0.891, 0.0024, 2, 0.63, 0.0, 604, 3, 0, 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()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L369_C8", "label": "while", "type": "while", "loc": [369, 372], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L367_C4", "vector": [5, 2, 0.8971, 0.0097, 2, 0.63, 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()\n print('f:', f.A1)\n rospy.sleep(0.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L370_C12", "label": "f = get_wrist_force()", "type": "assigned_variable", "loc": [370, 370], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L369_C8", "vector": [14, 3, 0.8959, 0.0024, 3, 0.68, 0.0, 899, 3, 0, 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()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L371_C12", "label": "print()", "type": "expression", "loc": [371, 371], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L369_C8", "vector": [8, 3, 0.8983, 0.0024, 3, 0.68, 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_99320:Expr_L372_C12", "label": "sleep()", "type": "expression", "loc": [372, 372], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L369_C8", "vector": [8, 3, 0.9007, 0.0024, 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.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L375_C4", "label": "if", "type": "if", "loc": [375, 381], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "vector": [4, 1, 0.9153, 0.0169, 1, 0.04, 0.75, 0, 1, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n while not rospy.is_shutdown():\n #jep = ac.get_ep()\n #print 'jep:', jep\n q = ac.get_joint_angles()\n print('q:', np.degrees(q).tolist()[1])\n rospy.sleep(0.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L376_C8", "label": "while", "type": "while", "loc": [376, 381], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L375_C4", "vector": [5, 2, 0.9165, 0.0145, 2, 0.53, 0.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 #jep = ac.get_ep()\n #print 'jep:', jep\n q = ac.get_joint_angles()\n print('q:', np.degrees(q).tolist()[1])\n rospy.sleep(0.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L379_C12", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [379, 379], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L376_C8", "vector": [14, 3, 0.9177, 0.0024, 3, 0.96, 0.0, 516, 3, 0, 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()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L380_C12", "label": "print()", "type": "expression", "loc": [380, 380], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L376_C8", "vector": [8, 3, 0.9201, 0.0024, 3, 0.96, 0.5, 535, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('q:', np.degrees(q).tolist()[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L381_C12", "label": "sleep()", "type": "expression", "loc": [381, 381], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L376_C8", "vector": [8, 3, 0.9225, 0.0024, 3, 0.96, 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_99320:If_L384_C4", "label": "if", "type": "if", "loc": [384, 388], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "vector": [4, 1, 0.9346, 0.0121, 1, 0.04, 0.8333, 0, 1, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n ac.kinematics.set_tooltip(np.matrix([0.,0.,-0.04]).T) # stub with mini45\n while not rospy.is_shutdown():\n ac.publish_rviz_markers()\n rospy.sleep(0.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L385_C8", "label": "set_tooltip()", "type": "expression", "loc": [385, 385], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L384_C4", "vector": [8, 2, 0.9322, 0.0024, 2, 0.31, 0.0, 350, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_tooltip", "arg_names": [], "import_names": [], "rhs_call_name": "set_tooltip", "annotation": ""}, "snippet": " ac.kinematics.set_tooltip(np.matrix([0.,0.,-0.04]).T) # stub with mini45"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L386_C8", "label": "while", "type": "while", "loc": [386, 388], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L384_C4", "vector": [5, 2, 0.937, 0.0073, 2, 0.31, 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 ac.publish_rviz_markers()\n rospy.sleep(0.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L387_C12", "label": "publish_rviz_markers()", "type": "expression", "loc": [387, 387], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L386_C8", "vector": [8, 3, 0.937, 0.0024, 3, 0.93, 0.0, 62, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "publish_rviz_markers", "arg_names": [], "import_names": [], "rhs_call_name": "publish_rviz_markers", "annotation": ""}, "snippet": " ac.publish_rviz_markers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L388_C12", "label": "sleep()", "type": "expression", "loc": [388, 388], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L386_C8", "vector": [8, 3, 0.9395, 0.0024, 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(0.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L391_C4", "label": "if", "type": "if", "loc": [391, 395], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "vector": [4, 1, 0.9516, 0.0121, 1, 0.04, 0.9167, 0, 1, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n while not rospy.is_shutdown():\n qdot = ac.get_joint_velocities()\n print('qdot:', np.degrees(qdot))\n rospy.sleep(0.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L392_C8", "label": "while", "type": "while", "loc": [392, 395], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L391_C4", "vector": [5, 2, 0.9528, 0.0097, 2, 0.19, 0.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 qdot = ac.get_joint_velocities()\n print('qdot:', np.degrees(qdot))\n rospy.sleep(0.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L393_C12", "label": "qdot = get_joint_velocities()", "type": "assigned_variable", "loc": [393, 393], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L392_C8", "vector": [14, 3, 0.9516, 0.0024, 3, 0.91, 0.0, 0, 3, 0, 0, 0, 27, 10, 1], "semantic": {"name": "qdot", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_velocities", "annotation": ""}, "snippet": " qdot = ac.get_joint_velocities()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L394_C12", "label": "print()", "type": "expression", "loc": [394, 394], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L392_C8", "vector": [8, 3, 0.954, 0.0024, 3, 0.91, 0.5, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('qdot:', np.degrees(qdot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L395_C12", "label": "sleep()", "type": "expression", "loc": [395, 395], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L392_C8", "vector": [8, 3, 0.9564, 0.0024, 3, 0.91, 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_99320:If_L398_C4", "label": "if", "type": "if", "loc": [398, 406], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "vector": [4, 1, 0.9734, 0.0218, 1, 0.04, 1.0, 0, 1, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n rospy.sleep(1.)\n isc = ac.get_impedance_scale()\n print(isc)\n isc[1] = 0.3\n ac.set_impedance_scale(isc)\n rospy.sleep(1.)\n isc = ac.get_impedance_scale()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L399_C8", "label": "sleep()", "type": "expression", "loc": [399, 399], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L398_C4", "vector": [8, 2, 0.9661, 0.0024, 2, 0.51, 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_99320:Assign_L400_C8", "label": "isc = get_impedance_scale()", "type": "assigned_variable", "loc": [400, 400], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L398_C4", "vector": [14, 2, 0.9685, 0.0024, 2, 0.51, 0.1429, 519, 3, 0, 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()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L401_C8", "label": "print()", "type": "expression", "loc": [401, 401], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L398_C4", "vector": [8, 2, 0.9709, 0.0024, 2, 0.51, 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_99320:Assign_L402_C8", "label": "assign", "type": "assigned_variable", "loc": [402, 402], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L398_C4", "vector": [14, 2, 0.9734, 0.0024, 2, 0.51, 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_99320:Expr_L403_C8", "label": "set_impedance_scale()", "type": "expression", "loc": [403, 403], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L398_C4", "vector": [8, 2, 0.9758, 0.0024, 2, 0.51, 0.5714, 430, 3, 1, 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(isc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L404_C8", "label": "sleep()", "type": "expression", "loc": [404, 404], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L398_C4", "vector": [8, 2, 0.9782, 0.0024, 2, 0.51, 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_99320:Assign_L405_C8", "label": "isc = get_impedance_scale()", "type": "assigned_variable", "loc": [405, 405], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L398_C4", "vector": [14, 2, 0.9806, 0.0024, 2, 0.51, 0.8571, 519, 3, 0, 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()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L406_C8", "label": "print()", "type": "expression", "loc": [406, 406], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L398_C4", "vector": [8, 2, 0.9831, 0.0024, 2, 0.51, 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_99320:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Return_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Return_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Try_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:Try_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L141_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L145_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L146_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L151_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L155_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L157_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L159_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L163_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L167_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L171_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L197_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L197_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L200_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L200_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L201_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L200_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L203_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L197_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L197_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L197_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L208_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L209_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L197_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L211_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L212_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L211_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L213_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L211_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L214_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L197_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Return_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L217_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:For_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:For_L221_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L222_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:For_L221_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L224_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L229_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L234_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L234_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L236_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L234_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Return_L237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L240_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L246_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L246_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L247_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L246_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L250_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L250_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L250_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L252_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L253_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L250_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L254_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L250_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L259_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L259_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L259_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L259_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L259_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L259_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L266_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L266_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Return_L267_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L269_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L269_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L270_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L277_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L277_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L277_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L279_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L277_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L280_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L280_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L281_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L281_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L282_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L281_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L283_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L281_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L285_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L280_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L286_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L280_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L287_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L280_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L288_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L280_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L289_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L280_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Return_L290_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L280_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L292_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L292_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L293_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L293_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L294_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L293_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L295_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L293_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L297_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L292_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L298_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L292_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L299_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L292_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L300_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L292_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L301_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L292_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Return_L302_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L305_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L305_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Return_L306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L310_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Return_L311_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L314_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L325_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L326_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L326_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L327_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L325_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L330_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L330_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L332_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L330_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L333_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L330_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L334_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L330_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L335_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L330_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Return_L336_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L339_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L339_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L340_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:ClassDef_L338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L342_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:FunctionDef_L342_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Return_L344_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Import_L349_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Import_L350_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Import_L351_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L353_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L354_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L357_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L359_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L359_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L360_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L359_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L361_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L359_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L362_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L364_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L367_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L367_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L368_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L367_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L369_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L369_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L370_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L369_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L371_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L369_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L372_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L375_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L375_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L376_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L376_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L379_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L376_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L380_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L376_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L381_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L384_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L384_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L385_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L384_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L386_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L386_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L387_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L386_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L388_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L391_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L391_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L392_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L392_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L393_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L392_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L394_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:While_L392_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L395_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L348_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L398_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L398_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L399_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L398_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L400_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L398_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L401_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L398_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L402_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L398_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L403_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L398_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L404_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L398_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Assign_L405_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99320:If_L398_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99320:Expr_L406_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 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_99321
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_99321: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_99321: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_99321: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_99321: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_99321: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_99321:Expr_L46_C4", "label": "expression", "type": "expression", "loc": [46, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L45_C0", "vector": [8, 1, 0.2031, 0.0087, 1, 0.84, 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_99321:Expr_L48_C4", "label": "createTorsoTransform()", "type": "expression", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L45_C0", "vector": [8, 1, 0.2096, 0.0044, 1, 0.84, 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_99321:Expr_L49_C4", "label": "createThok0Transform()", "type": "expression", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L45_C0", "vector": [8, 1, 0.214, 0.0044, 1, 0.84, 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_99321:Expr_L50_C4", "label": "createUtm0Transform()", "type": "expression", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L45_C0", "vector": [8, 1, 0.2183, 0.0044, 1, 0.84, 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_99321:Expr_L51_C4", "label": "createMecanumTransform()", "type": "expression", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L45_C0", "vector": [8, 1, 0.2227, 0.0044, 1, 0.84, 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_99321: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_99321:Expr_L54_C4", "label": "expression", "type": "expression", "loc": [54, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L53_C0", "vector": [8, 1, 0.238, 0.0087, 1, 0.73, 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_99321:Assign_L56_C4", "label": "disp =", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L53_C0", "vector": [14, 1, 0.2445, 0.0044, 1, 0.73, 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_99321:Assign_L57_C4", "label": "rot = matrix()", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L53_C0", "vector": [14, 1, 0.2489, 0.0044, 1, 0.73, 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_99321:Assign_L58_C4", "label": "t = composeHomogeneousTransform()", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L53_C0", "vector": [14, 1, 0.2533, 0.0044, 1, 0.73, 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_99321:Assign_L59_C4", "label": "assign", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L53_C0", "vector": [14, 1, 0.2576, 0.0044, 1, 0.73, 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_99321: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_99321:Expr_L62_C4", "label": "expression", "type": "expression", "loc": [62, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L61_C0", "vector": [8, 1, 0.2729, 0.0087, 1, 0.73, 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_99321:Assign_L64_C4", "label": "disp =", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L61_C0", "vector": [14, 1, 0.2795, 0.0044, 1, 0.73, 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_99321:Assign_L65_C4", "label": "rot = matrix()", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L61_C0", "vector": [14, 1, 0.2838, 0.0044, 1, 0.73, 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_99321:Assign_L66_C4", "label": "t = composeHomogeneousTransform()", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L61_C0", "vector": [14, 1, 0.2882, 0.0044, 1, 0.73, 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_99321:Assign_L67_C4", "label": "assign", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L61_C0", "vector": [14, 1, 0.2926, 0.0044, 1, 0.73, 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_99321: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_99321:Expr_L70_C4", "label": "expression", "type": "expression", "loc": [70, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L69_C0", "vector": [8, 1, 0.3079, 0.0087, 1, 0.4, 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_99321:Assign_L72_C4", "label": "disp = copy()", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L69_C0", "vector": [14, 1, 0.3144, 0.0044, 1, 0.4, 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_99321:Assign_L74_C4", "label": "rot = matrix()", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L69_C0", "vector": [14, 1, 0.3231, 0.0044, 1, 0.4, 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_99321:Assign_L75_C4", "label": "t = composeHomogeneousTransform()", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L69_C0", "vector": [14, 1, 0.3275, 0.0044, 1, 0.4, 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_99321:Assign_L76_C4", "label": "assign", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L69_C0", "vector": [14, 1, 0.3319, 0.0044, 1, 0.4, 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_99321: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_99321:Expr_L79_C4", "label": "expression", "type": "expression", "loc": [79, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L78_C0", "vector": [8, 1, 0.3472, 0.0087, 1, 0.81, 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_99321:Assign_L81_C4", "label": "disp =", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L78_C0", "vector": [14, 1, 0.3537, 0.0044, 1, 0.81, 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_99321:Assign_L82_C4", "label": "rot = matrix()", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L78_C0", "vector": [14, 1, 0.3581, 0.0044, 1, 0.81, 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_99321:Assign_L83_C4", "label": "t = composeHomogeneousTransform()", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L78_C0", "vector": [14, 1, 0.3624, 0.0044, 1, 0.81, 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_99321:Assign_L84_C4", "label": "assign", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L78_C0", "vector": [14, 1, 0.3668, 0.0044, 1, 0.81, 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_99321: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_99321: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_99321:Expr_L90_C4", "label": "expression", "type": "expression", "loc": [90, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L89_C0", "vector": [8, 1, 0.3952, 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": " ''' 3x1 vector from mecanum to global.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L92_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L89_C0", "vector": [14, 1, 0.4017, 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_99321:Assign_L93_C4", "label": "p_gl =", "type": "assigned_variable", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L89_C0", "vector": [14, 1, 0.4061, 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['mecanum'] * p_hom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L94_C4", "label": "if", "type": "if", "loc": [94, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L89_C0", "vector": [4, 1, 0.417, 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_99321:Return_L95_C8", "label": "return", "type": "return", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L94_C4", "vector": [13, 2, 0.4148, 0.0044, 2, 0.58, 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_99321:Return_L97_C8", "label": "return", "type": "return", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L94_C4", "vector": [13, 2, 0.4236, 0.0044, 2, 0.58, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99321: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_99321:Expr_L100_C4", "label": "expression", "type": "expression", "loc": [100, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L99_C0", "vector": [8, 1, 0.4389, 0.0087, 1, 0.98, 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_99321:Assign_L102_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L99_C0", "vector": [14, 1, 0.4454, 0.0044, 1, 0.98, 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_99321:Assign_L103_C4", "label": "p_gl =", "type": "assigned_variable", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L99_C0", "vector": [14, 1, 0.4498, 0.0044, 1, 0.98, 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_99321:If_L104_C4", "label": "if", "type": "if", "loc": [104, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L99_C0", "vector": [4, 1, 0.4607, 0.0175, 1, 0.98, 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_99321:Return_L105_C8", "label": "return", "type": "return", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L104_C4", "vector": [13, 2, 0.4585, 0.0044, 2, 0.25, 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_99321:Return_L107_C8", "label": "return", "type": "return", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L104_C4", "vector": [13, 2, 0.4672, 0.0044, 2, 0.25, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99321: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_99321:Expr_L110_C4", "label": "expression", "type": "expression", "loc": [110, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L109_C0", "vector": [8, 1, 0.4825, 0.0087, 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 torso to global.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L112_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [112, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L109_C0", "vector": [14, 1, 0.4891, 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_99321:Assign_L113_C4", "label": "p_gl =", "type": "assigned_variable", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L109_C0", "vector": [14, 1, 0.4934, 0.0044, 1, 0.91, 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_99321:If_L114_C4", "label": "if", "type": "if", "loc": [114, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L109_C0", "vector": [4, 1, 0.5044, 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_99321:Return_L115_C8", "label": "return", "type": "return", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L114_C4", "vector": [13, 2, 0.5022, 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_99321:Return_L117_C8", "label": "return", "type": "return", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L114_C4", "vector": [13, 2, 0.5109, 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_99321: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_99321:Expr_L120_C4", "label": "expression", "type": "expression", "loc": [120, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L119_C0", "vector": [8, 1, 0.5262, 0.0087, 1, 0.6, 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_99321:Assign_L122_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L119_C0", "vector": [14, 1, 0.5328, 0.0044, 1, 0.6, 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_99321:Assign_L123_C4", "label": "p_gl =", "type": "assigned_variable", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L119_C0", "vector": [14, 1, 0.5371, 0.0044, 1, 0.6, 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_99321:If_L124_C4", "label": "if", "type": "if", "loc": [124, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L119_C0", "vector": [4, 1, 0.548, 0.0175, 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 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_99321:Return_L125_C8", "label": "return", "type": "return", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L124_C4", "vector": [13, 2, 0.5459, 0.0044, 2, 0.56, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]/p_gl[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99321:Return_L127_C8", "label": "return", "type": "return", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L124_C4", "vector": [13, 2, 0.5546, 0.0044, 2, 0.56, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99321: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_99321:Expr_L130_C4", "label": "expression", "type": "expression", "loc": [130, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L129_C0", "vector": [8, 1, 0.5699, 0.0087, 1, 0.42, 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_99321:Assign_L132_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [132, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L129_C0", "vector": [14, 1, 0.5764, 0.0044, 1, 0.42, 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_99321:Assign_L133_C4", "label": "p_gl =", "type": "assigned_variable", "loc": [133, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L129_C0", "vector": [14, 1, 0.5808, 0.0044, 1, 0.42, 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_99321:If_L134_C4", "label": "if", "type": "if", "loc": [134, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L129_C0", "vector": [4, 1, 0.5917, 0.0175, 1, 0.42, 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_99321:Return_L135_C8", "label": "return", "type": "return", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L134_C4", "vector": [13, 2, 0.5895, 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_99321:Return_L137_C8", "label": "return", "type": "return", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L134_C4", "vector": [13, 2, 0.5983, 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_99321: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_99321:Expr_L140_C4", "label": "expression", "type": "expression", "loc": [140, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L139_C0", "vector": [8, 1, 0.6135, 0.0087, 1, 0.72, 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_99321:Assign_L142_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [142, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L139_C0", "vector": [14, 1, 0.6201, 0.0044, 1, 0.72, 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_99321:Assign_L143_C4", "label": "p_gl =", "type": "assigned_variable", "loc": [143, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L139_C0", "vector": [14, 1, 0.6245, 0.0044, 1, 0.72, 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_99321:If_L144_C4", "label": "if", "type": "if", "loc": [144, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L139_C0", "vector": [4, 1, 0.6354, 0.0175, 1, 0.72, 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_99321:Return_L145_C8", "label": "return", "type": "return", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L144_C4", "vector": [13, 2, 0.6332, 0.0044, 2, 0.47, 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_99321:Return_L147_C8", "label": "return", "type": "return", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L144_C4", "vector": [13, 2, 0.6419, 0.0044, 2, 0.47, 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_99321: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_99321:Expr_L150_C4", "label": "expression", "type": "expression", "loc": [150, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L149_C0", "vector": [8, 1, 0.6572, 0.0087, 1, 0.59, 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_99321:Assign_L152_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [152, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L149_C0", "vector": [14, 1, 0.6638, 0.0044, 1, 0.59, 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_99321:Assign_L153_C4", "label": "p_gl =", "type": "assigned_variable", "loc": [153, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L149_C0", "vector": [14, 1, 0.6681, 0.0044, 1, 0.59, 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_99321:If_L154_C4", "label": "if", "type": "if", "loc": [154, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L149_C0", "vector": [4, 1, 0.679, 0.0175, 1, 0.59, 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_99321:Return_L155_C8", "label": "return", "type": "return", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L154_C4", "vector": [13, 2, 0.6769, 0.0044, 2, 0.1, 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_99321:Return_L157_C8", "label": "return", "type": "return", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L154_C4", "vector": [13, 2, 0.6856, 0.0044, 2, 0.1, 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_99321: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_99321:Expr_L160_C4", "label": "expression", "type": "expression", "loc": [160, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L159_C0", "vector": [8, 1, 0.7009, 0.0087, 1, 0.75, 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_99321:Assign_L162_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [162, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L159_C0", "vector": [14, 1, 0.7074, 0.0044, 1, 0.75, 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_99321:Assign_L163_C4", "label": "p_gl =", "type": "assigned_variable", "loc": [163, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L159_C0", "vector": [14, 1, 0.7118, 0.0044, 1, 0.75, 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_99321:If_L164_C4", "label": "if", "type": "if", "loc": [164, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L159_C0", "vector": [4, 1, 0.7227, 0.0175, 1, 0.75, 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_99321:Return_L165_C8", "label": "return", "type": "return", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L164_C4", "vector": [13, 2, 0.7205, 0.0044, 2, 0.94, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_gl[0:3]/p_gl[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99321:Return_L167_C8", "label": "return", "type": "return", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L164_C4", "vector": [13, 2, 0.7293, 0.0044, 2, 0.94, 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_99321: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_99321:Assign_L173_C4", "label": "thok0Tglobal_mat = invertHomogeneousTransform()", "type": "assigned_variable", "loc": [173, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "vector": [14, 1, 0.7555, 0.0044, 1, 0.86, 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_99321:Assign_L175_C4", "label": "disp =", "type": "assigned_variable", "loc": [175, 175], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "vector": [14, 1, 0.7642, 0.0044, 1, 0.86, 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_99321:Assign_L176_C4", "label": "tmat =", "type": "assigned_variable", "loc": [176, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "vector": [14, 1, 0.7686, 0.0044, 1, 0.86, 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_99321:Assign_L179_C4", "label": "x =", "type": "assigned_variable", "loc": [179, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "vector": [14, 1, 0.7817, 0.0044, 1, 0.86, 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_99321:Assign_L180_C4", "label": "y =", "type": "assigned_variable", "loc": [180, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "vector": [14, 1, 0.786, 0.0044, 1, 0.86, 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_99321:Assign_L181_C4", "label": "z =", "type": "assigned_variable", "loc": [181, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "vector": [14, 1, 0.7904, 0.0044, 1, 0.86, 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_99321:Assign_L182_C4", "label": "r1 =", "type": "assigned_variable", "loc": [182, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "vector": [14, 1, 0.7948, 0.0044, 1, 0.86, 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_99321:Assign_L183_C4", "label": "r2 =", "type": "assigned_variable", "loc": [183, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "vector": [14, 1, 0.7991, 0.0044, 1, 0.86, 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_99321:Assign_L184_C4", "label": "r3 =", "type": "assigned_variable", "loc": [184, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "vector": [14, 1, 0.8035, 0.0044, 1, 0.86, 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_99321:Assign_L185_C4", "label": "disp =", "type": "assigned_variable", "loc": [185, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "vector": [14, 1, 0.8079, 0.0044, 1, 0.86, 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_99321:Assign_L186_C4", "label": "r =", "type": "assigned_variable", "loc": [186, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "vector": [14, 1, 0.8122, 0.0044, 1, 0.86, 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_99321:Assign_L187_C4", "label": "disp =", "type": "assigned_variable", "loc": [187, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "vector": [14, 1, 0.8166, 0.0044, 1, 0.86, 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_99321:Assign_L188_C4", "label": "r =", "type": "assigned_variable", "loc": [188, 188], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "vector": [14, 1, 0.821, 0.0044, 1, 0.86, 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_99321:Assign_L189_C4", "label": "r =", "type": "assigned_variable", "loc": [189, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "vector": [14, 1, 0.8253, 0.0044, 1, 0.86, 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_99321:Assign_L190_C4", "label": "r =", "type": "assigned_variable", "loc": [190, 190], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "vector": [14, 1, 0.8297, 0.0044, 1, 0.86, 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_99321:Assign_L192_C4", "label": "t = composeHomogeneousTransform()", "type": "assigned_variable", "loc": [192, 192], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "vector": [14, 1, 0.8384, 0.0044, 1, 0.86, 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_99321:Assign_L193_C4", "label": "tmat =", "type": "assigned_variable", "loc": [193, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "vector": [14, 1, 0.8428, 0.0044, 1, 0.86, 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_99321:Return_L194_C4", "label": "return", "type": "return", "loc": [194, 194], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "vector": [13, 1, 0.8472, 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": " return tmat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99321: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_99321:Assign_L202_C4", "label": "t = utmcam0Tglobal_mat()", "type": "assigned_variable", "loc": [202, 202], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L201_C0", "vector": [14, 1, 0.8821, 0.0044, 1, 0.7, 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_99321:Assign_L203_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [203, 203], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L201_C0", "vector": [14, 1, 0.8865, 0.0044, 1, 0.7, 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_99321:Assign_L204_C4", "label": "p_c =", "type": "assigned_variable", "loc": [204, 204], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L201_C0", "vector": [14, 1, 0.8908, 0.0044, 1, 0.7, 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_99321:If_L205_C4", "label": "if", "type": "if", "loc": [205, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L201_C0", "vector": [4, 1, 0.9017, 0.0175, 1, 0.7, 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_99321:Assign_L206_C8", "label": "pt =", "type": "assigned_variable", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L205_C4", "vector": [14, 2, 0.8996, 0.0044, 2, 0.92, 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_99321:Assign_L208_C8", "label": "pt =", "type": "assigned_variable", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L205_C4", "vector": [14, 2, 0.9083, 0.0044, 2, 0.92, 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_99321:Return_L210_C4", "label": "return", "type": "return", "loc": [210, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L201_C0", "vector": [13, 1, 0.917, 0.0044, 1, 0.7, 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_99321: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_99321:Assign_L218_C4", "label": "t = utmcam0Tglobal_mat()", "type": "assigned_variable", "loc": [218, 218], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L217_C0", "vector": [14, 1, 0.952, 0.0044, 1, 0.25, 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_99321:Assign_L219_C4", "label": "t = invertHomogeneousTransform()", "type": "assigned_variable", "loc": [219, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L217_C0", "vector": [14, 1, 0.9563, 0.0044, 1, 0.25, 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_99321:Assign_L220_C4", "label": "p_hom = xyzToHomogenous()", "type": "assigned_variable", "loc": [220, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L217_C0", "vector": [14, 1, 0.9607, 0.0044, 1, 0.25, 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_99321:Assign_L221_C4", "label": "p_c =", "type": "assigned_variable", "loc": [221, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L217_C0", "vector": [14, 1, 0.9651, 0.0044, 1, 0.25, 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_99321:If_L222_C4", "label": "if", "type": "if", "loc": [222, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L217_C0", "vector": [4, 1, 0.976, 0.0175, 1, 0.25, 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_99321:Assign_L223_C8", "label": "pt =", "type": "assigned_variable", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L222_C4", "vector": [14, 2, 0.9738, 0.0044, 2, 0.75, 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_99321:Assign_L225_C8", "label": "pt =", "type": "assigned_variable", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L222_C4", "vector": [14, 2, 0.9825, 0.0044, 2, 0.75, 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_99321:Return_L227_C4", "label": "return", "type": "return", "loc": [227, 227], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L217_C0", "vector": [13, 1, 0.9913, 0.0044, 1, 0.25, 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_99321:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Expr_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Expr_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Expr_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Expr_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Expr_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Expr_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Expr_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Expr_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Expr_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Return_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Return_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Expr_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Return_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Return_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Expr_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Return_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Return_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Expr_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Return_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Return_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Expr_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Return_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Return_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Expr_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Return_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Return_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Expr_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Return_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Return_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L159_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Expr_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L159_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L159_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L159_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Return_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Return_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L186_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L190_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L192_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L193_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Return_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L202_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L203_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L204_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Return_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L218_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L219_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L220_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L222_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L222_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:If_L222_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Assign_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99321:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99321:Return_L227_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 math, numpy as np import arm_client as ac import arms as ar import roslib; roslib.load_manifest('hrl_cody_arms') import rospy import tf.broadcaster as tfb import hrl_lib.transforms as tr from hrl_msgs.msg import FloatArray from std_msgs.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_99322
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_99322: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_99322: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_99322: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_99322: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('hrl_cody_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99322: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('hrl_cody_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99322: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_99322: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_99322: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_99322: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_99322:ImportFrom_L42_C0", "label": "from std_msgs.msg import Header", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.2295, 0.0055, 0, 0.66, 0.6923, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Header"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Header"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99322: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_99322: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_99322:Assign_L46_C4", "label": "marker = Marker()", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.2514, 0.0055, 1, 0.24, 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_99322: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_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.2568, 0.0055, 1, 0.24, 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_99322:Assign_L48_C4", "label": "marker.header.stamp =", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.2623, 0.0055, 1, 0.24, 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_99322:Assign_L49_C4", "label": "marker.ns =", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.2678, 0.0055, 1, 0.24, 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_99322:Assign_L50_C4", "label": "marker.type =", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.2732, 0.0055, 1, 0.24, 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_99322:Assign_L51_C4", "label": "marker.action =", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.2787, 0.0055, 1, 0.24, 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_99322:Assign_L52_C4", "label": "marker.pose.position.x =", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.2842, 0.0055, 1, 0.24, 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_99322:Assign_L53_C4", "label": "marker.pose.position.y =", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.2896, 0.0055, 1, 0.24, 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_99322:Assign_L54_C4", "label": "marker.pose.position.z =", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.2951, 0.0055, 1, 0.24, 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_99322:Assign_L55_C4", "label": "marker.scale.x =", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.3005, 0.0055, 1, 0.24, 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_99322:Assign_L56_C4", "label": "marker.scale.y =", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.306, 0.0055, 1, 0.24, 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_99322:Assign_L57_C4", "label": "marker.scale.z =", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.3115, 0.0055, 1, 0.24, 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_99322:Assign_L58_C4", "label": "marker.lifetime = Duration()", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.3169, 0.0055, 1, 0.24, 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_99322:Assign_L60_C4", "label": "marker.id =", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.3279, 0.0055, 1, 0.24, 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_99322:Assign_L62_C4", "label": "rot1 =", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.3388, 0.0055, 1, 0.24, 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_99322:Assign_L63_C4", "label": "quat = matrix_to_quaternion()", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.3443, 0.0055, 1, 0.24, 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_99322:Assign_L64_C4", "label": "marker.pose.orientation.x =", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.3497, 0.0055, 1, 0.24, 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_99322:Assign_L65_C4", "label": "marker.pose.orientation.y =", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.3552, 0.0055, 1, 0.24, 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_99322:Assign_L66_C4", "label": "marker.pose.orientation.z =", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.3607, 0.0055, 1, 0.24, 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_99322:Assign_L67_C4", "label": "marker.pose.orientation.w =", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.3661, 0.0055, 1, 0.24, 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_99322:Assign_L69_C4", "label": "marker.color.r =", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.377, 0.0055, 1, 0.24, 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_99322:Assign_L70_C4", "label": "marker.color.g =", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.3825, 0.0055, 1, 0.24, 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_99322:Assign_L71_C4", "label": "marker.color.b =", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.388, 0.0055, 1, 0.24, 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_99322:Assign_L72_C4", "label": "marker.color.a =", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.3934, 0.0055, 1, 0.24, 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_99322:Expr_L73_C4", "label": "publish()", "type": "expression", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [8, 1, 0.3989, 0.0055, 1, 0.24, 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_99322:Assign_L75_C4", "label": "marker.id =", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.4098, 0.0055, 1, 0.24, 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_99322:If_L76_C4", "label": "if", "type": "if", "loc": [76, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [4, 1, 0.429, 0.0328, 1, 0.24, 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_99322:Assign_L78_C8", "label": "rot2 =", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L76_C4", "vector": [14, 2, 0.4262, 0.0055, 2, 0.04, 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_99322:Assign_L81_C8", "label": "rot2 =", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L76_C4", "vector": [14, 2, 0.4426, 0.0055, 2, 0.04, 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_99322:Assign_L83_C4", "label": "quat = matrix_to_quaternion()", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.4536, 0.0055, 1, 0.24, 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_99322:Assign_L84_C4", "label": "marker.pose.orientation.x =", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.459, 0.0055, 1, 0.24, 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_99322:Assign_L85_C4", "label": "marker.pose.orientation.y =", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.4645, 0.0055, 1, 0.24, 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_99322:Assign_L86_C4", "label": "marker.pose.orientation.z =", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.4699, 0.0055, 1, 0.24, 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_99322:Assign_L87_C4", "label": "marker.pose.orientation.w =", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.4754, 0.0055, 1, 0.24, 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_99322:Assign_L89_C4", "label": "marker.color.r =", "type": "assigned_variable", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.4863, 0.0055, 1, 0.24, 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_99322:Assign_L90_C4", "label": "marker.color.g =", "type": "assigned_variable", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.4918, 0.0055, 1, 0.24, 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_99322:Assign_L91_C4", "label": "marker.color.b =", "type": "assigned_variable", "loc": [91, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.4973, 0.0055, 1, 0.24, 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_99322:Assign_L92_C4", "label": "marker.color.a =", "type": "assigned_variable", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [14, 1, 0.5027, 0.0055, 1, 0.24, 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_99322:Expr_L93_C4", "label": "publish()", "type": "expression", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "vector": [8, 1, 0.5082, 0.0055, 1, 0.24, 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_99322: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_99322:Assign_L98_C4", "label": "marker = Marker()", "type": "assigned_variable", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "vector": [14, 1, 0.5355, 0.0055, 1, 0.06, 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_99322:Assign_L99_C4", "label": "marker.header.frame_id =", "type": "assigned_variable", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "vector": [14, 1, 0.541, 0.0055, 1, 0.06, 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_99322:Assign_L100_C4", "label": "marker.header.stamp =", "type": "assigned_variable", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "vector": [14, 1, 0.5464, 0.0055, 1, 0.06, 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_99322:Assign_L101_C4", "label": "marker.ns =", "type": "assigned_variable", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "vector": [14, 1, 0.5519, 0.0055, 1, 0.06, 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_99322:Assign_L102_C4", "label": "marker.type =", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "vector": [14, 1, 0.5574, 0.0055, 1, 0.06, 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_99322:Assign_L103_C4", "label": "marker.action =", "type": "assigned_variable", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "vector": [14, 1, 0.5628, 0.0055, 1, 0.06, 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_99322:Assign_L104_C4", "label": "marker.pose.position.x =", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "vector": [14, 1, 0.5683, 0.0055, 1, 0.06, 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_99322:Assign_L105_C4", "label": "marker.pose.position.y =", "type": "assigned_variable", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "vector": [14, 1, 0.5738, 0.0055, 1, 0.06, 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_99322:Assign_L106_C4", "label": "marker.pose.position.z =", "type": "assigned_variable", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "vector": [14, 1, 0.5792, 0.0055, 1, 0.06, 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_99322:Assign_L107_C4", "label": "marker.scale.x =", "type": "assigned_variable", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "vector": [14, 1, 0.5847, 0.0055, 1, 0.06, 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_99322:Assign_L108_C4", "label": "marker.scale.y =", "type": "assigned_variable", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "vector": [14, 1, 0.5902, 0.0055, 1, 0.06, 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_99322:Assign_L109_C4", "label": "marker.scale.z =", "type": "assigned_variable", "loc": [109, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "vector": [14, 1, 0.5956, 0.0055, 1, 0.06, 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_99322:Assign_L110_C4", "label": "marker.lifetime = Duration()", "type": "assigned_variable", "loc": [110, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "vector": [14, 1, 0.6011, 0.0055, 1, 0.06, 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_99322:Assign_L112_C4", "label": "marker.id =", "type": "assigned_variable", "loc": [112, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "vector": [14, 1, 0.612, 0.0055, 1, 0.06, 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_99322:Assign_L113_C4", "label": "marker.pose.orientation.x =", "type": "assigned_variable", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "vector": [14, 1, 0.6175, 0.0055, 1, 0.06, 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_99322:Assign_L114_C4", "label": "marker.pose.orientation.y =", "type": "assigned_variable", "loc": [114, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "vector": [14, 1, 0.623, 0.0055, 1, 0.06, 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_99322:Assign_L115_C4", "label": "marker.pose.orientation.z =", "type": "assigned_variable", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "vector": [14, 1, 0.6284, 0.0055, 1, 0.06, 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_99322:Assign_L116_C4", "label": "marker.pose.orientation.w =", "type": "assigned_variable", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "vector": [14, 1, 0.6339, 0.0055, 1, 0.06, 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_99322:Assign_L118_C4", "label": "marker.color.r =", "type": "assigned_variable", "loc": [118, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "vector": [14, 1, 0.6448, 0.0055, 1, 0.06, 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_99322:Assign_L119_C4", "label": "marker.color.g =", "type": "assigned_variable", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "vector": [14, 1, 0.6503, 0.0055, 1, 0.06, 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_99322:Assign_L120_C4", "label": "marker.color.b =", "type": "assigned_variable", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "vector": [14, 1, 0.6557, 0.0055, 1, 0.06, 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_99322:Assign_L121_C4", "label": "marker.color.a =", "type": "assigned_variable", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "vector": [14, 1, 0.6612, 0.0055, 1, 0.06, 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_99322:Expr_L122_C4", "label": "publish()", "type": "expression", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "vector": [8, 1, 0.6667, 0.0055, 1, 0.06, 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_99322: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_99322:Assign_L126_C4", "label": "arms = M3HrlRobot()", "type": "assigned_variable", "loc": [126, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "vector": [14, 1, 0.6885, 0.0055, 1, 0.99, 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_99322:Assign_L127_C4", "label": "arm_client = MekaArmClient()", "type": "assigned_variable", "loc": [127, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "vector": [14, 1, 0.694, 0.0055, 1, 0.99, 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_99322:Assign_L129_C4", "label": "force_r_pub = Publisher()", "type": "assigned_variable", "loc": [129, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "vector": [14, 1, 0.7049, 0.0055, 1, 0.99, 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_99322:Assign_L130_C4", "label": "force_l_pub = Publisher()", "type": "assigned_variable", "loc": [130, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "vector": [14, 1, 0.7104, 0.0055, 1, 0.99, 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_99322:Assign_L131_C4", "label": "marker_pub = Publisher()", "type": "assigned_variable", "loc": [131, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "vector": [14, 1, 0.7158, 0.0055, 1, 0.99, 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_99322:Expr_L133_C4", "label": "logout()", "type": "expression", "loc": [133, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "vector": [8, 1, 0.7268, 0.0055, 1, 0.99, 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_99322:Expr_L134_C4", "label": "sleep()", "type": "expression", "loc": [134, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "vector": [8, 1, 0.7322, 0.0055, 1, 0.99, 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_99322:Expr_L135_C4", "label": "logout()", "type": "expression", "loc": [135, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "vector": [8, 1, 0.7377, 0.0055, 1, 0.99, 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_99322:Assign_L137_C4", "label": "r_arm =", "type": "assigned_variable", "loc": [137, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "vector": [14, 1, 0.7486, 0.0055, 1, 0.99, 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_99322:Assign_L138_C4", "label": "l_arm =", "type": "assigned_variable", "loc": [138, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "vector": [14, 1, 0.7541, 0.0055, 1, 0.99, 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_99322:Assign_L140_C4", "label": "transform_bcast = TransformBroadcaster()", "type": "assigned_variable", "loc": [140, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "vector": [14, 1, 0.765, 0.0055, 1, 0.99, 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_99322: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_99322:If_L125_C0", "vector": [14, 1, 0.7705, 0.0055, 1, 0.99, 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_99322:While_L142_C4", "label": "while", "type": "while", "loc": [142, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "vector": [5, 1, 0.877, 0.2077, 1, 0.99, 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_99322:Expr_L143_C8", "label": "sleep()", "type": "expression", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:While_L142_C4", "vector": [8, 2, 0.7814, 0.0055, 2, 0.53, 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_99322: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_99322:While_L142_C4", "vector": [14, 2, 0.7869, 0.0055, 2, 0.53, 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_99322: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_99322:While_L142_C4", "vector": [14, 2, 0.7923, 0.0055, 2, 0.53, 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_99322:Assign_L146_C8", "label": "time_stamp = now()", "type": "assigned_variable", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:While_L142_C4", "vector": [14, 2, 0.7978, 0.0055, 2, 0.53, 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_99322:Assign_L147_C8", "label": "h = Header()", "type": "assigned_variable", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:While_L142_C4", "vector": [14, 2, 0.8033, 0.0055, 2, 0.53, 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_99322:Assign_L148_C8", "label": "h.stamp =", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:While_L142_C4", "vector": [14, 2, 0.8087, 0.0055, 2, 0.53, 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_99322:Expr_L149_C8", "label": "publish()", "type": "expression", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:While_L142_C4", "vector": [8, 2, 0.8142, 0.0055, 2, 0.53, 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_99322:Expr_L150_C8", "label": "publish()", "type": "expression", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:While_L142_C4", "vector": [8, 2, 0.8197, 0.0055, 2, 0.53, 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_99322:Expr_L152_C8", "label": "publish_sphere_marker()", "type": "expression", "loc": [152, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:While_L142_C4", "vector": [8, 2, 0.8333, 0.0109, 2, 0.53, 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_99322:For_L155_C8", "label": "for arm", "type": "for", "loc": [155, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:While_L142_C4", "vector": [6, 2, 0.9126, 0.1366, 2, 0.53, 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_99322:Assign_L156_C12", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [156, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "vector": [14, 3, 0.8525, 0.0055, 3, 0.93, 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_99322:Assign_L157_C12", "label": "links =", "type": "assigned_variable", "loc": [157, 157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "vector": [14, 3, 0.8579, 0.0055, 3, 0.93, 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_99322:For_L158_C12", "label": "for i", "type": "for", "loc": [158, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "vector": [6, 3, 0.8825, 0.0437, 3, 0.93, 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_99322:Assign_L159_C16", "label": "p, rot = FK_all()", "type": "assigned_variable", "loc": [159, 159], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L158_C12", "vector": [14, 4, 0.8689, 0.0055, 4, 0.79, 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_99322:Assign_L160_C16", "label": "qaut = matrix_to_quaternion()", "type": "assigned_variable", "loc": [160, 160], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L158_C12", "vector": [14, 4, 0.8743, 0.0055, 4, 0.79, 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_99322:Assign_L161_C16", "label": "frameid = link_tf_name()", "type": "assigned_variable", "loc": [161, 161], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L158_C12", "vector": [14, 4, 0.8798, 0.0055, 4, 0.79, 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_99322:Expr_L162_C16", "label": "sendTransform()", "type": "expression", "loc": [162, 163], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L158_C12", "vector": [8, 4, 0.888, 0.0109, 4, 0.79, 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_99322:Expr_L164_C16", "label": "publish_sphere_marker()", "type": "expression", "loc": [164, 165], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L158_C12", "vector": [8, 4, 0.8989, 0.0109, 4, 0.79, 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_99322:Assign_L167_C12", "label": "c1 =", "type": "assigned_variable", "loc": [167, 167], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "vector": [14, 3, 0.9126, 0.0055, 3, 0.93, 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_99322:Assign_L168_C12", "label": "c2 =", "type": "assigned_variable", "loc": [168, 168], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "vector": [14, 3, 0.918, 0.0055, 3, 0.93, 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_99322:Assign_L169_C12", "label": "p, rot = FK_all()", "type": "assigned_variable", "loc": [169, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "vector": [14, 3, 0.9235, 0.0055, 3, 0.93, 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_99322:Expr_L170_C12", "label": "publish_cartesian_markers()", "type": "expression", "loc": [170, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "vector": [8, 3, 0.9317, 0.0109, 3, 0.93, 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_99322:Assign_L173_C12", "label": "c1 =", "type": "assigned_variable", "loc": [173, 173], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "vector": [14, 3, 0.9454, 0.0055, 3, 0.93, 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_99322:Assign_L174_C12", "label": "c2 =", "type": "assigned_variable", "loc": [174, 174], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "vector": [14, 3, 0.9508, 0.0055, 3, 0.93, 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_99322:Assign_L175_C12", "label": "jep = get_jep()", "type": "assigned_variable", "loc": [175, 175], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "vector": [14, 3, 0.9563, 0.0055, 3, 0.93, 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_99322: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_99322:For_L155_C8", "vector": [14, 3, 0.9617, 0.0055, 3, 0.93, 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_99322:Assign_L177_C12", "label": "cep, rot = FK_all()", "type": "assigned_variable", "loc": [177, 177], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "vector": [14, 3, 0.9672, 0.0055, 3, 0.93, 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_99322:Expr_L178_C12", "label": "publish_cartesian_markers()", "type": "expression", "loc": [178, 179], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "vector": [8, 3, 0.9754, 0.0109, 3, 0.93, 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_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Expr_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Expr_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Expr_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Expr_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Expr_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Expr_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:If_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:While_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:While_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Expr_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:While_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:While_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:While_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:While_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:While_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:While_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Expr_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:While_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Expr_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:While_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Expr_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:While_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L157_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L158_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L158_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L159_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L158_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L160_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L158_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L161_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L158_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Expr_L162_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L158_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Expr_L164_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L167_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L168_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L169_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Expr_L170_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L173_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L174_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L175_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L176_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99322:Assign_L177_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99322:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99322: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('hrl_cody_arms') 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/hrl_arm_control/hrl_cody_arms/src/hrl_cody_arms/q_guess_left_dict.pkl' q_guess_pkl_r = os.environ['HOME']+'/svn/gt-ros-pkg/hrl/hrl_arm_control/hrl_cody_arms/src/hrl_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(self.n_joints): 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)) if __name__ == '__main__': import roslib; roslib.load_manifest('hrl_cody_arms') import hrl_cody_arms.cody_arm_kinematics as cak h = M3HrlRobot(0.16) k = cak.CodyArmKinematics('r') p = np.matrix([0., 0., -0.16]).T k.set_tooltip(p) J_old = h.Jacobian
ajibawa-2023/Python-Code-Large/train/row_99323
216
348
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99323:Import_L31_C0", "label": "math import math", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.0891, 0.0029, 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_99323:Import_L32_C0", "label": "numpy import np", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.092, 0.0029, 0, 0.66, 0.0769, 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_99323:Import_L33_C0", "label": "copy import copy", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.0948, 0.0029, 0, 0.66, 0.1538, 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_99323:Import_L34_C0", "label": "sys import sys, time, os", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0977, 0.0029, 0, 0.66, 0.2308, 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_99323:Import_L36_C0", "label": "PyKDL import kdl", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.1034, 0.0029, 0, 0.66, 0.3077, 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_99323:Import_L37_C0", "label": "create_IK_guess_dict import cgd", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.1063, 0.0029, 0, 0.66, 0.3846, 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_99323:Import_L39_C0", "label": "roslib import roslib", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.1121, 0.0029, 0, 0.66, 0.4615, 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_cody_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L39_C15", "label": "load_manifest()", "type": "expression", "loc": [39, 39], "level": 0, "parent": null, "vector": [8, 0, 0.1121, 0.0029, 0, 0.66, 0.5385, 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_cody_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:Import_L41_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.1178, 0.0029, 0, 0.66, 0.6154, 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_99323:Import_L42_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.1207, 0.0029, 0, 0.66, 0.6923, 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_99323:Import_L43_C0", "label": "hrl_lib.kdl_utils import ku", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.1236, 0.0029, 0, 0.66, 0.7692, 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_99323:FunctionDef_L46_C0", "label": "link_tf_name", "type": "function", "loc": [46, 58], "level": 0, "parent": null, "vector": [2, 0, 0.1494, 0.0374, 0, 0.66, 0.8462, 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_99323:If_L47_C4", "label": "if", "type": "if", "loc": [47, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L46_C0", "vector": [4, 1, 0.1394, 0.0115, 1, 0.62, 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_99323:Assign_L48_C8", "label": "nm =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L47_C4", "vector": [14, 2, 0.1379, 0.0029, 2, 0.79, 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_99323:Assign_L50_C8", "label": "nm =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L47_C4", "vector": [14, 2, 0.1437, 0.0029, 2, 0.79, 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_99323:If_L52_C4", "label": "if", "type": "if", "loc": [52, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L46_C0", "vector": [4, 1, 0.1566, 0.0172, 1, 0.62, 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_99323:Assign_L53_C8", "label": "nm =", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L52_C4", "vector": [14, 2, 0.1523, 0.0029, 2, 0.73, 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_99323:If_L54_C4", "label": "if", "type": "if", "loc": [54, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L52_C4", "vector": [4, 2, 0.1595, 0.0115, 2, 0.73, 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_99323:Assign_L55_C8", "label": "nm =", "type": "assigned_variable", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L54_C4", "vector": [14, 3, 0.158, 0.0029, 3, 0.07, 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_99323:Assign_L57_C8", "label": "nm =", "type": "assigned_variable", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L54_C4", "vector": [14, 3, 0.1638, 0.0029, 3, 0.07, 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_99323:Return_L58_C4", "label": "return", "type": "return", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L46_C0", "vector": [13, 1, 0.1667, 0.0029, 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 nm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "label": "M3HrlRobot", "type": "class", "loc": [61, 328], "level": 0, "parent": null, "vector": [3, 0, 0.5589, 0.7701, 0, 0.66, 0.9231, 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_99323:FunctionDef_L62_C4", "label": "__init__", "type": "function", "loc": [62, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "vector": [2, 1, 0.1997, 0.046, 1, 0.93, 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_99323:Assign_L64_C8", "label": "self.joint_lim_dict =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L62_C4", "vector": [14, 2, 0.1839, 0.0029, 2, 0.17, 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_99323:Assign_L65_C8", "label": "assign", "type": "assigned_variable", "loc": [65, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L62_C4", "vector": [14, 2, 0.1882, 0.0057, 2, 0.17, 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_99323:Assign_L68_C8", "label": "assign", "type": "assigned_variable", "loc": [68, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L62_C4", "vector": [14, 2, 0.1968, 0.0057, 2, 0.17, 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_99323:Expr_L72_C8", "label": "setup_kdl_mekabot()", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L62_C4", "vector": [8, 2, 0.2069, 0.0029, 2, 0.17, 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_99323:Assign_L73_C8", "label": "q_guess_pkl_l =", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L62_C4", "vector": [14, 2, 0.2098, 0.0029, 2, 0.17, 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/hrl_arm_control/hrl_cody_arms/src/hrl_cody_arms/q_guess_left_dict.pkl'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L74_C8", "label": "q_guess_pkl_r =", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L62_C4", "vector": [14, 2, 0.2126, 0.0029, 2, 0.17, 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/hrl_arm_control/hrl_cody_arms/src/hrl_cody_arms/q_guess_right_dict.pkl'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323: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_99323:FunctionDef_L62_C4", "vector": [14, 2, 0.2184, 0.0029, 2, 0.17, 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_99323: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_99323:FunctionDef_L62_C4", "vector": [14, 2, 0.2213, 0.0029, 2, 0.17, 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_99323:FunctionDef_L81_C4", "label": "kdl_angles_to_meka", "type": "function", "loc": [81, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "vector": [2, 1, 0.25, 0.0374, 1, 0.93, 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_99323:If_L82_C8", "label": "if", "type": "if", "loc": [82, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L81_C4", "vector": [4, 2, 0.2371, 0.0057, 2, 0.0, 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_99323:Return_L83_C12", "label": "return", "type": "return", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L82_C8", "vector": [13, 3, 0.2385, 0.0029, 3, 0.32, 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_99323:Assign_L85_C8", "label": "q_rad =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L81_C4", "vector": [14, 2, 0.2443, 0.0029, 2, 0.0, 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_99323:Assign_L86_C8", "label": "assign", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L81_C4", "vector": [14, 2, 0.2471, 0.0029, 2, 0.0, 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_99323:Assign_L87_C8", "label": "assign", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L81_C4", "vector": [14, 2, 0.25, 0.0029, 2, 0.0, 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_99323:Assign_L88_C8", "label": "assign", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L81_C4", "vector": [14, 2, 0.2529, 0.0029, 2, 0.0, 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_99323:Assign_L89_C8", "label": "assign", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L81_C4", "vector": [14, 2, 0.2557, 0.0029, 2, 0.0, 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_99323:Assign_L90_C8", "label": "assign", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L81_C4", "vector": [14, 2, 0.2586, 0.0029, 2, 0.0, 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_99323:Assign_L91_C8", "label": "assign", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L81_C4", "vector": [14, 2, 0.2615, 0.0029, 2, 0.0, 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_99323:Assign_L92_C8", "label": "assign", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L81_C4", "vector": [14, 2, 0.2644, 0.0029, 2, 0.0, 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_99323:Return_L93_C8", "label": "return", "type": "return", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L81_C4", "vector": [13, 2, 0.2672, 0.0029, 2, 0.0, 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_99323:FunctionDef_L97_C4", "label": "meka_angles_to_kdl", "type": "function", "loc": [97, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "vector": [2, 1, 0.3003, 0.046, 1, 0.93, 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_99323:If_L98_C8", "label": "if", "type": "if", "loc": [98, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L97_C4", "vector": [4, 2, 0.283, 0.0057, 2, 0.57, 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_99323:Return_L99_C12", "label": "return", "type": "return", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L98_C8", "vector": [13, 3, 0.2845, 0.0029, 3, 0.57, 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_99323:Assign_L101_C8", "label": "n_joints = len()", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L97_C4", "vector": [14, 2, 0.2902, 0.0029, 2, 0.57, 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_99323:Assign_L102_C8", "label": "q = JntArray()", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L97_C4", "vector": [14, 2, 0.2931, 0.0029, 2, 0.57, 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_99323:Assign_L103_C8", "label": "assign", "type": "assigned_variable", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L97_C4", "vector": [14, 2, 0.296, 0.0029, 2, 0.57, 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_99323:Assign_L104_C8", "label": "assign", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L97_C4", "vector": [14, 2, 0.2989, 0.0029, 2, 0.57, 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_99323:Assign_L105_C8", "label": "assign", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L97_C4", "vector": [14, 2, 0.3017, 0.0029, 2, 0.57, 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_99323:If_L106_C8", "label": "if", "type": "if", "loc": [106, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L97_C4", "vector": [4, 2, 0.306, 0.0057, 2, 0.57, 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_99323:Assign_L107_C12", "label": "assign", "type": "assigned_variable", "loc": [107, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L106_C8", "vector": [14, 3, 0.3075, 0.0029, 3, 0.09, 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_99323:If_L108_C8", "label": "if", "type": "if", "loc": [108, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L97_C4", "vector": [4, 2, 0.3147, 0.0115, 2, 0.57, 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_99323:Assign_L109_C12", "label": "assign", "type": "assigned_variable", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L108_C8", "vector": [14, 3, 0.3132, 0.0029, 3, 0.22, 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_99323:Assign_L110_C12", "label": "assign", "type": "assigned_variable", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L108_C8", "vector": [14, 3, 0.3161, 0.0029, 3, 0.22, 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_99323:Assign_L111_C12", "label": "assign", "type": "assigned_variable", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L108_C8", "vector": [14, 3, 0.319, 0.0029, 3, 0.22, 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_99323:Return_L112_C8", "label": "return", "type": "return", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L97_C4", "vector": [13, 2, 0.3218, 0.0029, 2, 0.57, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L114_C4", "label": "create_right_chain", "type": "function", "loc": [114, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "vector": [2, 1, 0.3405, 0.0287, 1, 0.93, 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_99323:Assign_L115_C8", "label": "ch = Chain()", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L114_C4", "vector": [14, 2, 0.3305, 0.0029, 2, 0.13, 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_99323:Expr_L116_C8", "label": "addSegment()", "type": "expression", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L114_C4", "vector": [8, 2, 0.3333, 0.0029, 2, 0.13, 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_99323:Expr_L117_C8", "label": "addSegment()", "type": "expression", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L114_C4", "vector": [8, 2, 0.3362, 0.0029, 2, 0.13, 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_99323:Expr_L118_C8", "label": "addSegment()", "type": "expression", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L114_C4", "vector": [8, 2, 0.3391, 0.0029, 2, 0.13, 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_99323:Expr_L119_C8", "label": "addSegment()", "type": "expression", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L114_C4", "vector": [8, 2, 0.342, 0.0029, 2, 0.13, 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_99323:Expr_L120_C8", "label": "addSegment()", "type": "expression", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L114_C4", "vector": [8, 2, 0.3448, 0.0029, 2, 0.13, 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_99323:Expr_L121_C8", "label": "addSegment()", "type": "expression", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L114_C4", "vector": [8, 2, 0.3477, 0.0029, 2, 0.13, 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_99323:Expr_L122_C8", "label": "addSegment()", "type": "expression", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L114_C4", "vector": [8, 2, 0.3506, 0.0029, 2, 0.13, 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_99323:Return_L123_C8", "label": "return", "type": "return", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L114_C4", "vector": [13, 2, 0.3534, 0.0029, 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 ch"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L125_C4", "label": "create_left_chain", "type": "function", "loc": [125, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "vector": [2, 1, 0.3721, 0.0287, 1, 0.93, 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_99323:Assign_L126_C8", "label": "ch = Chain()", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L125_C4", "vector": [14, 2, 0.3621, 0.0029, 2, 0.47, 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_99323:Expr_L127_C8", "label": "addSegment()", "type": "expression", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L125_C4", "vector": [8, 2, 0.3649, 0.0029, 2, 0.47, 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_99323:Expr_L128_C8", "label": "addSegment()", "type": "expression", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L125_C4", "vector": [8, 2, 0.3678, 0.0029, 2, 0.47, 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_99323:Expr_L129_C8", "label": "addSegment()", "type": "expression", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L125_C4", "vector": [8, 2, 0.3707, 0.0029, 2, 0.47, 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_99323:Expr_L130_C8", "label": "addSegment()", "type": "expression", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L125_C4", "vector": [8, 2, 0.3736, 0.0029, 2, 0.47, 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_99323:Expr_L131_C8", "label": "addSegment()", "type": "expression", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L125_C4", "vector": [8, 2, 0.3764, 0.0029, 2, 0.47, 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_99323:Expr_L132_C8", "label": "addSegment()", "type": "expression", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L125_C4", "vector": [8, 2, 0.3793, 0.0029, 2, 0.47, 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_99323:Expr_L133_C8", "label": "addSegment()", "type": "expression", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L125_C4", "vector": [8, 2, 0.3822, 0.0029, 2, 0.47, 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_99323:Return_L134_C8", "label": "return", "type": "return", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L125_C4", "vector": [13, 2, 0.3851, 0.0029, 2, 0.47, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ch"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L136_C4", "label": "create_solvers", "type": "function", "loc": [136, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "vector": [2, 1, 0.398, 0.0172, 1, 0.93, 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_99323:Assign_L137_C9", "label": "fk = ChainFkSolverPos_recursive()", "type": "assigned_variable", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L136_C4", "vector": [14, 2, 0.3937, 0.0029, 2, 0.84, 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_99323:Assign_L138_C9", "label": "ik_v = ChainIkSolverVel_pinv()", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L136_C4", "vector": [14, 2, 0.3966, 0.0029, 2, 0.84, 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_99323:Assign_L139_C9", "label": "ik_p = ChainIkSolverPos_NR()", "type": "assigned_variable", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L136_C4", "vector": [14, 2, 0.3994, 0.0029, 2, 0.84, 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_99323:Assign_L140_C9", "label": "jac = ChainJntToJacSolver()", "type": "assigned_variable", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L136_C4", "vector": [14, 2, 0.4023, 0.0029, 2, 0.84, 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_99323:Return_L141_C9", "label": "return", "type": "return", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L136_C4", "vector": [13, 2, 0.4052, 0.0029, 2, 0.84, 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_99323:FunctionDef_L143_C4", "label": "setup_kdl_mekabot", "type": "function", "loc": [143, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "vector": [2, 1, 0.4483, 0.0776, 1, 0.93, 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_99323:Assign_L145_C8", "label": "ch = create_right_chain()", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "vector": [14, 2, 0.4167, 0.0029, 2, 0.3, 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_99323: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_99323:FunctionDef_L143_C4", "vector": [14, 2, 0.4195, 0.0029, 2, 0.3, 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_99323:Assign_L148_C8", "label": "kdl_rightarm =", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "vector": [14, 2, 0.4253, 0.0029, 2, 0.3, 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_99323:Assign_L149_C8", "label": "assign", "type": "assigned_variable", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "vector": [14, 2, 0.4282, 0.0029, 2, 0.3, 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_99323:Assign_L150_C8", "label": " = getNrOfJoints()", "type": "assigned_variable", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "vector": [14, 2, 0.431, 0.0029, 2, 0.3, 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_99323:Assign_L151_C8", "label": "assign", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "vector": [14, 2, 0.4339, 0.0029, 2, 0.3, 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_99323:Assign_L152_C8", "label": "assign", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "vector": [14, 2, 0.4368, 0.0029, 2, 0.3, 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_99323:Assign_L153_C8", "label": "assign", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "vector": [14, 2, 0.4397, 0.0029, 2, 0.3, 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_99323:Assign_L154_C8", "label": "assign", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "vector": [14, 2, 0.4425, 0.0029, 2, 0.3, 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_99323:Assign_L157_C8", "label": "kdl_leftarm =", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "vector": [14, 2, 0.4511, 0.0029, 2, 0.3, 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_99323:Assign_L158_C8", "label": "ch = create_left_chain()", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "vector": [14, 2, 0.454, 0.0029, 2, 0.3, 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_99323: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_99323:FunctionDef_L143_C4", "vector": [14, 2, 0.4569, 0.0029, 2, 0.3, 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_99323:Assign_L161_C8", "label": "assign", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "vector": [14, 2, 0.4626, 0.0029, 2, 0.3, 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_99323:Assign_L162_C8", "label": " = getNrOfJoints()", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "vector": [14, 2, 0.4655, 0.0029, 2, 0.3, 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_99323:Assign_L163_C8", "label": "assign", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "vector": [14, 2, 0.4684, 0.0029, 2, 0.3, 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_99323:Assign_L164_C8", "label": "assign", "type": "assigned_variable", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "vector": [14, 2, 0.4713, 0.0029, 2, 0.3, 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_99323:Assign_L165_C8", "label": "assign", "type": "assigned_variable", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "vector": [14, 2, 0.4741, 0.0029, 2, 0.3, 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_99323:Assign_L166_C8", "label": "assign", "type": "assigned_variable", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "vector": [14, 2, 0.477, 0.0029, 2, 0.3, 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_99323:Assign_L169_C8", "label": "self.cody_kdl =", "type": "assigned_variable", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "vector": [14, 2, 0.4856, 0.0029, 2, 0.3, 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_99323:FunctionDef_L171_C4", "label": "FK_kdl", "type": "function", "loc": [171, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "vector": [2, 1, 0.5057, 0.0316, 1, 0.93, 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_99323:Assign_L172_C8", "label": "fk_solver =", "type": "assigned_variable", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L171_C4", "vector": [14, 2, 0.4943, 0.0029, 2, 0.03, 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_99323:Assign_L173_C8", "label": "endeffec_frame = Frame()", "type": "assigned_variable", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L171_C4", "vector": [14, 2, 0.4971, 0.0029, 2, 0.03, 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_99323:Assign_L174_C8", "label": "kinematics_status = JntToCart()", "type": "assigned_variable", "loc": [174, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L171_C4", "vector": [14, 2, 0.5014, 0.0057, 2, 0.03, 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_99323:If_L176_C8", "label": "if", "type": "if", "loc": [176, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L171_C4", "vector": [4, 2, 0.5129, 0.0172, 2, 0.03, 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_99323:Return_L178_C12", "label": "return", "type": "return", "loc": [178, 178], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L176_C8", "vector": [13, 3, 0.5115, 0.0029, 3, 0.71, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return endeffec_frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L180_C12", "label": "print()", "type": "expression", "loc": [180, 180], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L176_C8", "vector": [8, 3, 0.5172, 0.0029, 3, 0.71, 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_99323:Return_L181_C12", "label": "return", "type": "return", "loc": [181, 181], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L176_C8", "vector": [13, 3, 0.5201, 0.0029, 3, 0.71, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L183_C4", "label": "Jac_kdl", "type": "function", "loc": [183, 197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "vector": [2, 1, 0.546, 0.0431, 1, 0.93, 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_99323:Expr_L184_C8", "label": "expression", "type": "expression", "loc": [184, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L183_C4", "vector": [8, 2, 0.5302, 0.0057, 2, 0.06, 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_99323:Assign_L186_C8", "label": "J_kdl = Jacobian()", "type": "assigned_variable", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L183_C4", "vector": [14, 2, 0.5345, 0.0029, 2, 0.06, 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_99323:Expr_L187_C8", "label": "JntToJac()", "type": "expression", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L183_C4", "vector": [8, 2, 0.5374, 0.0029, 2, 0.06, 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_99323:Assign_L189_C8", "label": "kdl_jac = matrix()", "type": "assigned_variable", "loc": [189, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L183_C4", "vector": [14, 2, 0.5532, 0.023, 2, 0.06, 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_99323:Return_L197_C8", "label": "return", "type": "return", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L183_C4", "vector": [13, 2, 0.5661, 0.0029, 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 kdl_jac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L199_C4", "label": "IK_kdl", "type": "function", "loc": [199, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "vector": [2, 1, 0.6006, 0.0603, 1, 0.93, 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_99323:Expr_L200_C8", "label": "expression", "type": "expression", "loc": [200, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L199_C4", "vector": [8, 2, 0.579, 0.0115, 2, 0.57, 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_99323:Assign_L204_C8", "label": "nJnts =", "type": "assigned_variable", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L199_C4", "vector": [14, 2, 0.5862, 0.0029, 2, 0.57, 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_99323:Assign_L205_C8", "label": "ik_solver =", "type": "assigned_variable", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L199_C4", "vector": [14, 2, 0.5891, 0.0029, 2, 0.57, 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_99323:Assign_L206_C8", "label": "q = JntArray()", "type": "assigned_variable", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L199_C4", "vector": [14, 2, 0.592, 0.0029, 2, 0.57, 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_99323:If_L207_C8", "label": "if", "type": "if", "loc": [207, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L199_C4", "vector": [4, 2, 0.6121, 0.0374, 2, 0.57, 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_99323:For_L208_C12", "label": "for i", "type": "for", "loc": [208, 209], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L207_C8", "vector": [6, 3, 0.5991, 0.0057, 3, 0.64, 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_99323:Assign_L209_C16", "label": " = angle_within_mod180()", "type": "assigned_variable", "loc": [209, 209], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:For_L208_C12", "vector": [14, 4, 0.6006, 0.0029, 4, 0.13, 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_99323:Return_L210_C12", "label": "return", "type": "return", "loc": [210, 210], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L207_C8", "vector": [13, 3, 0.6034, 0.0029, 3, 0.64, 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_99323:If_L212_C12", "label": "if", "type": "if", "loc": [212, 217], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L207_C8", "vector": [4, 3, 0.6164, 0.0172, 3, 0.64, 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_99323:Assign_L213_C16", "label": "ik_solver =", "type": "assigned_variable", "loc": [213, 213], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L212_C12", "vector": [14, 4, 0.6121, 0.0029, 4, 0.2, 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_99323:If_L214_C16", "label": "if", "type": "if", "loc": [214, 217], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L212_C12", "vector": [4, 4, 0.6193, 0.0115, 4, 0.2, 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_99323:For_L215_C20", "label": "for i", "type": "for", "loc": [215, 216], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L214_C16", "vector": [6, 5, 0.6193, 0.0057, 5, 0.31, 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_99323:Assign_L216_C24", "label": " = angle_within_mod180()", "type": "assigned_variable", "loc": [216, 216], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:For_L215_C20", "vector": [14, 6, 0.6207, 0.0029, 6, 0.63, 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_99323:Return_L217_C20", "label": "return", "type": "return", "loc": [217, 217], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L214_C16", "vector": [13, 5, 0.6236, 0.0029, 5, 0.31, 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_99323:Expr_L218_C12", "label": "print()", "type": "expression", "loc": [218, 218], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L207_C8", "vector": [8, 3, 0.6264, 0.0029, 3, 0.64, 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_99323:Return_L219_C12", "label": "return", "type": "return", "loc": [219, 219], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L207_C8", "vector": [13, 3, 0.6293, 0.0029, 3, 0.64, 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_99323:FunctionDef_L221_C4", "label": "FK_rot", "type": "function", "loc": [221, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "vector": [2, 1, 0.6379, 0.0086, 1, 0.93, 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_99323:Assign_L222_C8", "label": "pos, rot = FK_all()", "type": "assigned_variable", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L221_C4", "vector": [14, 2, 0.6379, 0.0029, 2, 0.57, 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_99323:Return_L223_C8", "label": "return", "type": "return", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L221_C4", "vector": [13, 2, 0.6408, 0.0029, 2, 0.57, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L229_C4", "label": "FK", "type": "function", "loc": [229, 231], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "vector": [2, 1, 0.6609, 0.0086, 1, 0.93, 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_99323:Assign_L230_C8", "label": "pos, rot = FK_all()", "type": "assigned_variable", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L229_C4", "vector": [14, 2, 0.6609, 0.0029, 2, 0.2, 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_99323:Return_L231_C8", "label": "return", "type": "return", "loc": [231, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L229_C4", "vector": [13, 2, 0.6638, 0.0029, 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 pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L233_C4", "label": "FK_all", "type": "function", "loc": [233, 240], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "vector": [2, 1, 0.6796, 0.023, 1, 0.93, 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_99323: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_99323:FunctionDef_L233_C4", "vector": [14, 2, 0.6724, 0.0029, 2, 0.99, 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_99323:Assign_L235_C8", "label": "frame = FK_kdl()", "type": "assigned_variable", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L233_C4", "vector": [14, 2, 0.6753, 0.0029, 2, 0.99, 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_99323:Assign_L236_C8", "label": "pos =", "type": "assigned_variable", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L233_C4", "vector": [14, 2, 0.6782, 0.0029, 2, 0.99, 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_99323: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_99323:FunctionDef_L233_C4", "vector": [14, 2, 0.681, 0.0029, 2, 0.99, 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_99323:Assign_L238_C8", "label": "m =", "type": "assigned_variable", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L233_C4", "vector": [14, 2, 0.6839, 0.0029, 2, 0.99, 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_99323: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_99323:FunctionDef_L233_C4", "vector": [14, 2, 0.6868, 0.0029, 2, 0.99, 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_99323:Return_L240_C8", "label": "return", "type": "return", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L233_C4", "vector": [13, 2, 0.6897, 0.0029, 2, 0.99, 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_99323:FunctionDef_L242_C4", "label": "Jac", "type": "function", "loc": [242, 250], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "vector": [2, 1, 0.7069, 0.0259, 1, 0.93, 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_99323:Expr_L243_C8", "label": "expression", "type": "expression", "loc": [243, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L242_C4", "vector": [8, 2, 0.7026, 0.0115, 2, 0.04, 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_99323: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_99323:FunctionDef_L242_C4", "vector": [14, 2, 0.7098, 0.0029, 2, 0.04, 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_99323:Assign_L248_C8", "label": "kdl_jac = Jac_kdl()", "type": "assigned_variable", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L242_C4", "vector": [14, 2, 0.7126, 0.0029, 2, 0.04, 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_99323:Assign_L249_C8", "label": "meka_jac =", "type": "assigned_variable", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L242_C4", "vector": [14, 2, 0.7155, 0.0029, 2, 0.04, 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_99323:Return_L250_C8", "label": "return", "type": "return", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L242_C4", "vector": [13, 2, 0.7184, 0.0029, 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 meka_jac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L254_C4", "label": "Jacobian", "type": "function", "loc": [254, 269], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "vector": [2, 1, 0.7514, 0.046, 1, 0.93, 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(self.n_joints):\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_99323:Assign_L255_C8", "label": "chain =", "type": "assigned_variable", "loc": [255, 255], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L254_C4", "vector": [14, 2, 0.7328, 0.0029, 2, 0.27, 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_99323:Assign_L256_C8", "label": "v_list =", "type": "assigned_variable", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L254_C4", "vector": [14, 2, 0.7356, 0.0029, 2, 0.27, 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_99323:Assign_L257_C8", "label": "w_list =", "type": "assigned_variable", "loc": [257, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L254_C4", "vector": [14, 2, 0.7385, 0.0029, 2, 0.27, 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_99323:For_L258_C8", "label": "for i", "type": "for", "loc": [258, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L254_C4", "vector": [6, 2, 0.75, 0.0201, 2, 0.27, 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(self.n_joints):\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_99323:Assign_L259_C12", "label": "p, rot = FK_all()", "type": "assigned_variable", "loc": [259, 259], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:For_L258_C8", "vector": [14, 3, 0.7443, 0.0029, 3, 0.63, 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_99323:Assign_L260_C12", "label": "r =", "type": "assigned_variable", "loc": [260, 260], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:For_L258_C8", "vector": [14, 3, 0.7471, 0.0029, 3, 0.63, 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_99323:Assign_L261_C12", "label": "z_idx =", "type": "assigned_variable", "loc": [261, 261], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:For_L258_C8", "vector": [14, 3, 0.75, 0.0029, 3, 0.63, 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_99323:Assign_L262_C12", "label": "z =", "type": "assigned_variable", "loc": [262, 262], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:For_L258_C8", "vector": [14, 3, 0.7529, 0.0029, 3, 0.63, 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_99323:Expr_L263_C12", "label": "append()", "type": "expression", "loc": [263, 263], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:For_L258_C8", "vector": [8, 3, 0.7557, 0.0029, 3, 0.63, 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_99323:Expr_L264_C12", "label": "append()", "type": "expression", "loc": [264, 264], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:For_L258_C8", "vector": [8, 3, 0.7586, 0.0029, 3, 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": " w_list.append(z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L266_C8", "label": "J = row_stack()", "type": "assigned_variable", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L254_C4", "vector": [14, 2, 0.7644, 0.0029, 2, 0.27, 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_99323:Assign_L268_C8", "label": "J = Jac()", "type": "assigned_variable", "loc": [268, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L254_C4", "vector": [14, 2, 0.7701, 0.0029, 2, 0.27, 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_99323:Return_L269_C8", "label": "return", "type": "return", "loc": [269, 269], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L254_C4", "vector": [13, 2, 0.773, 0.0029, 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 J"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L278_C4", "label": "IK", "type": "function", "loc": [278, 308], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "vector": [2, 1, 0.842, 0.0891, 1, 0.93, 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_99323: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_99323:FunctionDef_L278_C4", "vector": [14, 2, 0.8017, 0.0029, 2, 0.9, 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_99323: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_99323:FunctionDef_L278_C4", "vector": [14, 2, 0.8046, 0.0029, 2, 0.9, 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_99323:Assign_L281_C8", "label": "fr = Frame()", "type": "assigned_variable", "loc": [281, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L278_C4", "vector": [14, 2, 0.8075, 0.0029, 2, 0.9, 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_99323:If_L283_C8", "label": "if", "type": "if", "loc": [283, 287], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L278_C4", "vector": [4, 2, 0.819, 0.0144, 2, 0.9, 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_99323:If_L284_C12", "label": "if", "type": "if", "loc": [284, 287], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L283_C8", "vector": [4, 3, 0.8204, 0.0115, 3, 0.21, 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_99323: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_99323:If_L284_C12", "vector": [14, 4, 0.819, 0.0029, 4, 0.49, 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_99323:If_L286_C12", "label": "if", "type": "if", "loc": [286, 287], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L284_C12", "vector": [4, 4, 0.8233, 0.0057, 4, 0.49, 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_99323: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_99323:If_L286_C12", "vector": [14, 5, 0.8247, 0.0029, 5, 0.95, 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_99323: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_99323:FunctionDef_L278_C4", "vector": [14, 2, 0.8305, 0.0029, 2, 0.9, 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_99323:Assign_L291_C8", "label": "q_res = IK_kdl()", "type": "assigned_variable", "loc": [291, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L278_C4", "vector": [14, 2, 0.8362, 0.0029, 2, 0.9, 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_99323: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_99323:FunctionDef_L278_C4", "vector": [14, 2, 0.8391, 0.0029, 2, 0.9, 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_99323:If_L294_C8", "label": "if", "type": "if", "loc": [294, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L278_C4", "vector": [4, 2, 0.8649, 0.0431, 2, 0.9, 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_99323:If_L295_C12", "label": "if", "type": "if", "loc": [295, 306], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L294_C8", "vector": [4, 3, 0.8635, 0.0345, 3, 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 == '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_99323:If_L296_C16", "label": "if", "type": "if", "loc": [296, 300], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L295_C12", "vector": [4, 4, 0.8563, 0.0144, 4, 0.51, 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_99323:Assign_L297_C20", "label": " = radians()", "type": "assigned_variable", "loc": [297, 297], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L296_C16", "vector": [14, 5, 0.8534, 0.0029, 5, 0.19, 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_99323: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_99323:If_L296_C16", "vector": [14, 5, 0.8563, 0.0029, 5, 0.19, 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_99323:Assign_L299_C20", "label": "q_res = IK_kdl()", "type": "assigned_variable", "loc": [299, 299], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L296_C16", "vector": [14, 5, 0.8592, 0.0029, 5, 0.19, 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_99323: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_99323:If_L296_C16", "vector": [14, 5, 0.8621, 0.0029, 5, 0.19, 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_99323:If_L301_C16", "label": "if", "type": "if", "loc": [301, 304], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L295_C12", "vector": [4, 4, 0.8693, 0.0115, 4, 0.51, 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_99323:Return_L302_C20", "label": "return", "type": "return", "loc": [302, 302], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L301_C16", "vector": [13, 5, 0.8678, 0.0029, 5, 0.69, 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_99323:Return_L304_C20", "label": "return", "type": "return", "loc": [304, 304], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L301_C16", "vector": [13, 5, 0.8736, 0.0029, 5, 0.69, 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_99323:Return_L306_C16", "label": "return", "type": "return", "loc": [306, 306], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L295_C12", "vector": [13, 4, 0.8793, 0.0029, 4, 0.51, 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_99323:Return_L308_C12", "label": "return", "type": "return", "loc": [308, 308], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L294_C8", "vector": [13, 3, 0.8851, 0.0029, 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_99323:FunctionDef_L314_C4", "label": "clamp_to_joint_limits", "type": "function", "loc": [314, 320], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "vector": [2, 1, 0.9109, 0.0201, 1, 0.93, 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_99323:Assign_L315_C8", "label": "d =", "type": "assigned_variable", "loc": [315, 315], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L314_C4", "vector": [14, 2, 0.9052, 0.0029, 2, 0.2, 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_99323:Assign_L316_C8", "label": "max_arr =", "type": "assigned_variable", "loc": [316, 316], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L314_C4", "vector": [14, 2, 0.908, 0.0029, 2, 0.2, 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_99323:Assign_L317_C8", "label": "min_arr =", "type": "assigned_variable", "loc": [317, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L314_C4", "vector": [14, 2, 0.9109, 0.0029, 2, 0.2, 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_99323:Assign_L318_C8", "label": "q_arr = array()", "type": "assigned_variable", "loc": [318, 318], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L314_C4", "vector": [14, 2, 0.9138, 0.0029, 2, 0.2, 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_99323:Assign_L319_C8", "label": "d_arr = array()", "type": "assigned_variable", "loc": [319, 319], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L314_C4", "vector": [14, 2, 0.9167, 0.0029, 2, 0.2, 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_99323:Return_L320_C8", "label": "return", "type": "return", "loc": [320, 320], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L314_C4", "vector": [13, 2, 0.9195, 0.0029, 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 np.clip(q_arr, min_arr-d_arr, max_arr+d_arr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L322_C4", "label": "within_joint_limits", "type": "function", "loc": [322, 328], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "vector": [2, 1, 0.9339, 0.0201, 1, 0.93, 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_99323:Assign_L323_C8", "label": "d =", "type": "assigned_variable", "loc": [323, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L322_C4", "vector": [14, 2, 0.9282, 0.0029, 2, 0.1, 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_99323:Assign_L324_C8", "label": "max_arr =", "type": "assigned_variable", "loc": [324, 324], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L322_C4", "vector": [14, 2, 0.931, 0.0029, 2, 0.1, 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_99323:Assign_L325_C8", "label": "min_arr =", "type": "assigned_variable", "loc": [325, 325], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L322_C4", "vector": [14, 2, 0.9339, 0.0029, 2, 0.1, 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_99323:Assign_L326_C8", "label": "q_arr = array()", "type": "assigned_variable", "loc": [326, 326], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L322_C4", "vector": [14, 2, 0.9368, 0.0029, 2, 0.1, 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_99323:Assign_L327_C8", "label": "d_arr = array()", "type": "assigned_variable", "loc": [327, 327], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L322_C4", "vector": [14, 2, 0.9397, 0.0029, 2, 0.1, 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_99323:Return_L328_C8", "label": "return", "type": "return", "loc": [328, 328], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L322_C4", "vector": [13, 2, 0.9425, 0.0029, 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 np.all((q_arr <= max_arr+d_arr, q_arr >= min_arr-d_arr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L333_C0", "label": "if", "type": "if", "loc": [333, 342], "level": 0, "parent": null, "vector": [4, 0, 0.9698, 0.0287, 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 roslib; roslib.load_manifest('hrl_cody_arms')\n import hrl_cody_arms.cody_arm_kinematics as cak\n\n h = M3HrlRobot(0.16)\n k = cak.CodyArmKinematics('r')\n p = np.matrix([0., 0., -0.16]).T\n k.set_tooltip(p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:Import_L334_C4", "label": "roslib import roslib", "type": "import", "loc": [334, 334], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L333_C0", "vector": [1, 1, 0.9598, 0.0029, 1, 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('hrl_cody_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L334_C19", "label": "load_manifest()", "type": "expression", "loc": [334, 334], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L333_C0", "vector": [8, 1, 0.9598, 0.0029, 1, 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('hrl_cody_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:Import_L335_C4", "label": "hrl_cody_arms.cody_arm_kinematics import cak", "type": "import", "loc": [335, 335], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L333_C0", "vector": [1, 1, 0.9626, 0.0029, 1, 0.66, 0.2857, 221, 0, 1, 0, 0, 221, 0, 0], "semantic": {"name": "hrl_cody_arms.cody_arm_kinematics", "arg_names": [], "import_names": ["cak"], "rhs_call_name": "", "annotation": ""}, "snippet": " import hrl_cody_arms.cody_arm_kinematics as cak"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L337_C4", "label": "h = M3HrlRobot()", "type": "assigned_variable", "loc": [337, 337], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L333_C0", "vector": [14, 1, 0.9684, 0.0029, 1, 0.66, 0.4286, 686, 3, 1, 0, 0, 305, 10, 1], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "M3HrlRobot", "annotation": ""}, "snippet": " h = M3HrlRobot(0.16)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L338_C4", "label": "k = CodyArmKinematics()", "type": "assigned_variable", "loc": [338, 338], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L333_C0", "vector": [14, 1, 0.9713, 0.0029, 1, 0.66, 0.5714, 954, 3, 1, 0, 0, 11, 10, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "CodyArmKinematics", "annotation": ""}, "snippet": " k = cak.CodyArmKinematics('r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L339_C4", "label": "p =", "type": "assigned_variable", "loc": [339, 339], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L333_C0", "vector": [14, 1, 0.9741, 0.0029, 1, 0.66, 0.7143, 491, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = np.matrix([0., 0., -0.16]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L340_C4", "label": "set_tooltip()", "type": "expression", "loc": [340, 340], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L333_C0", "vector": [8, 1, 0.977, 0.0029, 1, 0.66, 0.8571, 350, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_tooltip", "arg_names": [], "import_names": [], "rhs_call_name": "set_tooltip", "annotation": ""}, "snippet": " k.set_tooltip(p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L342_C4", "label": "J_old =", "type": "assigned_variable", "loc": [342, 342], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L333_C0", "vector": [14, 1, 0.9828, 0.0029, 1, 0.66, 1.0, 820, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "J_old", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " J_old = h.Jacobian"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L108_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L108_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L108_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L137_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L138_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L139_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L140_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L141_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L171_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L171_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L171_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L171_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L176_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L178_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L176_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L180_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L176_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L181_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L207_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:For_L208_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:For_L208_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L209_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L207_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L210_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L207_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L212_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L212_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L213_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L212_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L214_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L214_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:For_L215_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:For_L215_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L216_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L214_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L217_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L207_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L218_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L207_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L219_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L221_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L221_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L229_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L229_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L229_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L233_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L242_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L242_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L242_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L247_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L242_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L242_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L242_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L254_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L255_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L257_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:For_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:For_L258_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L259_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:For_L258_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L260_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:For_L258_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L261_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:For_L258_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L262_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:For_L258_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L263_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:For_L258_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L264_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L278_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L279_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L280_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L281_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L283_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L284_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L284_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L285_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L284_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L286_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L286_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L287_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L289_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L291_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L292_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L294_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L294_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L295_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L295_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L296_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L296_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L297_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L296_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L298_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L296_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L299_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L296_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L300_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L295_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L301_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L301_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L302_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L301_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L304_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L295_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L306_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L294_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L308_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L314_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L315_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L316_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L317_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L318_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L319_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L320_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L322_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L323_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L324_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L325_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L326_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L327_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:FunctionDef_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Return_L328_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L333_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Import_L334_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L333_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L334_C19"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L333_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Import_L335_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L333_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L337_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L333_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L338_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L333_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L339_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L333_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Expr_L340_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99323:If_L333_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99323:Assign_L342_C4"}]
# # 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('hrl_cody_arms') import rospy import hrl_lib.viz as hv from hrl_msgs.msg import FloatArray from std_msgs.msg import Header, Bool, 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(0.16) 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_99324
350
575
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99324:Import_L33_C0", "label": "math import math", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.0574, 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_99324:Import_L34_C0", "label": "numpy import np", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0591, 0.0017, 0, 0.66, 0.0667, 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_99324:Import_L35_C0", "label": "copy import copy", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.0609, 0.0017, 0, 0.66, 0.1333, 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_99324:Import_L36_C0", "label": "sys import sys, time, os", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.0626, 0.0017, 0, 0.66, 0.2, 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_99324:ImportFrom_L37_C0", "label": "from threading import RLock", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.0643, 0.0017, 0, 0.66, 0.2667, 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_99324:Import_L39_C0", "label": "roslib import roslib", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.0678, 0.0017, 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_cody_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L39_C15", "label": "load_manifest()", "type": "expression", "loc": [39, 39], "level": 0, "parent": null, "vector": [8, 0, 0.0678, 0.0017, 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('hrl_cody_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99324:Import_L40_C0", "label": "rospy import rospy", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.0696, 0.0017, 0, 0.66, 0.4667, 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_99324:Import_L42_C0", "label": "hrl_lib.viz import hv", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.073, 0.0017, 0, 0.66, 0.5333, 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_99324:ImportFrom_L44_C0", "label": "from hrl_msgs.msg import FloatArray", "type": "import", "loc": [44, 44], "level": 0, "parent": null, "vector": [1, 0, 0.0765, 0.0017, 0, 0.66, 0.6, 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_99324:ImportFrom_L45_C0", "label": "from std_msgs.msg import Header, Bool, Empty", "type": "import", "loc": [45, 45], "level": 0, "parent": null, "vector": [1, 0, 0.0783, 0.0017, 0, 0.66, 0.6667, 366, 0, 3, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Header", "Bool", "Empty"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Header, Bool, Empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99324:ImportFrom_L47_C0", "label": "from std_srvs.srv import Empty_srv", "type": "import", "loc": [47, 47], "level": 0, "parent": null, "vector": [1, 0, 0.0817, 0.0017, 0, 0.66, 0.7333, 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_99324:ImportFrom_L48_C0", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [48, 48], "level": 0, "parent": null, "vector": [1, 0, 0.0835, 0.0017, 0, 0.66, 0.8, 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_99324:FunctionDef_L52_C0", "label": "get_joint_name_dict", "type": "function", "loc": [52, 56], "level": 0, "parent": null, "vector": [2, 0, 0.0939, 0.0087, 0, 0.66, 0.8667, 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_99324:Assign_L53_C4", "label": "joint_names_list =", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L52_C0", "vector": [14, 1, 0.0922, 0.0017, 1, 0.29, 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_99324:Assign_L54_C4", "label": "assign", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L52_C0", "vector": [14, 1, 0.0939, 0.0017, 1, 0.29, 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_99324:Assign_L55_C4", "label": "assign", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L52_C0", "vector": [14, 1, 0.0957, 0.0017, 1, 0.29, 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_99324:Return_L56_C4", "label": "return", "type": "return", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L52_C0", "vector": [13, 1, 0.0974, 0.0017, 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 joint_names_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "label": "MekaArmClient", "type": "class", "loc": [59, 497], "level": 0, "parent": null, "vector": [3, 0, 0.4835, 0.7635, 0, 0.66, 0.9333, 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_99324:FunctionDef_L62_C4", "label": "__init__", "type": "function", "loc": [62, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.1548, 0.0957, 1, 0.97, 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_99324:Assign_L63_C8", "label": "self.cb_lock = RLock()", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.1096, 0.0017, 2, 0.97, 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_99324:Assign_L64_C8", "label": "self.r_arm_jep =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.1113, 0.0017, 2, 0.97, 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_99324:Assign_L65_C8", "label": "self.l_arm_jep =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.113, 0.0017, 2, 0.97, 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_99324:Assign_L66_C8", "label": "self.r_arm_alpha =", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.1148, 0.0017, 2, 0.97, 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_99324:Assign_L67_C8", "label": "self.l_arm_alpha =", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.1165, 0.0017, 2, 0.97, 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_99324:Assign_L68_C8", "label": "self.r_arm_q =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.1183, 0.0017, 2, 0.97, 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_99324:Assign_L69_C8", "label": "self.l_arm_q =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.12, 0.0017, 2, 0.97, 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_99324:Assign_L70_C8", "label": "self.r_arm_force =", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.1217, 0.0017, 2, 0.97, 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_99324:Assign_L71_C8", "label": "self.r_arm_raw_force =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.1235, 0.0017, 2, 0.97, 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_99324:Assign_L72_C8", "label": "self.l_arm_force =", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.1252, 0.0017, 2, 0.97, 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_99324:Assign_L73_C8", "label": "self.l_arm_raw_force =", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.127, 0.0017, 2, 0.97, 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_99324:Assign_L74_C8", "label": "self.pwr_state =", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.1287, 0.0017, 2, 0.97, 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_99324:Assign_L76_C8", "label": "self.left_arm_ft =", "type": "assigned_variable", "loc": [76, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.133, 0.0035, 2, 0.97, 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_99324:Assign_L78_C8", "label": "self.right_arm_ft =", "type": "assigned_variable", "loc": [78, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.1365, 0.0035, 2, 0.97, 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_99324:Assign_L80_C8", "label": "self.fts_bias =", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.1391, 0.0017, 2, 0.97, 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_99324:Assign_L81_C8", "label": "self.arms =", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.1409, 0.0017, 2, 0.97, 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_99324:Assign_L83_C8", "label": "self.joint_names_list = get_joint_name_dict()", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.1443, 0.0017, 2, 0.97, 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_99324:Assign_L85_C8", "label": "self.r_jep_cmd_pub = Publisher()", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.1478, 0.0017, 2, 0.97, 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_99324:Assign_L86_C8", "label": "self.l_jep_cmd_pub = Publisher()", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.1496, 0.0017, 2, 0.97, 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_99324:Assign_L87_C8", "label": "self.r_alph_cmd_pub = Publisher()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.1513, 0.0017, 2, 0.97, 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_99324:Assign_L88_C8", "label": "self.l_alph_cmd_pub = Publisher()", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.153, 0.0017, 2, 0.97, 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_99324:Assign_L89_C8", "label": "self.stop_pub = Publisher()", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.1548, 0.0017, 2, 0.97, 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_99324:Assign_L90_C8", "label": "self.motors_off_pub = Publisher()", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.1565, 0.0017, 2, 0.97, 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_99324:Assign_L92_C8", "label": "self.cep_marker_pub = Publisher()", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.16, 0.0017, 2, 0.97, 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_99324:Expr_L94_C8", "label": "Subscriber()", "type": "expression", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [8, 2, 0.1635, 0.0017, 2, 0.97, 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_99324:Expr_L95_C8", "label": "Subscriber()", "type": "expression", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [8, 2, 0.1652, 0.0017, 2, 0.97, 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_99324:Expr_L96_C8", "label": "Subscriber()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [8, 2, 0.167, 0.0017, 2, 0.97, 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_99324:Expr_L97_C8", "label": "Subscriber()", "type": "expression", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [8, 2, 0.1687, 0.0017, 2, 0.97, 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_99324:Expr_L99_C8", "label": "Subscriber()", "type": "expression", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [8, 2, 0.1722, 0.0017, 2, 0.97, 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_99324:Expr_L100_C8", "label": "Subscriber()", "type": "expression", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [8, 2, 0.1739, 0.0017, 2, 0.97, 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_99324:Expr_L102_C8", "label": "Subscriber()", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [8, 2, 0.1774, 0.0017, 2, 0.97, 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_99324:Expr_L103_C8", "label": "Subscriber()", "type": "expression", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [8, 2, 0.1791, 0.0017, 2, 0.97, 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_99324:Expr_L104_C8", "label": "Subscriber()", "type": "expression", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [8, 2, 0.1809, 0.0017, 2, 0.97, 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_99324:Expr_L105_C8", "label": "Subscriber()", "type": "expression", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [8, 2, 0.1826, 0.0017, 2, 0.97, 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_99324:Expr_L107_C8", "label": "Subscriber()", "type": "expression", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [8, 2, 0.1861, 0.0017, 2, 0.97, 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_99324:Expr_L109_C8", "label": "wait_for_service()", "type": "expression", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [8, 2, 0.1896, 0.0017, 2, 0.97, 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_99324:Assign_L110_C8", "label": "self.toggle_floating_arms = ServiceProxy()", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [14, 2, 0.1913, 0.0017, 2, 0.97, 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_99324:Try_L113_C8", "label": "try", "type": "try", "loc": [113, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "vector": [7, 2, 0.1991, 0.007, 2, 0.97, 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_99324:Expr_L114_C12", "label": "init_node()", "type": "expression", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:Try_L113_C8", "vector": [8, 3, 0.1983, 0.0017, 3, 0.06, 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_99324:FunctionDef_L119_C4", "label": "pwr_state_cb", "type": "function", "loc": [119, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.2096, 0.007, 1, 0.97, 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_99324:Expr_L120_C8", "label": "acquire()", "type": "expression", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L119_C4", "vector": [8, 2, 0.2087, 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_99324:Assign_L121_C8", "label": "self.pwr_state =", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L119_C4", "vector": [14, 2, 0.2104, 0.0017, 2, 0.99, 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_99324:Expr_L122_C8", "label": "release()", "type": "expression", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L119_C4", "vector": [8, 2, 0.2122, 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_99324:FunctionDef_L124_C4", "label": "r_arm_jep_cb", "type": "function", "loc": [124, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.227, 0.0243, 1, 0.97, 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_99324:Expr_L125_C8", "label": "acquire()", "type": "expression", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L124_C4", "vector": [8, 2, 0.2174, 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_99324:Assign_L126_C8", "label": "self.r_arm_jep = list()", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L124_C4", "vector": [14, 2, 0.2191, 0.0017, 2, 0.01, 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_99324:Expr_L127_C8", "label": "release()", "type": "expression", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L124_C4", "vector": [8, 2, 0.2209, 0.0017, 2, 0.01, 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_99324:Assign_L130_C8", "label": "cep, r = FK_all()", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L124_C4", "vector": [14, 2, 0.2261, 0.0017, 2, 0.01, 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_99324:Assign_L131_C8", "label": "o =", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L124_C4", "vector": [14, 2, 0.2278, 0.0017, 2, 0.01, 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_99324:Assign_L132_C8", "label": "cep_marker = single_marker()", "type": "assigned_variable", "loc": [132, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L124_C4", "vector": [14, 2, 0.2313, 0.0052, 2, 0.01, 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_99324:Assign_L136_C8", "label": "cep_marker.header.stamp =", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L124_C4", "vector": [14, 2, 0.2365, 0.0017, 2, 0.01, 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_99324:Expr_L137_C8", "label": "publish()", "type": "expression", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L124_C4", "vector": [8, 2, 0.2383, 0.0017, 2, 0.01, 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_99324:FunctionDef_L139_C4", "label": "l_arm_jep_cb", "type": "function", "loc": [139, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.2443, 0.007, 1, 0.97, 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_99324:Expr_L140_C8", "label": "acquire()", "type": "expression", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L139_C4", "vector": [8, 2, 0.2435, 0.0017, 2, 0.25, 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_99324:Assign_L141_C8", "label": "self.l_arm_jep = list()", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L139_C4", "vector": [14, 2, 0.2452, 0.0017, 2, 0.25, 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_99324:Expr_L142_C8", "label": "release()", "type": "expression", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L139_C4", "vector": [8, 2, 0.247, 0.0017, 2, 0.25, 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_99324:FunctionDef_L144_C4", "label": "r_arm_alpha_cb", "type": "function", "loc": [144, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.253, 0.007, 1, 0.97, 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_99324:Expr_L145_C8", "label": "acquire()", "type": "expression", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L144_C4", "vector": [8, 2, 0.2522, 0.0017, 2, 0.79, 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_99324:Assign_L146_C8", "label": "self.r_arm_alpha = list()", "type": "assigned_variable", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L144_C4", "vector": [14, 2, 0.2539, 0.0017, 2, 0.79, 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_99324:Expr_L147_C8", "label": "release()", "type": "expression", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L144_C4", "vector": [8, 2, 0.2557, 0.0017, 2, 0.79, 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_99324:FunctionDef_L149_C4", "label": "l_arm_alpha_cb", "type": "function", "loc": [149, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.2617, 0.007, 1, 0.97, 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_99324:Expr_L150_C8", "label": "acquire()", "type": "expression", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L149_C4", "vector": [8, 2, 0.2609, 0.0017, 2, 0.52, 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_99324:Assign_L151_C8", "label": "self.l_arm_alpha = list()", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L149_C4", "vector": [14, 2, 0.2626, 0.0017, 2, 0.52, 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_99324:Expr_L152_C8", "label": "release()", "type": "expression", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L149_C4", "vector": [8, 2, 0.2643, 0.0017, 2, 0.52, 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_99324:FunctionDef_L154_C4", "label": "r_arm_q_cb", "type": "function", "loc": [154, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.2704, 0.007, 1, 0.97, 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_99324:Expr_L155_C8", "label": "acquire()", "type": "expression", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L154_C4", "vector": [8, 2, 0.2696, 0.0017, 2, 0.92, 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_99324:Assign_L156_C8", "label": "self.r_arm_q = list()", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L154_C4", "vector": [14, 2, 0.2713, 0.0017, 2, 0.92, 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_99324:Expr_L157_C8", "label": "release()", "type": "expression", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L154_C4", "vector": [8, 2, 0.273, 0.0017, 2, 0.92, 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_99324:FunctionDef_L159_C4", "label": "l_arm_q_cb", "type": "function", "loc": [159, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.2791, 0.007, 1, 0.97, 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_99324:Expr_L160_C8", "label": "acquire()", "type": "expression", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L159_C4", "vector": [8, 2, 0.2783, 0.0017, 2, 0.17, 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_99324:Assign_L161_C8", "label": "self.l_arm_q = list()", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L159_C4", "vector": [14, 2, 0.28, 0.0017, 2, 0.17, 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_99324:Expr_L162_C8", "label": "release()", "type": "expression", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L159_C4", "vector": [8, 2, 0.2817, 0.0017, 2, 0.17, 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_99324:FunctionDef_L164_C4", "label": "r_arm_force_cb", "type": "function", "loc": [164, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.2878, 0.007, 1, 0.97, 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_99324:Expr_L165_C8", "label": "acquire()", "type": "expression", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L164_C4", "vector": [8, 2, 0.287, 0.0017, 2, 0.02, 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_99324:Assign_L166_C8", "label": "self.r_arm_force =", "type": "assigned_variable", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L164_C4", "vector": [14, 2, 0.2887, 0.0017, 2, 0.02, 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_99324:Expr_L167_C8", "label": "release()", "type": "expression", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L164_C4", "vector": [8, 2, 0.2904, 0.0017, 2, 0.02, 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_99324:FunctionDef_L169_C4", "label": "l_arm_force_cb", "type": "function", "loc": [169, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.2965, 0.007, 1, 0.97, 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_99324:Expr_L170_C8", "label": "acquire()", "type": "expression", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L169_C4", "vector": [8, 2, 0.2957, 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_99324:Assign_L171_C8", "label": "self.l_arm_force =", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L169_C4", "vector": [14, 2, 0.2974, 0.0017, 2, 0.85, 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_99324:Expr_L172_C8", "label": "release()", "type": "expression", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L169_C4", "vector": [8, 2, 0.2991, 0.0017, 2, 0.85, 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_99324:FunctionDef_L174_C4", "label": "r_arm_raw_force_cb", "type": "function", "loc": [174, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.3052, 0.007, 1, 0.97, 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_99324:Expr_L175_C8", "label": "acquire()", "type": "expression", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L174_C4", "vector": [8, 2, 0.3043, 0.0017, 2, 0.58, 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_99324:Assign_L176_C8", "label": "self.r_arm_raw_force =", "type": "assigned_variable", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L174_C4", "vector": [14, 2, 0.3061, 0.0017, 2, 0.58, 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_99324:Expr_L177_C8", "label": "release()", "type": "expression", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L174_C4", "vector": [8, 2, 0.3078, 0.0017, 2, 0.58, 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_99324:FunctionDef_L179_C4", "label": "l_arm_raw_force_cb", "type": "function", "loc": [179, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.3139, 0.007, 1, 0.97, 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_99324:Expr_L180_C8", "label": "acquire()", "type": "expression", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L179_C4", "vector": [8, 2, 0.313, 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_99324:Assign_L181_C8", "label": "self.l_arm_raw_force =", "type": "assigned_variable", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L179_C4", "vector": [14, 2, 0.3148, 0.0017, 2, 0.71, 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_99324:Expr_L182_C8", "label": "release()", "type": "expression", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L179_C4", "vector": [8, 2, 0.3165, 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_99324:FunctionDef_L189_C4", "label": "end_effector_pos", "type": "function", "loc": [189, 191], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.3304, 0.0052, 1, 0.97, 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_99324:Assign_L190_C8", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L189_C4", "vector": [14, 2, 0.3304, 0.0017, 2, 0.81, 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_99324:Return_L191_C8", "label": "return", "type": "return", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L189_C4", "vector": [13, 2, 0.3322, 0.0017, 2, 0.81, 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_99324:FunctionDef_L195_C4", "label": "get_joint_angles", "type": "function", "loc": [195, 205], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.3478, 0.0191, 1, 0.97, 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_99324:Expr_L196_C8", "label": "acquire()", "type": "expression", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L195_C4", "vector": [8, 2, 0.3409, 0.0017, 2, 0.26, 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_99324:If_L197_C8", "label": "if", "type": "if", "loc": [197, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L195_C4", "vector": [4, 2, 0.3478, 0.0122, 2, 0.26, 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_99324:Assign_L198_C12", "label": "q = copy()", "type": "assigned_variable", "loc": [198, 198], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L197_C8", "vector": [14, 3, 0.3443, 0.0017, 3, 0.51, 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_99324:If_L199_C8", "label": "if", "type": "if", "loc": [199, 203], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L197_C8", "vector": [4, 3, 0.3496, 0.0087, 3, 0.51, 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_99324:Assign_L200_C12", "label": "q = copy()", "type": "assigned_variable", "loc": [200, 200], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L199_C8", "vector": [14, 4, 0.3478, 0.0017, 4, 0.05, 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_99324:Expr_L202_C12", "label": "release()", "type": "expression", "loc": [202, 202], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L199_C8", "vector": [8, 4, 0.3513, 0.0017, 4, 0.05, 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_99324:Expr_L204_C8", "label": "release()", "type": "expression", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L195_C4", "vector": [8, 2, 0.3548, 0.0017, 2, 0.26, 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_99324:Return_L205_C8", "label": "return", "type": "return", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L195_C4", "vector": [13, 2, 0.3565, 0.0017, 2, 0.26, 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_99324:FunctionDef_L207_C4", "label": "get_wrist_force", "type": "function", "loc": [207, 233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.3826, 0.047, 1, 0.97, 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_99324:Expr_L209_C8", "label": "acquire()", "type": "expression", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L207_C4", "vector": [8, 2, 0.3635, 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_99324:If_L210_C8", "label": "if", "type": "if", "loc": [210, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L207_C4", "vector": [4, 2, 0.3757, 0.0226, 2, 0.55, 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_99324:If_L211_C12", "label": "if", "type": "if", "loc": [211, 214], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L210_C8", "vector": [4, 3, 0.3696, 0.007, 3, 0.47, 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_99324:Assign_L212_C16", "label": "f = copy()", "type": "assigned_variable", "loc": [212, 212], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L211_C12", "vector": [14, 4, 0.3687, 0.0017, 4, 0.88, 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_99324:Assign_L214_C16", "label": "f = copy()", "type": "assigned_variable", "loc": [214, 214], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L211_C12", "vector": [14, 4, 0.3722, 0.0017, 4, 0.88, 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_99324:If_L215_C8", "label": "if", "type": "if", "loc": [215, 222], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L210_C8", "vector": [4, 3, 0.38, 0.0139, 3, 0.47, 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_99324:If_L216_C12", "label": "if", "type": "if", "loc": [216, 219], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L215_C8", "vector": [4, 4, 0.3783, 0.007, 4, 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.l_arm_force)\n else:\n f = copy.copy(self.l_arm_raw_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L217_C16", "label": "f = copy()", "type": "assigned_variable", "loc": [217, 217], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L216_C12", "vector": [14, 5, 0.3774, 0.0017, 5, 0.39, 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_99324:Assign_L219_C16", "label": "f = copy()", "type": "assigned_variable", "loc": [219, 219], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L216_C12", "vector": [14, 5, 0.3809, 0.0017, 5, 0.39, 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_99324:Expr_L221_C12", "label": "release()", "type": "expression", "loc": [221, 221], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L215_C8", "vector": [8, 4, 0.3843, 0.0017, 4, 0.43, 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_99324:Expr_L223_C8", "label": "release()", "type": "expression", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L207_C4", "vector": [8, 2, 0.3878, 0.0017, 2, 0.55, 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_99324:Assign_L225_C8", "label": "f_mat =", "type": "assigned_variable", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L207_C4", "vector": [14, 2, 0.3913, 0.0017, 2, 0.55, 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_99324:If_L226_C8", "label": "if", "type": "if", "loc": [226, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L207_C4", "vector": [4, 2, 0.3939, 0.0035, 2, 0.55, 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_99324:Assign_L227_C12", "label": "f_mat =", "type": "assigned_variable", "loc": [227, 227], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L226_C8", "vector": [14, 3, 0.3948, 0.0017, 3, 0.31, 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_99324:If_L229_C8", "label": "if", "type": "if", "loc": [229, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L207_C4", "vector": [4, 2, 0.4009, 0.007, 2, 0.55, 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_99324:Assign_L230_C12", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [230, 230], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L229_C8", "vector": [14, 3, 0.4, 0.0017, 3, 0.11, 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_99324:Assign_L231_C12", "label": "rot = FK_rot()", "type": "assigned_variable", "loc": [231, 231], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L229_C8", "vector": [14, 3, 0.4017, 0.0017, 3, 0.11, 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_99324:Assign_L232_C12", "label": "f_mat =", "type": "assigned_variable", "loc": [232, 232], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L229_C8", "vector": [14, 3, 0.4035, 0.0017, 3, 0.11, 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_99324:Return_L233_C8", "label": "return", "type": "return", "loc": [233, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L207_C4", "vector": [13, 2, 0.4052, 0.0017, 2, 0.55, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return f_mat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L235_C4", "label": "bias_wrist_ft", "type": "function", "loc": [235, 250], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.4217, 0.0278, 1, 0.97, 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_99324:Assign_L236_C8", "label": "f_list =", "type": "assigned_variable", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L235_C4", "vector": [14, 2, 0.4104, 0.0017, 2, 0.29, 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_99324:Assign_L237_C8", "label": "t_list =", "type": "assigned_variable", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L235_C4", "vector": [14, 2, 0.4122, 0.0017, 2, 0.29, 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_99324:Expr_L238_C8", "label": "print()", "type": "expression", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L235_C4", "vector": [8, 2, 0.4139, 0.0017, 2, 0.29, 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_99324:For_L239_C8", "label": "for i", "type": "for", "loc": [239, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L235_C4", "vector": [6, 2, 0.4174, 0.0052, 2, 0.29, 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_99324:Expr_L240_C12", "label": "append()", "type": "expression", "loc": [240, 240], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:For_L239_C8", "vector": [8, 3, 0.4174, 0.0017, 3, 0.16, 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_99324:Expr_L241_C12", "label": "sleep()", "type": "expression", "loc": [241, 241], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:For_L239_C8", "vector": [8, 3, 0.4191, 0.0017, 3, 0.16, 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_99324:Assign_L243_C8", "label": "f_b = mean()", "type": "assigned_variable", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L235_C4", "vector": [14, 2, 0.4226, 0.0017, 2, 0.29, 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_99324:Assign_L245_C8", "label": "t_b = get_wrist_torque()", "type": "assigned_variable", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L235_C4", "vector": [14, 2, 0.4261, 0.0017, 2, 0.29, 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_99324:Assign_L246_C8", "label": "assign", "type": "assigned_variable", "loc": [246, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L235_C4", "vector": [14, 2, 0.4278, 0.0017, 2, 0.29, 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_99324:Assign_L247_C8", "label": "assign", "type": "assigned_variable", "loc": [247, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L235_C4", "vector": [14, 2, 0.4296, 0.0017, 2, 0.29, 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_99324:Expr_L248_C8", "label": "print()", "type": "expression", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L235_C4", "vector": [8, 2, 0.4313, 0.0017, 2, 0.29, 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_99324:Expr_L249_C8", "label": "print()", "type": "expression", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L235_C4", "vector": [8, 2, 0.433, 0.0017, 2, 0.29, 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_99324:Expr_L250_C8", "label": "print()", "type": "expression", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L235_C4", "vector": [8, 2, 0.4348, 0.0017, 2, 0.29, 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_99324:FunctionDef_L254_C4", "label": "get_impedance_scale", "type": "function", "loc": [254, 264], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.4504, 0.0191, 1, 0.97, 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_99324:Expr_L255_C8", "label": "acquire()", "type": "expression", "loc": [255, 255], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L254_C4", "vector": [8, 2, 0.4435, 0.0017, 2, 0.86, 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_99324:If_L256_C8", "label": "if", "type": "if", "loc": [256, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L254_C4", "vector": [4, 2, 0.4504, 0.0122, 2, 0.86, 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_99324:Assign_L257_C12", "label": "sc = copy()", "type": "assigned_variable", "loc": [257, 257], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L256_C8", "vector": [14, 3, 0.447, 0.0017, 3, 0.61, 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_99324:If_L258_C8", "label": "if", "type": "if", "loc": [258, 262], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L256_C8", "vector": [4, 3, 0.4522, 0.0087, 3, 0.61, 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_99324:Assign_L259_C12", "label": "sc = copy()", "type": "assigned_variable", "loc": [259, 259], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L258_C8", "vector": [14, 4, 0.4504, 0.0017, 4, 0.06, 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_99324:Expr_L261_C12", "label": "release()", "type": "expression", "loc": [261, 261], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L258_C8", "vector": [8, 4, 0.4539, 0.0017, 4, 0.06, 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_99324:Expr_L263_C8", "label": "release()", "type": "expression", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L254_C4", "vector": [8, 2, 0.4574, 0.0017, 2, 0.86, 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_99324:Return_L264_C8", "label": "return", "type": "return", "loc": [264, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L254_C4", "vector": [13, 2, 0.4591, 0.0017, 2, 0.86, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L268_C4", "label": "set_impedance_scale", "type": "function", "loc": [268, 278], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.4748, 0.0191, 1, 0.97, 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_99324:If_L269_C8", "label": "if", "type": "if", "loc": [269, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L268_C4", "vector": [4, 2, 0.4722, 0.0104, 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 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_99324:Assign_L270_C12", "label": "pub =", "type": "assigned_variable", "loc": [270, 270], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L269_C8", "vector": [14, 3, 0.4696, 0.0017, 3, 0.51, 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_99324:If_L271_C8", "label": "if", "type": "if", "loc": [271, 274], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L269_C8", "vector": [4, 3, 0.4739, 0.007, 3, 0.51, 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_99324:Assign_L272_C12", "label": "pub =", "type": "assigned_variable", "loc": [272, 272], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L271_C8", "vector": [14, 4, 0.473, 0.0017, 4, 0.03, 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_99324:Assign_L275_C8", "label": "time_stamp = now()", "type": "assigned_variable", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L268_C4", "vector": [14, 2, 0.4783, 0.0017, 2, 0.65, 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_99324:Assign_L276_C8", "label": "h = Header()", "type": "assigned_variable", "loc": [276, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L268_C4", "vector": [14, 2, 0.48, 0.0017, 2, 0.65, 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_99324:Assign_L277_C8", "label": "h.stamp =", "type": "assigned_variable", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L268_C4", "vector": [14, 2, 0.4817, 0.0017, 2, 0.65, 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_99324:Expr_L278_C8", "label": "publish()", "type": "expression", "loc": [278, 278], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L268_C4", "vector": [8, 2, 0.4835, 0.0017, 2, 0.65, 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_99324:FunctionDef_L280_C4", "label": "get_jep", "type": "function", "loc": [280, 290], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.4957, 0.0191, 1, 0.97, 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_99324:Expr_L281_C8", "label": "acquire()", "type": "expression", "loc": [281, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L280_C4", "vector": [8, 2, 0.4887, 0.0017, 2, 0.29, 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_99324:If_L282_C8", "label": "if", "type": "if", "loc": [282, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L280_C4", "vector": [4, 2, 0.4957, 0.0122, 2, 0.29, 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_99324:Assign_L283_C12", "label": "jep = copy()", "type": "assigned_variable", "loc": [283, 283], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L282_C8", "vector": [14, 3, 0.4922, 0.0017, 3, 0.38, 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_99324:If_L284_C8", "label": "if", "type": "if", "loc": [284, 288], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L282_C8", "vector": [4, 3, 0.4974, 0.0087, 3, 0.38, 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_99324:Assign_L285_C12", "label": "jep = copy()", "type": "assigned_variable", "loc": [285, 285], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L284_C8", "vector": [14, 4, 0.4957, 0.0017, 4, 0.3, 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_99324:Expr_L287_C12", "label": "release()", "type": "expression", "loc": [287, 287], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L284_C8", "vector": [8, 4, 0.4991, 0.0017, 4, 0.3, 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_99324:Expr_L289_C8", "label": "release()", "type": "expression", "loc": [289, 289], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L280_C4", "vector": [8, 2, 0.5026, 0.0017, 2, 0.29, 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_99324:Return_L290_C8", "label": "return", "type": "return", "loc": [290, 290], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L280_C4", "vector": [13, 2, 0.5043, 0.0017, 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 jep"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L295_C4", "label": "set_jep", "type": "function", "loc": [295, 305], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.5217, 0.0191, 1, 0.97, 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_99324:If_L296_C8", "label": "if", "type": "if", "loc": [296, 301], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L295_C4", "vector": [4, 2, 0.5191, 0.0104, 2, 0.94, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 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_99324:Assign_L297_C12", "label": "pub =", "type": "assigned_variable", "loc": [297, 297], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L296_C8", "vector": [14, 3, 0.5165, 0.0017, 3, 0.98, 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_99324:If_L298_C8", "label": "if", "type": "if", "loc": [298, 301], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L296_C8", "vector": [4, 3, 0.5209, 0.007, 3, 0.98, 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_99324:Assign_L299_C12", "label": "pub =", "type": "assigned_variable", "loc": [299, 299], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L298_C8", "vector": [14, 4, 0.52, 0.0017, 4, 0.66, 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_99324:Assign_L302_C8", "label": "time_stamp = now()", "type": "assigned_variable", "loc": [302, 302], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L295_C4", "vector": [14, 2, 0.5252, 0.0017, 2, 0.94, 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_99324:Assign_L303_C8", "label": "h = Header()", "type": "assigned_variable", "loc": [303, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L295_C4", "vector": [14, 2, 0.527, 0.0017, 2, 0.94, 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_99324:Assign_L304_C8", "label": "h.stamp =", "type": "assigned_variable", "loc": [304, 304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L295_C4", "vector": [14, 2, 0.5287, 0.0017, 2, 0.94, 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_99324:Expr_L305_C8", "label": "publish()", "type": "expression", "loc": [305, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L295_C4", "vector": [8, 2, 0.5304, 0.0017, 2, 0.94, 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_99324:FunctionDef_L312_C4", "label": "go_jep", "type": "function", "loc": [312, 358], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.5826, 0.0817, 1, 0.97, 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_99324:If_L313_C8", "label": "if", "type": "if", "loc": [313, 314], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "vector": [4, 2, 0.5452, 0.0035, 2, 0.24, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if speed>math.radians(90.):\n speed = math.radians(90.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L314_C12", "label": "speed = radians()", "type": "assigned_variable", "loc": [314, 314], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L313_C8", "vector": [14, 3, 0.5461, 0.0017, 3, 0.55, 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_99324:Assign_L316_C8", "label": "qs_list, qe_list, ns_list, qstep_list =", "type": "assigned_variable", "loc": [316, 316], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "vector": [14, 2, 0.5496, 0.0017, 2, 0.24, 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_99324:Assign_L317_C8", "label": "done_list =", "type": "assigned_variable", "loc": [317, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "vector": [14, 2, 0.5513, 0.0017, 2, 0.24, 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_99324:Assign_L318_C8", "label": "time_between_cmds =", "type": "assigned_variable", "loc": [318, 318], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "vector": [14, 2, 0.553, 0.0017, 2, 0.24, 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_99324:Assign_L321_C8", "label": "qs = matrix()", "type": "assigned_variable", "loc": [321, 321], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "vector": [14, 2, 0.5583, 0.0017, 2, 0.24, 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_99324:Assign_L322_C8", "label": "qe = matrix()", "type": "assigned_variable", "loc": [322, 322], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "vector": [14, 2, 0.56, 0.0017, 2, 0.24, 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_99324:Assign_L323_C8", "label": "max_change = max()", "type": "assigned_variable", "loc": [323, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "vector": [14, 2, 0.5617, 0.0017, 2, 0.24, 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_99324:Assign_L325_C8", "label": "total_time =", "type": "assigned_variable", "loc": [325, 325], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "vector": [14, 2, 0.5652, 0.0017, 2, 0.24, 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_99324:Assign_L326_C8", "label": "n_steps = int()", "type": "assigned_variable", "loc": [326, 326], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "vector": [14, 2, 0.567, 0.0017, 2, 0.24, 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_99324:Assign_L328_C8", "label": "qstep =", "type": "assigned_variable", "loc": [328, 328], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "vector": [14, 2, 0.5704, 0.0017, 2, 0.24, 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_99324:If_L330_C8", "label": "if", "type": "if", "loc": [330, 333], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "vector": [4, 2, 0.5765, 0.007, 2, 0.24, 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_99324:Assign_L331_C12", "label": "done = stopping_function()", "type": "assigned_variable", "loc": [331, 331], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L330_C8", "vector": [14, 3, 0.5757, 0.0017, 3, 0.77, 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_99324:Assign_L333_C12", "label": "done =", "type": "assigned_variable", "loc": [333, 333], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L330_C8", "vector": [14, 3, 0.5791, 0.0017, 3, 0.77, 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_99324:Assign_L335_C8", "label": "step_number =", "type": "assigned_variable", "loc": [335, 335], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "vector": [14, 2, 0.5826, 0.0017, 2, 0.24, 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_99324:Assign_L336_C8", "label": "t0 = to_time()", "type": "assigned_variable", "loc": [336, 336], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "vector": [14, 2, 0.5843, 0.0017, 2, 0.24, 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_99324:Assign_L337_C8", "label": "t_end =", "type": "assigned_variable", "loc": [337, 337], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "vector": [14, 2, 0.5861, 0.0017, 2, 0.24, 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_99324:While_L338_C8", "label": "while", "type": "while", "loc": [338, 355], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "vector": [5, 2, 0.6026, 0.0313, 2, 0.24, 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_99324:Assign_L340_C12", "label": "t1 = to_time()", "type": "assigned_variable", "loc": [340, 340], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L338_C8", "vector": [14, 3, 0.5913, 0.0017, 3, 0.96, 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_99324:If_L342_C12", "label": "if", "type": "if", "loc": [342, 343], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L338_C8", "vector": [4, 3, 0.5957, 0.0035, 3, 0.96, 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_99324:Assign_L343_C16", "label": "done = stopping_function()", "type": "assigned_variable", "loc": [343, 343], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L342_C12", "vector": [14, 4, 0.5965, 0.0017, 4, 0.9, 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_99324:If_L344_C12", "label": "if", "type": "if", "loc": [344, 348], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L338_C8", "vector": [4, 3, 0.6017, 0.0087, 3, 0.96, 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_99324:Assign_L345_C16", "label": "q = tolist()", "type": "assigned_variable", "loc": [345, 345], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L344_C12", "vector": [14, 4, 0.6, 0.0017, 4, 0.92, 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_99324:Expr_L346_C16", "label": "set_jep()", "type": "expression", "loc": [346, 346], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L344_C12", "vector": [8, 4, 0.6017, 0.0017, 4, 0.92, 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_99324:Assign_L348_C16", "label": "done =", "type": "assigned_variable", "loc": [348, 348], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L344_C12", "vector": [14, 4, 0.6052, 0.0017, 4, 0.92, 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_99324:While_L350_C12", "label": "while", "type": "while", "loc": [350, 354], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L338_C8", "vector": [5, 3, 0.6122, 0.0087, 3, 0.96, 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_99324:If_L351_C16", "label": "if", "type": "if", "loc": [351, 352], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L350_C12", "vector": [4, 4, 0.6113, 0.0035, 4, 0.11, 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_99324:Assign_L352_C20", "label": "done =", "type": "assigned_variable", "loc": [352, 352], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L351_C16", "vector": [14, 5, 0.6122, 0.0017, 5, 0.05, 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_99324:Expr_L353_C16", "label": "sleep()", "type": "expression", "loc": [353, 353], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L350_C12", "vector": [8, 4, 0.6139, 0.0017, 4, 0.11, 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_99324:Assign_L354_C16", "label": "t1 = to_time()", "type": "assigned_variable", "loc": [354, 354], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L350_C12", "vector": [14, 4, 0.6157, 0.0017, 4, 0.11, 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_99324:Expr_L357_C8", "label": "sleep()", "type": "expression", "loc": [357, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "vector": [8, 2, 0.6209, 0.0017, 2, 0.24, 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_99324:Return_L358_C8", "label": "return", "type": "return", "loc": [358, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "vector": [13, 2, 0.6226, 0.0017, 2, 0.24, 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_99324:FunctionDef_L362_C4", "label": "stop", "type": "function", "loc": [362, 363], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.6304, 0.0035, 1, 0.97, 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_99324:Expr_L363_C8", "label": "publish()", "type": "expression", "loc": [363, 363], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L362_C4", "vector": [8, 2, 0.6313, 0.0017, 2, 0.64, 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_99324:FunctionDef_L365_C4", "label": "is_motor_power_on", "type": "function", "loc": [365, 366], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.6357, 0.0035, 1, 0.97, 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_99324:Return_L366_C8", "label": "return", "type": "return", "loc": [366, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L365_C4", "vector": [13, 2, 0.6365, 0.0017, 2, 0.38, 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_99324:FunctionDef_L368_C4", "label": "go_cep", "type": "function", "loc": [368, 384], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.6539, 0.0296, 1, 0.97, 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_99324:Assign_L370_C8", "label": "q = IK()", "type": "assigned_variable", "loc": [370, 370], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L368_C4", "vector": [14, 2, 0.6435, 0.0017, 2, 0.0, 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_99324:If_L371_C8", "label": "if", "type": "if", "loc": [371, 384], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L368_C4", "vector": [4, 2, 0.6565, 0.0243, 2, 0.0, 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_99324:Expr_L372_C12", "label": "print()", "type": "expression", "loc": [372, 372], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L371_C8", "vector": [8, 3, 0.647, 0.0017, 3, 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('IK soln NOT found.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L373_C12", "label": "print()", "type": "expression", "loc": [373, 373], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L371_C8", "vector": [8, 3, 0.6487, 0.0017, 3, 0.46, 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_99324:Return_L374_C12", "label": "return", "type": "return", "loc": [374, 374], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L371_C8", "vector": [13, 3, 0.6504, 0.0017, 3, 0.46, 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_99324:Assign_L376_C12", "label": "q_start = matrix()", "type": "assigned_variable", "loc": [376, 376], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L371_C8", "vector": [14, 3, 0.6539, 0.0017, 3, 0.46, 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_99324:Assign_L377_C12", "label": "p_start = FK()", "type": "assigned_variable", "loc": [377, 377], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L371_C8", "vector": [14, 3, 0.6557, 0.0017, 3, 0.46, 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_99324:Assign_L378_C12", "label": "q_end = matrix()", "type": "assigned_variable", "loc": [378, 378], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L371_C8", "vector": [14, 3, 0.6574, 0.0017, 3, 0.46, 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_99324:Assign_L380_C12", "label": "dist = norm()", "type": "assigned_variable", "loc": [380, 380], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L371_C8", "vector": [14, 3, 0.6609, 0.0017, 3, 0.46, 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_99324:Assign_L381_C12", "label": "total_time =", "type": "assigned_variable", "loc": [381, 381], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L371_C8", "vector": [14, 3, 0.6626, 0.0017, 3, 0.46, 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_99324:Assign_L382_C12", "label": "max_change = max()", "type": "assigned_variable", "loc": [382, 382], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L371_C8", "vector": [14, 3, 0.6643, 0.0017, 3, 0.46, 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_99324:Assign_L383_C12", "label": "ang_speed =", "type": "assigned_variable", "loc": [383, 383], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L371_C8", "vector": [14, 3, 0.6661, 0.0017, 3, 0.46, 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_99324:Return_L384_C12", "label": "return", "type": "return", "loc": [384, 384], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L371_C8", "vector": [13, 3, 0.6678, 0.0017, 3, 0.46, 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_99324:FunctionDef_L394_C4", "label": "go_cep_interpolate", "type": "function", "loc": [394, 441], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.7261, 0.0835, 1, 0.97, 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_99324:Assign_L396_C8", "label": "rot =", "type": "assigned_variable", "loc": [396, 396], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "vector": [14, 2, 0.6887, 0.0017, 2, 0.79, 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_99324:Assign_L397_C8", "label": "time_between_cmds =", "type": "assigned_variable", "loc": [397, 397], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "vector": [14, 2, 0.6904, 0.0017, 2, 0.79, 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_99324:Assign_L399_C8", "label": "q_guess = get_jep()", "type": "assigned_variable", "loc": [399, 399], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "vector": [14, 2, 0.6939, 0.0017, 2, 0.79, 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_99324:Assign_L400_C8", "label": "cep = FK()", "type": "assigned_variable", "loc": [400, 400], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "vector": [14, 2, 0.6957, 0.0017, 2, 0.79, 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_99324:If_L401_C8", "label": "if", "type": "if", "loc": [401, 402], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "vector": [4, 2, 0.6983, 0.0035, 2, 0.79, 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_99324:Assign_L402_C12", "label": "rot = FK_rot()", "type": "assigned_variable", "loc": [402, 402], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L401_C8", "vector": [14, 3, 0.6991, 0.0017, 3, 0.43, 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_99324:Assign_L404_C8", "label": "vec =", "type": "assigned_variable", "loc": [404, 404], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "vector": [14, 2, 0.7026, 0.0017, 2, 0.79, 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_99324:Assign_L405_C8", "label": "dist = norm()", "type": "assigned_variable", "loc": [405, 405], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "vector": [14, 2, 0.7043, 0.0017, 2, 0.79, 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_99324:Assign_L406_C8", "label": "total_time =", "type": "assigned_variable", "loc": [406, 406], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "vector": [14, 2, 0.7061, 0.0017, 2, 0.79, 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_99324:Assign_L407_C8", "label": "n_steps = int()", "type": "assigned_variable", "loc": [407, 407], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "vector": [14, 2, 0.7078, 0.0017, 2, 0.79, 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_99324:Assign_L408_C8", "label": "vec =", "type": "assigned_variable", "loc": [408, 408], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "vector": [14, 2, 0.7096, 0.0017, 2, 0.79, 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_99324:Assign_L409_C8", "label": "vec =", "type": "assigned_variable", "loc": [409, 409], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "vector": [14, 2, 0.7113, 0.0017, 2, 0.79, 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_99324:Assign_L411_C8", "label": "pt =", "type": "assigned_variable", "loc": [411, 411], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "vector": [14, 2, 0.7148, 0.0017, 2, 0.79, 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_99324:Assign_L412_C8", "label": "all_done =", "type": "assigned_variable", "loc": [412, 412], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "vector": [14, 2, 0.7165, 0.0017, 2, 0.79, 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_99324:Assign_L413_C8", "label": "i =", "type": "assigned_variable", "loc": [413, 413], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "vector": [14, 2, 0.7183, 0.0017, 2, 0.79, 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_99324:Assign_L414_C8", "label": "t0 = to_time()", "type": "assigned_variable", "loc": [414, 414], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "vector": [14, 2, 0.72, 0.0017, 2, 0.79, 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_99324:Assign_L415_C8", "label": "t_end =", "type": "assigned_variable", "loc": [415, 415], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "vector": [14, 2, 0.7217, 0.0017, 2, 0.79, 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_99324:While_L416_C8", "label": "while", "type": "while", "loc": [416, 440], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "vector": [5, 2, 0.7443, 0.0435, 2, 0.79, 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_99324:Assign_L418_C12", "label": "t1 = to_time()", "type": "assigned_variable", "loc": [418, 418], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L416_C8", "vector": [14, 3, 0.727, 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_99324:Assign_L419_C12", "label": "pt =", "type": "assigned_variable", "loc": [419, 419], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L416_C8", "vector": [14, 3, 0.7287, 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_99324:Assign_L420_C12", "label": "q = IK()", "type": "assigned_variable", "loc": [420, 420], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L416_C8", "vector": [14, 3, 0.7304, 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_99324:If_L422_C12", "label": "if", "type": "if", "loc": [422, 425], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L416_C8", "vector": [4, 3, 0.7365, 0.007, 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_99324:Assign_L423_C16", "label": "all_done =", "type": "assigned_variable", "loc": [423, 423], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L422_C12", "vector": [14, 4, 0.7357, 0.0017, 4, 0.69, 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_99324:Assign_L424_C16", "label": "stop =", "type": "assigned_variable", "loc": [424, 424], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L422_C12", "vector": [14, 4, 0.7374, 0.0017, 4, 0.69, 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_99324:Expr_L426_C12", "label": "set_jep()", "type": "expression", "loc": [426, 426], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L416_C8", "vector": [8, 3, 0.7409, 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_99324:Assign_L427_C12", "label": "q_guess =", "type": "assigned_variable", "loc": [427, 427], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L416_C8", "vector": [14, 3, 0.7426, 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_99324:While_L428_C12", "label": "while", "type": "while", "loc": [428, 435], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L416_C8", "vector": [5, 3, 0.7504, 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_99324:If_L429_C16", "label": "if", "type": "if", "loc": [429, 430], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L428_C12", "vector": [4, 4, 0.747, 0.0035, 4, 0.47, 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_99324:Assign_L430_C20", "label": "all_done = stopping_function()", "type": "assigned_variable", "loc": [430, 430], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L429_C16", "vector": [14, 5, 0.7478, 0.0017, 5, 0.07, 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_99324:If_L431_C16", "label": "if", "type": "if", "loc": [431, 433], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L428_C12", "vector": [4, 4, 0.7513, 0.0052, 4, 0.47, 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_99324:Assign_L432_C20", "label": "stop =", "type": "assigned_variable", "loc": [432, 432], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L431_C16", "vector": [14, 5, 0.7513, 0.0017, 5, 0.37, 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_99324:Expr_L434_C16", "label": "sleep()", "type": "expression", "loc": [434, 434], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L428_C12", "vector": [8, 4, 0.7548, 0.0017, 4, 0.47, 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_99324:Assign_L435_C16", "label": "t1 = to_time()", "type": "assigned_variable", "loc": [435, 435], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L428_C12", "vector": [14, 4, 0.7565, 0.0017, 4, 0.47, 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_99324:If_L438_C12", "label": "if", "type": "if", "loc": [438, 440], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L416_C8", "vector": [4, 3, 0.7635, 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_99324:Assign_L439_C16", "label": "all_done =", "type": "assigned_variable", "loc": [439, 439], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L438_C12", "vector": [14, 4, 0.7635, 0.0017, 4, 0.58, 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_99324:Assign_L440_C16", "label": "stop =", "type": "assigned_variable", "loc": [440, 440], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L438_C12", "vector": [14, 4, 0.7652, 0.0017, 4, 0.58, 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_99324:Return_L441_C8", "label": "return", "type": "return", "loc": [441, 441], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "vector": [13, 2, 0.767, 0.0017, 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 stop"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L447_C4", "label": "move_till_hit", "type": "function", "loc": [447, 469], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.7965, 0.04, 1, 0.97, 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_99324:Assign_L449_C8", "label": "unit_vec =", "type": "assigned_variable", "loc": [449, 449], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L447_C4", "vector": [14, 2, 0.7809, 0.0017, 2, 0.61, 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_99324:FunctionDef_L450_C8", "label": "stopping_function", "type": "function", "loc": [450, 458], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L447_C4", "vector": [2, 2, 0.7896, 0.0157, 2, 0.61, 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_99324:Assign_L451_C12", "label": "force = get_wrist_force()", "type": "assigned_variable", "loc": [451, 451], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L450_C8", "vector": [14, 3, 0.7843, 0.0017, 3, 0.79, 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_99324:Assign_L452_C12", "label": "force_projection =", "type": "assigned_variable", "loc": [452, 452], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L450_C8", "vector": [14, 3, 0.7861, 0.0017, 3, 0.79, 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_99324:If_L453_C12", "label": "if", "type": "if", "loc": [453, 458], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L450_C8", "vector": [4, 3, 0.7922, 0.0104, 3, 0.79, 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_99324:Return_L454_C16", "label": "return", "type": "return", "loc": [454, 454], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L453_C12", "vector": [13, 4, 0.7896, 0.0017, 4, 0.37, 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_99324:If_L455_C12", "label": "if", "type": "if", "loc": [455, 458], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L453_C12", "vector": [4, 4, 0.7939, 0.007, 4, 0.37, 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_99324:Return_L456_C16", "label": "return", "type": "return", "loc": [456, 456], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L455_C12", "vector": [13, 5, 0.793, 0.0017, 5, 0.15, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99324:Return_L458_C16", "label": "return", "type": "return", "loc": [458, 458], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L455_C12", "vector": [13, 5, 0.7965, 0.0017, 5, 0.15, 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_99324:Assign_L460_C8", "label": "jep = get_jep()", "type": "assigned_variable", "loc": [460, 460], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L447_C4", "vector": [14, 2, 0.8, 0.0017, 2, 0.61, 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_99324:Assign_L461_C8", "label": "cep, rot = FK_all()", "type": "assigned_variable", "loc": [461, 461], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L447_C4", "vector": [14, 2, 0.8017, 0.0017, 2, 0.61, 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_99324:If_L463_C8", "label": "if", "type": "if", "loc": [463, 464], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L447_C4", "vector": [4, 2, 0.8061, 0.0035, 2, 0.61, 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_99324:Expr_L464_C12", "label": "bias_wrist_ft()", "type": "expression", "loc": [464, 464], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L463_C8", "vector": [8, 3, 0.807, 0.0017, 3, 0.25, 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_99324:Expr_L465_C8", "label": "sleep()", "type": "expression", "loc": [465, 465], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L447_C4", "vector": [8, 2, 0.8087, 0.0017, 2, 0.61, 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_99324:Assign_L467_C8", "label": "p =", "type": "assigned_variable", "loc": [467, 467], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L447_C4", "vector": [14, 2, 0.8122, 0.0017, 2, 0.61, 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_99324:Return_L468_C8", "label": "return", "type": "return", "loc": [468, 469], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L447_C4", "vector": [13, 2, 0.8148, 0.0035, 2, 0.61, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.go_cep_interpolate(arm, p, rot, speed,\n stopping_function)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L471_C4", "label": "motors_off", "type": "function", "loc": [471, 472], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.82, 0.0035, 1, 0.97, 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_99324:Expr_L472_C8", "label": "publish()", "type": "expression", "loc": [472, 472], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L471_C4", "vector": [8, 2, 0.8209, 0.0017, 2, 0.76, 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_99324:FunctionDef_L480_C4", "label": "get_joint_velocities", "type": "function", "loc": [480, 481], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.8357, 0.0035, 1, 0.97, 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_99324:FunctionDef_L484_C4", "label": "get_joint_accelerations", "type": "function", "loc": [484, 485], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.8426, 0.0035, 1, 0.97, 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_99324:FunctionDef_L488_C4", "label": "get_joint_torques", "type": "function", "loc": [488, 489], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.8496, 0.0035, 1, 0.97, 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_99324:FunctionDef_L492_C4", "label": "get_wrist_torque", "type": "function", "loc": [492, 493], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.8565, 0.0035, 1, 0.97, 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_99324:FunctionDef_L496_C4", "label": "power_on", "type": "function", "loc": [496, 497], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "vector": [2, 1, 0.8635, 0.0035, 1, 0.97, 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_99324:If_L503_C0", "label": "if", "type": "if", "loc": [503, 571], "level": 0, "parent": null, "vector": [4, 0, 0.9339, 0.12, 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_99324:Import_L504_C4", "label": "arms import ar", "type": "import", "loc": [504, 504], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L503_C0", "vector": [1, 1, 0.8765, 0.0017, 1, 0.39, 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_99324:Import_L505_C4", "label": "m3.toolbox import m3t", "type": "import", "loc": [505, 505], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L503_C0", "vector": [1, 1, 0.8783, 0.0017, 1, 0.39, 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_99324:Import_L506_C4", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [506, 506], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L503_C0", "vector": [1, 1, 0.88, 0.0017, 1, 0.39, 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_99324:Assign_L508_C4", "label": "r_arm =", "type": "assigned_variable", "loc": [508, 508], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L503_C0", "vector": [14, 1, 0.8835, 0.0017, 1, 0.39, 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_99324:Assign_L509_C4", "label": "l_arm =", "type": "assigned_variable", "loc": [509, 509], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L503_C0", "vector": [14, 1, 0.8852, 0.0017, 1, 0.39, 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_99324:Assign_L511_C4", "label": "arms = M3HrlRobot()", "type": "assigned_variable", "loc": [511, 511], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L503_C0", "vector": [14, 1, 0.8887, 0.0017, 1, 0.39, 0.4545, 375, 3, 1, 0, 0, 305, 10, 1], "semantic": {"name": "arms", "arg_names": [], "import_names": [], "rhs_call_name": "M3HrlRobot", "annotation": ""}, "snippet": " arms = ar.M3HrlRobot(0.16)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L512_C4", "label": "ac = MekaArmClient()", "type": "assigned_variable", "loc": [512, 512], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L503_C0", "vector": [14, 1, 0.8904, 0.0017, 1, 0.39, 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_99324:If_L515_C4", "label": "if", "type": "if", "loc": [515, 520], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L503_C0", "vector": [4, 1, 0.9, 0.0104, 1, 0.39, 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_99324:Expr_L516_C8", "label": "bias_wrist_ft()", "type": "expression", "loc": [516, 516], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L515_C4", "vector": [8, 2, 0.8974, 0.0017, 2, 0.58, 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_99324:While_L517_C8", "label": "while", "type": "while", "loc": [517, 520], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L515_C4", "vector": [5, 2, 0.9017, 0.007, 2, 0.58, 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_99324:Assign_L518_C12", "label": "f = get_wrist_force()", "type": "assigned_variable", "loc": [518, 518], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L517_C8", "vector": [14, 3, 0.9009, 0.0017, 3, 0.34, 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_99324:Expr_L519_C12", "label": "print()", "type": "expression", "loc": [519, 519], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L517_C8", "vector": [8, 3, 0.9026, 0.0017, 3, 0.34, 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_99324:Expr_L520_C12", "label": "sleep()", "type": "expression", "loc": [520, 520], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L517_C8", "vector": [8, 3, 0.9043, 0.0017, 3, 0.34, 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_99324:If_L523_C4", "label": "if", "type": "if", "loc": [523, 542], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L503_C0", "vector": [4, 1, 0.9261, 0.0348, 1, 0.39, 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_99324:Expr_L524_C8", "label": "print()", "type": "expression", "loc": [524, 524], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L523_C4", "vector": [8, 2, 0.9113, 0.0017, 2, 0.89, 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_99324:Assign_L525_C8", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [525, 525], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L523_C4", "vector": [14, 2, 0.913, 0.0017, 2, 0.89, 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_99324:Assign_L527_C8", "label": "rot_mat = rotY()", "type": "assigned_variable", "loc": [527, 527], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L523_C4", "vector": [14, 2, 0.9165, 0.0017, 2, 0.89, 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_99324:Assign_L528_C8", "label": "p =", "type": "assigned_variable", "loc": [528, 528], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L523_C4", "vector": [14, 2, 0.9183, 0.0017, 2, 0.89, 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_99324:Expr_L532_C8", "label": "go_cep()", "type": "expression", "loc": [532, 532], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L523_C4", "vector": [8, 2, 0.9252, 0.0017, 2, 0.89, 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_99324:Expr_L537_C8", "label": "sleep()", "type": "expression", "loc": [537, 537], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L523_C4", "vector": [8, 2, 0.9339, 0.0017, 2, 0.89, 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_99324:Expr_L538_C8", "label": "raw_input()", "type": "expression", "loc": [538, 538], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L523_C4", "vector": [8, 2, 0.9357, 0.0017, 2, 0.89, 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_99324:Assign_L539_C8", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [539, 539], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L523_C4", "vector": [14, 2, 0.9374, 0.0017, 2, 0.89, 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_99324:Assign_L540_C8", "label": "ee = FK()", "type": "assigned_variable", "loc": [540, 540], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L523_C4", "vector": [14, 2, 0.9391, 0.0017, 2, 0.89, 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_99324:Expr_L541_C8", "label": "print()", "type": "expression", "loc": [541, 541], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L523_C4", "vector": [8, 2, 0.9409, 0.0017, 2, 0.89, 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_99324:Expr_L542_C8", "label": "print()", "type": "expression", "loc": [542, 542], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L523_C4", "vector": [8, 2, 0.9426, 0.0017, 2, 0.89, 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_99324:If_L544_C4", "label": "if", "type": "if", "loc": [544, 551], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L503_C0", "vector": [4, 1, 0.9522, 0.0139, 1, 0.39, 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_99324:Expr_L545_C8", "label": "print()", "type": "expression", "loc": [545, 545], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L544_C4", "vector": [8, 2, 0.9478, 0.0017, 2, 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('hit a key to float arms.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L546_C8", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [546, 546], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L544_C4", "vector": [14, 2, 0.9496, 0.0017, 2, 0.31, 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_99324:Expr_L547_C8", "label": "toggle_floating_arms()", "type": "expression", "loc": [547, 547], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L544_C4", "vector": [8, 2, 0.9513, 0.0017, 2, 0.31, 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_99324:Expr_L549_C8", "label": "print()", "type": "expression", "loc": [549, 549], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L544_C4", "vector": [8, 2, 0.9548, 0.0017, 2, 0.31, 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_99324:Assign_L550_C8", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [550, 550], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L544_C4", "vector": [14, 2, 0.9565, 0.0017, 2, 0.31, 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_99324:Expr_L551_C8", "label": "toggle_floating_arms()", "type": "expression", "loc": [551, 551], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L544_C4", "vector": [8, 2, 0.9583, 0.0017, 2, 0.31, 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_99324:If_L557_C4", "label": "if", "type": "if", "loc": [557, 561], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L503_C0", "vector": [4, 1, 0.9722, 0.0087, 1, 0.39, 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_99324:While_L558_C8", "label": "while", "type": "while", "loc": [558, 561], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L557_C4", "vector": [5, 2, 0.973, 0.007, 2, 0.85, 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_99324:Assign_L559_C12", "label": "jep = get_jep()", "type": "assigned_variable", "loc": [559, 559], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L558_C8", "vector": [14, 3, 0.9722, 0.0017, 3, 0.93, 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_99324:Expr_L560_C12", "label": "print()", "type": "expression", "loc": [560, 560], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L558_C8", "vector": [8, 3, 0.9739, 0.0017, 3, 0.93, 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_99324:Expr_L561_C12", "label": "sleep()", "type": "expression", "loc": [561, 561], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L558_C8", "vector": [8, 3, 0.9757, 0.0017, 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(0.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L563_C4", "label": "if", "type": "if", "loc": [563, 571], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L503_C0", "vector": [4, 1, 0.9861, 0.0157, 1, 0.39, 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_99324:Expr_L564_C8", "label": "sleep()", "type": "expression", "loc": [564, 564], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L563_C4", "vector": [8, 2, 0.9809, 0.0017, 2, 0.34, 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_99324:Assign_L565_C8", "label": "isc = get_impedance_scale()", "type": "assigned_variable", "loc": [565, 565], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L563_C4", "vector": [14, 2, 0.9826, 0.0017, 2, 0.34, 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_99324:Expr_L566_C8", "label": "print()", "type": "expression", "loc": [566, 566], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L563_C4", "vector": [8, 2, 0.9843, 0.0017, 2, 0.34, 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_99324:Assign_L567_C8", "label": "assign", "type": "assigned_variable", "loc": [567, 567], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L563_C4", "vector": [14, 2, 0.9861, 0.0017, 2, 0.34, 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_99324:Expr_L568_C8", "label": "set_impedance_scale()", "type": "expression", "loc": [568, 568], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L563_C4", "vector": [8, 2, 0.9878, 0.0017, 2, 0.34, 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_99324:Expr_L569_C8", "label": "sleep()", "type": "expression", "loc": [569, 569], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L563_C4", "vector": [8, 2, 0.9896, 0.0017, 2, 0.34, 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_99324:Assign_L570_C8", "label": "isc = get_impedance_scale()", "type": "assigned_variable", "loc": [570, 570], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L563_C4", "vector": [14, 2, 0.9913, 0.0017, 2, 0.34, 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_99324:Expr_L571_C8", "label": "print()", "type": "expression", "loc": [571, 571], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L563_C4", "vector": [8, 2, 0.993, 0.0017, 2, 0.34, 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_99324:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Return_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Try_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:Try_L113_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Return_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L195_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L195_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L195_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L197_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L198_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L197_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L199_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L200_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L199_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L202_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L195_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L195_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Return_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L207_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L207_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L207_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L210_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L211_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L211_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L212_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L211_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L214_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L210_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L215_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L216_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L216_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L217_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L216_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L219_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L215_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L221_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L207_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L207_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L207_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L226_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L227_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L207_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L229_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L229_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L230_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L229_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L231_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L229_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L232_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L207_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Return_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:For_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:For_L239_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L240_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:For_L239_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L241_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L247_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L254_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L255_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L256_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L257_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L256_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L258_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L259_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L258_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L261_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Return_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L268_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L268_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L269_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L270_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L269_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L271_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L272_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L268_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L268_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L268_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L268_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L280_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L280_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L281_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L280_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L282_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L282_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L283_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L282_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L284_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L284_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L285_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L284_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L287_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L280_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L289_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L280_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Return_L290_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L295_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L296_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L296_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L297_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L296_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L298_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L298_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L299_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L302_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L303_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L304_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L305_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L313_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L313_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L314_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L316_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L317_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L318_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L321_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L322_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L323_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L325_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L326_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L328_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L330_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L330_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L331_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L330_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L333_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L335_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L336_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L337_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L338_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L338_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L340_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L338_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L342_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L342_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L343_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L338_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L344_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L344_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L345_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L344_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L346_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L344_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L348_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L338_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L350_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L350_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L351_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L351_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L352_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L350_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L353_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L350_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L354_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L357_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Return_L358_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L362_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L362_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L363_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L365_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L365_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Return_L366_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L368_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L368_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L370_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L368_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L371_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L371_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L372_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L371_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L373_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L371_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Return_L374_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L371_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L376_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L371_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L377_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L371_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L378_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L371_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L380_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L371_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L381_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L371_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L382_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L371_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L383_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L371_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Return_L384_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L396_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L397_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L399_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L400_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L401_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L401_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L402_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L404_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L405_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L406_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L407_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L408_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L409_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L411_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L412_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L413_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L414_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L415_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L416_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L416_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L418_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L416_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L419_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L416_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L420_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L416_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L422_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L422_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L423_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L422_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L424_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L416_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L426_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L416_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L427_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L416_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L428_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L428_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L429_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L429_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L430_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L428_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L431_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L431_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L432_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L428_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L434_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L428_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L435_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L416_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L438_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L438_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L439_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L438_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L440_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Return_L441_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L447_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L447_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L449_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L447_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L450_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L450_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L451_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L450_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L452_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L450_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L453_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L453_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Return_L454_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L453_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L455_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L455_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Return_L456_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L455_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Return_L458_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L447_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L460_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L447_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L461_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L447_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L463_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L463_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L464_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L447_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L465_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L447_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L467_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L447_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Return_L468_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L471_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L471_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L472_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L480_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L484_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L488_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L492_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:FunctionDef_L496_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L503_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Import_L504_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L503_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Import_L505_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L503_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Import_L506_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L503_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L508_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L503_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L509_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L503_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L511_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L503_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L512_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L503_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L515_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L515_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L516_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L515_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L517_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L517_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L518_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L517_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L519_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L517_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L520_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L503_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L523_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L523_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L524_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L523_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L525_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L523_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L527_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L523_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L528_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L523_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L532_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L523_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L537_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L523_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L538_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L523_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L539_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L523_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L540_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L523_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L541_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L523_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L542_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L503_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L544_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L544_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L545_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L544_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L546_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L544_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L547_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L544_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L549_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L544_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L550_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L544_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L551_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L503_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L557_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L557_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L558_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L558_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L559_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L558_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L560_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:While_L558_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L561_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L503_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L563_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L563_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L564_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L563_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L565_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L563_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L566_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L563_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L567_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L563_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L568_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L563_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L569_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L563_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Assign_L570_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99324:If_L563_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99324:Expr_L571_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 numpy as np, math #np.set_printoptions(precision=4, linewidth=80) import matplotlib.pyplot as pp import roslib; roslib.load_manifest('hrl_cody_arms') import PyKDL as kdl from equilibrium_point_control.hrl_arm import HRLArmKinematics import create_IK_guess_dict as cgd import hrl_lib.transforms as tr import hrl_lib.util as ut import hrl_lib.kdl_utils as ku class CodyArmKinematics(HRLArmKinematics): # arm - 'r' or 'l' def __init__(self, arm): HRLArmKinematics.__init__(self, n_jts = 7) # create joint limit dicts if arm == 'r': max_lim = np.radians([ 120.00, 122.15, 77.5, 144., 122., 45., 45.]) min_lim = np.radians([ -47.61, -20., -77.5, 0., -80., -45., -45.]) else: max_lim = np.radians([ 120.00, 20., 77.5, 144., 80., 45., 45.]) min_lim = np.radians([ -47.61, -122.15, -77.5, 0., -122., -45., -45.]) self.joint_lim_dict = {} self.joint_lim_dict['max'] = max_lim self.joint_lim_dict['min'] = min_lim wrist_stub_length = 0.0135 + 0.04318 # wrist linkange and FT sensor lengths self.setup_kdl_chains(arm, wrist_stub_length) if arm == 'r': pkl_nm = 'q_guess_right_dict.pkl' else: pkl_nm = 'q_guess_left_dict.pkl' # Seems to pre-load the seed start values for IK. Set to none for the moment. pth = roslib.packages.get_pkg_dir('hrl_cody_arms') #roslib.rospack.rospackexec(['find', 'hrl_cody_arms']) q_guess_pkl = pth + '/src/hrl_cody_arms/'+pkl_nm self.q_guess_dict = None #ut.load_pickle(q_guess_pkl) self.arm_type = 'real' # for epc_skin_math #--------------- KDL stuff ---------------- # KDL joint array to meka joint list. (7->7) def kdl_angles_to_meka(self, 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) def meka_angles_to_kdl(self, 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] q[3] = -q_list[3] 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_chains(self, arm, end_effector_length): if arm == 'r': #right arm ch = self.create_right_chain(end_effector_length) fk, ik_v, ik_p, jac = self.create_solvers(ch) else: #left arm ch = self.create_left_chain(end_effector_length) fk, ik_v, ik_p, jac = self.create_solvers(ch) kdl_chains = {} kdl_chains['chain'] = ch kdl_chains['nJnts'] = ch.getNrOfJoints() kdl_chains['fk_p'] = fk kdl_chains['ik_v'] = ik_v kdl_chains['ik_p'] = ik_p kdl_chains['jacobian_solver'] = jac #Add both chains to dictionary self.kdl_chains = kdl_chains def FK_kdl(self, q, link_number): fk_solver = self.kdl_chains['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 IK_kdl(self,frame, q_init): nJnts = self.kdl_chains['nJnts'] ik_solver = self.kdl_chains['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: return None #-------------- implementation of HRLArmKinematics ----------- def FK_vanilla(self, q, link_number = 7): q = self.meka_angles_to_kdl(q) frame = self.FK_kdl(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 ## compute Jacobian at point pos. # p is in the ground coord frame. # this is a wrapper to try and not # break things after changes to PR2 # classes def jacobian(self, q, pos=None): return self.Jacobian(q, pos) ## compute Jacobian at point pos. # p is in the ground coord frame. def Jacobian(self, q, pos=None): if pos == None: pos = self.FK(q)[0] ch = self.kdl_chains['chain'] v_list = [] w_list = [] for i in xrange(self.n_jts): p, rot = self.FK_vanilla(q, i) r = pos - p z_idx = ch.getSegment(i).getJoint().getType() - 1 z = rot[:, z_idx] # this is a nasty trick. The rotation matrix returned by # FK_vanilla describes the orientation of a frame of the # KDL chain in the base frame. It just so happens that the # way Advait defined the KDL chain, the axis of rotation # in KDL is the -ve of the axis of rotation on the real # robot for every joint. # Advait apologizes for this. z = -z 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))) return J def IK_vanilla(self, 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: q_guess = cgd.find_good_config(p, self.q_guess_dict) q_guess = self.meka_angles_to_kdl(q_guess) q_res = self.IK_kdl(arm, fr, q_guess) q_res = self.kdl_angles_to_meka(arm, q_res) return q_res #----------- extra functions ----------------- ## clamp joint angles to their physical limits. # @param q - list of 7 joint angles. # The joint limits for IK are larger that the physical limits. def clamp_to_joint_limits(self, q, delta_list=[0.,0.,0.,0.,0.,0.,0.]): min_arr, max_arr = self.get_joint_limits() 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, q, delta_list=[0.,0.,0.,0.,0.,0.,0.]): min_arr, max_arr = self.get_joint_limits() 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)) def get_joint_limits(self): return self.joint_lim_dict['min'], self.joint_lim_dict['max'] #------------ 2D functions ------------ # plot the arm using matplotlib. def plot_arm(self, q, color='b', alpha=1.): pts = [[0.,0.,0.]] for i in range(len(q)): p = self.FK(q, i+1)[0] pts.append(p.A1.tolist()) pts_2d = np.array(pts)[:,0:2] direc_list = (pts_2d[1:] - pts_2d[:-1]).tolist() for i, d in enumerate(direc_list): d_vec = np.matrix(d).T d_vec = d_vec / np.linalg.norm(d_vec) w = np.cross(d_vec.A1, np.array([0., 0., 1.])) * 0.03/2 x1 = pts_2d[i,0] y1 = pts_2d[i,1] x2 = pts_2d[i+1,0] y2 = pts_2d[i+1,1] x_data = [x1+w[0], x1-w[0], x2-w[0], x2+w[0], x1+w[0]] y_data = [y1+w[1], y1-w[1], y2-w[1], y2+w[1], y1+w[1]] l, = pp.plot(x_data, y_data, color+'-', alpha=alpha)
ajibawa-2023/Python-Code-Large/train/row_99325
178
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_99325:Import_L31_C0", "label": "numpy import np, math", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.1037, 0.0033, 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_99325:Import_L34_C0", "label": "matplotlib.pyplot import pp", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.1137, 0.0033, 0, 0.66, 0.1, 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_99325:Import_L36_C0", "label": "roslib import roslib", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.1204, 0.0033, 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('hrl_cody_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L36_C15", "label": "load_manifest()", "type": "expression", "loc": [36, 36], "level": 0, "parent": null, "vector": [8, 0, 0.1204, 0.0033, 0, 0.66, 0.3, 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_cody_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Import_L37_C0", "label": "PyKDL import kdl", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.1237, 0.0033, 0, 0.66, 0.4, 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_99325:ImportFrom_L39_C0", "label": "from equilibrium_point_control.hrl_arm import HRLArmKinematics", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.1304, 0.0033, 0, 0.66, 0.5, 191, 0, 1, 0, 0, 191, 0, 0], "semantic": {"name": "equilibrium_point_control.hrl_arm", "arg_names": [], "import_names": ["HRLArmKinematics"], "rhs_call_name": "", "annotation": ""}, "snippet": "from equilibrium_point_control.hrl_arm import HRLArmKinematics"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Import_L40_C0", "label": "create_IK_guess_dict import cgd", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.1338, 0.0033, 0, 0.66, 0.6, 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_99325:Import_L42_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.1405, 0.0033, 0, 0.66, 0.7, 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_99325:Import_L43_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.1438, 0.0033, 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_99325:Import_L44_C0", "label": "hrl_lib.kdl_utils import ku", "type": "import", "loc": [44, 44], "level": 0, "parent": null, "vector": [1, 0, 0.1472, 0.0033, 0, 0.66, 0.9, 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_99325:ClassDef_L47_C0", "label": "CodyArmKinematics", "type": "class", "loc": [47, 293], "level": 0, "parent": null, "vector": [3, 0, 0.5686, 0.8261, 0, 0.66, 1.0, 11, 0, 17, 0, 0, 235, 0, 99], "semantic": {"name": "CodyArmKinematics", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CodyArmKinematics(HRLArmKinematics):\n # arm - 'r' or 'l'\n def __init__(self, arm):\n HRLArmKinematics.__init__(self, n_jts = 7)\n\n # create joint limit dicts\n if arm == 'r':\n max_lim = np.radians([ 120.00, 122.15, 77.5, 144., 122., 45., 45.])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "label": "__init__", "type": "function", "loc": [49, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "vector": [2, 1, 0.2107, 0.097, 1, 0.32, 0.0, 555, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "__init__", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arm):\n HRLArmKinematics.__init__(self, n_jts = 7)\n\n # create joint limit dicts\n if arm == 'r':\n max_lim = np.radians([ 120.00, 122.15, 77.5, 144., 122., 45., 45.])\n min_lim = np.radians([ -47.61, -20., -77.5, 0., -80., -45., -45.])\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L50_C8", "label": "__init__()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "vector": [8, 2, 0.1672, 0.0033, 2, 0.78, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " HRLArmKinematics.__init__(self, n_jts = 7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L53_C8", "label": "if", "type": "if", "loc": [53, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "vector": [4, 2, 0.1856, 0.0201, 2, 0.78, 0.0909, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'r':\n max_lim = np.radians([ 120.00, 122.15, 77.5, 144., 122., 45., 45.])\n min_lim = np.radians([ -47.61, -20., -77.5, 0., -80., -45., -45.])\n else:\n max_lim = np.radians([ 120.00, 20., 77.5, 144., 80., 45., 45.])\n min_lim = np.radians([ -47.61, -122.15, -77.5, 0., -122., -45., -45.])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L54_C12", "label": "max_lim = radians()", "type": "assigned_variable", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L53_C8", "vector": [14, 3, 0.1806, 0.0033, 3, 0.75, 0.0, 349, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "max_lim", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " max_lim = np.radians([ 120.00, 122.15, 77.5, 144., 122., 45., 45.])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L55_C12", "label": "min_lim = radians()", "type": "assigned_variable", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L53_C8", "vector": [14, 3, 0.1839, 0.0033, 3, 0.75, 0.3333, 23, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "min_lim", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " min_lim = np.radians([ -47.61, -20., -77.5, 0., -80., -45., -45.])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L57_C12", "label": "max_lim = radians()", "type": "assigned_variable", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L53_C8", "vector": [14, 3, 0.1906, 0.0033, 3, 0.75, 0.6667, 349, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "max_lim", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " max_lim = np.radians([ 120.00, 20., 77.5, 144., 80., 45., 45.])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L58_C12", "label": "min_lim = radians()", "type": "assigned_variable", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L53_C8", "vector": [14, 3, 0.194, 0.0033, 3, 0.75, 1.0, 23, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "min_lim", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " min_lim = np.radians([ -47.61, -122.15, -77.5, 0., -122., -45., -45.])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L60_C8", "label": "self.joint_lim_dict =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "vector": [14, 2, 0.2007, 0.0033, 2, 0.78, 0.1818, 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_99325:Assign_L61_C8", "label": "assign", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "vector": [14, 2, 0.204, 0.0033, 2, 0.78, 0.2727, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_lim_dict['max'] = max_lim"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L62_C8", "label": "assign", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "vector": [14, 2, 0.2074, 0.0033, 2, 0.78, 0.3636, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_lim_dict['min'] = min_lim"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L64_C8", "label": "wrist_stub_length =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "vector": [14, 2, 0.214, 0.0033, 2, 0.78, 0.4545, 181, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "wrist_stub_length", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wrist_stub_length = 0.0135 + 0.04318 # wrist linkange and FT sensor lengths"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L65_C8", "label": "setup_kdl_chains()", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "vector": [8, 2, 0.2174, 0.0033, 2, 0.78, 0.5455, 711, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "setup_kdl_chains", "arg_names": [], "import_names": [], "rhs_call_name": "setup_kdl_chains", "annotation": ""}, "snippet": " self.setup_kdl_chains(arm, wrist_stub_length)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L67_C8", "label": "if", "type": "if", "loc": [67, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "vector": [4, 2, 0.2291, 0.0134, 2, 0.78, 0.6364, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'r':\n pkl_nm = 'q_guess_right_dict.pkl'\n else:\n pkl_nm = 'q_guess_left_dict.pkl'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L68_C12", "label": "pkl_nm =", "type": "assigned_variable", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L67_C8", "vector": [14, 3, 0.2274, 0.0033, 3, 0.53, 0.0, 811, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "pkl_nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pkl_nm = 'q_guess_right_dict.pkl'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L70_C12", "label": "pkl_nm =", "type": "assigned_variable", "loc": [70, 70], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L67_C8", "vector": [14, 3, 0.2341, 0.0033, 3, 0.53, 1.0, 811, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "pkl_nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pkl_nm = 'q_guess_left_dict.pkl'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L73_C8", "label": "pth = get_pkg_dir()", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "vector": [14, 2, 0.2441, 0.0033, 2, 0.78, 0.7273, 224, 3, 1, 0, 0, 53, 10, 1], "semantic": {"name": "pth", "arg_names": [], "import_names": [], "rhs_call_name": "get_pkg_dir", "annotation": ""}, "snippet": " pth = roslib.packages.get_pkg_dir('hrl_cody_arms') #roslib.rospack.rospackexec(['find', 'hrl_cody_arms'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L74_C8", "label": "q_guess_pkl =", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "vector": [14, 2, 0.2475, 0.0033, 2, 0.78, 0.8182, 473, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q_guess_pkl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_guess_pkl = pth + '/src/hrl_cody_arms/'+pkl_nm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L75_C8", "label": "self.q_guess_dict =", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "vector": [14, 2, 0.2508, 0.0033, 2, 0.78, 0.9091, 930, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.q_guess_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_guess_dict = None #ut.load_pickle(q_guess_pkl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L77_C8", "label": "self.arm_type =", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "vector": [14, 2, 0.2575, 0.0033, 2, 0.78, 1.0, 333, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.arm_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_type = 'real' # for epc_skin_math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L81_C4", "label": "kdl_angles_to_meka", "type": "function", "loc": [81, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "vector": [2, 1, 0.291, 0.0435, 1, 0.32, 0.0625, 808, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "kdl_angles_to_meka", "arg_names": ["self", "q_jnt_arr"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def kdl_angles_to_meka(self, 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_99325:If_L82_C8", "label": "if", "type": "if", "loc": [82, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L81_C4", "vector": [4, 2, 0.2759, 0.0067, 2, 0.28, 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_99325:Return_L83_C12", "label": "return", "type": "return", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L82_C8", "vector": [13, 3, 0.2776, 0.0033, 3, 0.64, 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_99325:Assign_L85_C8", "label": "q_rad =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L81_C4", "vector": [14, 2, 0.2843, 0.0033, 2, 0.28, 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_99325:Assign_L86_C8", "label": "assign", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L81_C4", "vector": [14, 2, 0.2876, 0.0033, 2, 0.28, 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_99325:Assign_L87_C8", "label": "assign", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L81_C4", "vector": [14, 2, 0.291, 0.0033, 2, 0.28, 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_99325:Assign_L88_C8", "label": "assign", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L81_C4", "vector": [14, 2, 0.2943, 0.0033, 2, 0.28, 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_99325:Assign_L89_C8", "label": "assign", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L81_C4", "vector": [14, 2, 0.2977, 0.0033, 2, 0.28, 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_99325:Assign_L90_C8", "label": "assign", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L81_C4", "vector": [14, 2, 0.301, 0.0033, 2, 0.28, 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_99325:Assign_L91_C8", "label": "assign", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L81_C4", "vector": [14, 2, 0.3043, 0.0033, 2, 0.28, 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_99325:Assign_L92_C8", "label": "assign", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L81_C4", "vector": [14, 2, 0.3077, 0.0033, 2, 0.28, 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_99325:Return_L93_C8", "label": "return", "type": "return", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L81_C4", "vector": [13, 2, 0.311, 0.0033, 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 q_rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L96_C4", "label": "meka_angles_to_kdl", "type": "function", "loc": [96, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "vector": [2, 1, 0.3428, 0.0468, 1, 0.32, 0.125, 278, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "meka_angles_to_kdl", "arg_names": ["self", "q_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def meka_angles_to_kdl(self, 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_99325:If_L97_C8", "label": "if", "type": "if", "loc": [97, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L96_C4", "vector": [4, 2, 0.3261, 0.0067, 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 q_list == None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Return_L98_C12", "label": "return", "type": "return", "loc": [98, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L97_C8", "vector": [13, 3, 0.3278, 0.0033, 3, 0.58, 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_99325:Assign_L100_C8", "label": "n_joints = len()", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L96_C4", "vector": [14, 2, 0.3344, 0.0033, 2, 0.16, 0.1, 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_99325:Assign_L101_C8", "label": "q = JntArray()", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L96_C4", "vector": [14, 2, 0.3378, 0.0033, 2, 0.16, 0.2, 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_99325:Assign_L102_C8", "label": "assign", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L96_C4", "vector": [14, 2, 0.3411, 0.0033, 2, 0.16, 0.3, 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_99325:Assign_L103_C8", "label": "assign", "type": "assigned_variable", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L96_C4", "vector": [14, 2, 0.3445, 0.0033, 2, 0.16, 0.4, 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_99325:Assign_L104_C8", "label": "assign", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L96_C4", "vector": [14, 2, 0.3478, 0.0033, 2, 0.16, 0.5, 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_99325:Assign_L105_C8", "label": "assign", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L96_C4", "vector": [14, 2, 0.3512, 0.0033, 2, 0.16, 0.6, 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_99325:Assign_L106_C8", "label": "assign", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L96_C4", "vector": [14, 2, 0.3545, 0.0033, 2, 0.16, 0.7, 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_99325:Assign_L107_C8", "label": "assign", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L96_C4", "vector": [14, 2, 0.3579, 0.0033, 2, 0.16, 0.8, 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_99325:Assign_L108_C8", "label": "assign", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L96_C4", "vector": [14, 2, 0.3612, 0.0033, 2, 0.16, 0.9, 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_99325:Return_L109_C8", "label": "return", "type": "return", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L96_C4", "vector": [13, 2, 0.3645, 0.0033, 2, 0.16, 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_99325:FunctionDef_L111_C4", "label": "create_right_chain", "type": "function", "loc": [111, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "vector": [2, 1, 0.3863, 0.0334, 1, 0.32, 0.1875, 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_99325:Assign_L112_C8", "label": "ch = Chain()", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L111_C4", "vector": [14, 2, 0.3746, 0.0033, 2, 0.88, 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_99325:Expr_L113_C8", "label": "addSegment()", "type": "expression", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L111_C4", "vector": [8, 2, 0.3779, 0.0033, 2, 0.88, 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_99325:Expr_L114_C8", "label": "addSegment()", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L111_C4", "vector": [8, 2, 0.3813, 0.0033, 2, 0.88, 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_99325:Expr_L115_C8", "label": "addSegment()", "type": "expression", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L111_C4", "vector": [8, 2, 0.3846, 0.0033, 2, 0.88, 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_99325:Expr_L116_C8", "label": "addSegment()", "type": "expression", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L111_C4", "vector": [8, 2, 0.388, 0.0033, 2, 0.88, 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_99325:Expr_L117_C8", "label": "addSegment()", "type": "expression", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L111_C4", "vector": [8, 2, 0.3913, 0.0033, 2, 0.88, 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_99325:Expr_L118_C8", "label": "addSegment()", "type": "expression", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L111_C4", "vector": [8, 2, 0.3946, 0.0033, 2, 0.88, 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_99325:Expr_L119_C8", "label": "addSegment()", "type": "expression", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L111_C4", "vector": [8, 2, 0.398, 0.0033, 2, 0.88, 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_99325:Return_L120_C8", "label": "return", "type": "return", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L111_C4", "vector": [13, 2, 0.4013, 0.0033, 2, 0.88, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ch"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L122_C4", "label": "create_left_chain", "type": "function", "loc": [122, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "vector": [2, 1, 0.4231, 0.0334, 1, 0.32, 0.25, 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_99325:Assign_L123_C8", "label": "ch = Chain()", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L122_C4", "vector": [14, 2, 0.4114, 0.0033, 2, 0.73, 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_99325:Expr_L124_C8", "label": "addSegment()", "type": "expression", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L122_C4", "vector": [8, 2, 0.4147, 0.0033, 2, 0.73, 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_99325:Expr_L125_C8", "label": "addSegment()", "type": "expression", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L122_C4", "vector": [8, 2, 0.4181, 0.0033, 2, 0.73, 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_99325:Expr_L126_C8", "label": "addSegment()", "type": "expression", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L122_C4", "vector": [8, 2, 0.4214, 0.0033, 2, 0.73, 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_99325:Expr_L127_C8", "label": "addSegment()", "type": "expression", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L122_C4", "vector": [8, 2, 0.4247, 0.0033, 2, 0.73, 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_99325:Expr_L128_C8", "label": "addSegment()", "type": "expression", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L122_C4", "vector": [8, 2, 0.4281, 0.0033, 2, 0.73, 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_99325:Expr_L129_C8", "label": "addSegment()", "type": "expression", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L122_C4", "vector": [8, 2, 0.4314, 0.0033, 2, 0.73, 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_99325:Expr_L130_C8", "label": "addSegment()", "type": "expression", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L122_C4", "vector": [8, 2, 0.4348, 0.0033, 2, 0.73, 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_99325:Return_L131_C8", "label": "return", "type": "return", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L122_C4", "vector": [13, 2, 0.4381, 0.0033, 2, 0.73, 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_99325:FunctionDef_L133_C4", "label": "create_solvers", "type": "function", "loc": [133, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "vector": [2, 1, 0.4532, 0.0201, 1, 0.32, 0.3125, 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_99325:Assign_L134_C9", "label": "fk = ChainFkSolverPos_recursive()", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L133_C4", "vector": [14, 2, 0.4482, 0.0033, 2, 0.45, 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_99325:Assign_L135_C9", "label": "ik_v = ChainIkSolverVel_pinv()", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L133_C4", "vector": [14, 2, 0.4515, 0.0033, 2, 0.45, 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_99325:Assign_L136_C9", "label": "ik_p = ChainIkSolverPos_NR()", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L133_C4", "vector": [14, 2, 0.4548, 0.0033, 2, 0.45, 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_99325:Assign_L137_C9", "label": "jac = ChainJntToJacSolver()", "type": "assigned_variable", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L133_C4", "vector": [14, 2, 0.4582, 0.0033, 2, 0.45, 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_99325:Return_L138_C9", "label": "return", "type": "return", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L133_C4", "vector": [13, 2, 0.4615, 0.0033, 2, 0.45, 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_99325:FunctionDef_L140_C4", "label": "setup_kdl_chains", "type": "function", "loc": [140, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "vector": [2, 1, 0.5, 0.0669, 1, 0.32, 0.375, 711, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "setup_kdl_chains", "arg_names": ["self", "arm", "end_effector_length"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setup_kdl_chains(self, arm, end_effector_length):\n if arm == 'r':\n #right arm\n ch = self.create_right_chain(end_effector_length)\n fk, ik_v, ik_p, jac = self.create_solvers(ch)\n else:\n #left arm\n ch = self.create_left_chain(end_effector_length)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L141_C8", "label": "if", "type": "if", "loc": [141, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L140_C4", "vector": [4, 2, 0.4833, 0.0268, 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 arm == 'r':\n #right arm\n ch = self.create_right_chain(end_effector_length)\n fk, ik_v, ik_p, jac = self.create_solvers(ch)\n else:\n #left arm\n ch = self.create_left_chain(end_effector_length)\n fk, ik_v, ik_p, jac = self.create_solvers(ch)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L143_C12", "label": "ch = create_right_chain()", "type": "assigned_variable", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L141_C8", "vector": [14, 3, 0.4783, 0.0033, 3, 0.2, 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_99325:Assign_L144_C12", "label": "fk, ik_v, ik_p, jac = create_solvers()", "type": "assigned_variable", "loc": [144, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L141_C8", "vector": [14, 3, 0.4816, 0.0033, 3, 0.2, 0.3333, 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_99325:Assign_L147_C12", "label": "ch = create_left_chain()", "type": "assigned_variable", "loc": [147, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L141_C8", "vector": [14, 3, 0.4916, 0.0033, 3, 0.2, 0.6667, 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_99325:Assign_L148_C12", "label": "fk, ik_v, ik_p, jac = create_solvers()", "type": "assigned_variable", "loc": [148, 148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L141_C8", "vector": [14, 3, 0.495, 0.0033, 3, 0.2, 1.0, 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_99325:Assign_L150_C8", "label": "kdl_chains =", "type": "assigned_variable", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L140_C4", "vector": [14, 2, 0.5017, 0.0033, 2, 0.95, 0.125, 749, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "kdl_chains", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kdl_chains = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L151_C8", "label": "assign", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L140_C4", "vector": [14, 2, 0.505, 0.0033, 2, 0.95, 0.25, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kdl_chains['chain'] = ch"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L152_C8", "label": " = getNrOfJoints()", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L140_C4", "vector": [14, 2, 0.5084, 0.0033, 2, 0.95, 0.375, 0, 3, 0, 0, 0, 822, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "getNrOfJoints", "annotation": ""}, "snippet": " kdl_chains['nJnts'] = ch.getNrOfJoints()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L153_C8", "label": "assign", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L140_C4", "vector": [14, 2, 0.5117, 0.0033, 2, 0.95, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kdl_chains['fk_p'] = fk"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L154_C8", "label": "assign", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L140_C4", "vector": [14, 2, 0.5151, 0.0033, 2, 0.95, 0.625, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kdl_chains['ik_v'] = ik_v"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L155_C8", "label": "assign", "type": "assigned_variable", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L140_C4", "vector": [14, 2, 0.5184, 0.0033, 2, 0.95, 0.75, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kdl_chains['ik_p'] = ik_p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L156_C8", "label": "assign", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L140_C4", "vector": [14, 2, 0.5217, 0.0033, 2, 0.95, 0.875, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kdl_chains['jacobian_solver'] = jac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L159_C8", "label": "self.kdl_chains =", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L140_C4", "vector": [14, 2, 0.5318, 0.0033, 2, 0.95, 1.0, 397, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.kdl_chains", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.kdl_chains = kdl_chains"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L161_C4", "label": "FK_kdl", "type": "function", "loc": [161, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "vector": [2, 1, 0.5552, 0.0368, 1, 0.32, 0.4375, 929, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "FK_kdl", "arg_names": ["self", "q", "link_number"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def FK_kdl(self, q, link_number):\n fk_solver = self.kdl_chains['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_99325:Assign_L162_C8", "label": "fk_solver =", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L161_C4", "vector": [14, 2, 0.5418, 0.0033, 2, 0.82, 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.kdl_chains['fk_p']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L163_C8", "label": "endeffec_frame = Frame()", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L161_C4", "vector": [14, 2, 0.5452, 0.0033, 2, 0.82, 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_99325:Assign_L164_C8", "label": "kinematics_status = JntToCart()", "type": "assigned_variable", "loc": [164, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L161_C4", "vector": [14, 2, 0.5502, 0.0067, 2, 0.82, 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_99325:If_L166_C8", "label": "if", "type": "if", "loc": [166, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L161_C4", "vector": [4, 2, 0.5635, 0.0201, 2, 0.82, 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_99325:Return_L168_C12", "label": "return", "type": "return", "loc": [168, 168], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L166_C8", "vector": [13, 3, 0.5619, 0.0033, 3, 0.59, 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_99325:Expr_L170_C12", "label": "print()", "type": "expression", "loc": [170, 170], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L166_C8", "vector": [8, 3, 0.5686, 0.0033, 3, 0.59, 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_99325:Return_L171_C12", "label": "return", "type": "return", "loc": [171, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L166_C8", "vector": [13, 3, 0.5719, 0.0033, 3, 0.59, 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_99325:FunctionDef_L173_C4", "label": "IK_kdl", "type": "function", "loc": [173, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "vector": [2, 1, 0.5936, 0.0334, 1, 0.32, 0.5, 753, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "IK_kdl", "arg_names": ["self", "frame", "q_init"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def IK_kdl(self,frame, q_init):\n nJnts = self.kdl_chains['nJnts']\n ik_solver = self.kdl_chains['ik_p']\n q = kdl.JntArray(nJnts)\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_99325:Assign_L174_C8", "label": "nJnts =", "type": "assigned_variable", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L173_C4", "vector": [14, 2, 0.5819, 0.0033, 2, 0.23, 0.0, 851, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "nJnts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " nJnts = self.kdl_chains['nJnts']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L175_C8", "label": "ik_solver =", "type": "assigned_variable", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L173_C4", "vector": [14, 2, 0.5853, 0.0033, 2, 0.23, 0.3333, 705, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ik_solver", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_solver = self.kdl_chains['ik_p']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L176_C8", "label": "q = JntArray()", "type": "assigned_variable", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L173_C4", "vector": [14, 2, 0.5886, 0.0033, 2, 0.23, 0.6667, 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_99325:If_L177_C8", "label": "if", "type": "if", "loc": [177, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L173_C4", "vector": [4, 2, 0.6003, 0.0201, 2, 0.23, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 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 return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L178_C12", "label": "for i", "type": "for", "loc": [178, 179], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L177_C8", "vector": [6, 3, 0.597, 0.0067, 3, 0.33, 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_99325:Assign_L179_C16", "label": " = angle_within_mod180()", "type": "assigned_variable", "loc": [179, 179], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L178_C12", "vector": [14, 4, 0.5987, 0.0033, 4, 0.64, 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_99325:Return_L180_C12", "label": "return", "type": "return", "loc": [180, 180], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L177_C8", "vector": [13, 3, 0.602, 0.0033, 3, 0.33, 0.5, 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_99325:Return_L182_C12", "label": "return", "type": "return", "loc": [182, 182], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L177_C8", "vector": [13, 3, 0.6087, 0.0033, 3, 0.33, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L186_C4", "label": "FK_vanilla", "type": "function", "loc": [186, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "vector": [2, 1, 0.6338, 0.0268, 1, 0.32, 0.5625, 646, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "FK_vanilla", "arg_names": ["self", "q", "link_number"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def FK_vanilla(self, q, link_number = 7):\n q = self.meka_angles_to_kdl(q)\n frame = self.FK_kdl(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_99325:Assign_L187_C8", "label": "q = meka_angles_to_kdl()", "type": "assigned_variable", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L186_C4", "vector": [14, 2, 0.6254, 0.0033, 2, 0.77, 0.0, 516, 3, 1, 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(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L188_C8", "label": "frame = FK_kdl()", "type": "assigned_variable", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L186_C4", "vector": [14, 2, 0.6288, 0.0033, 2, 0.77, 0.1667, 313, 3, 2, 0, 0, 929, 10, 1], "semantic": {"name": "frame", "arg_names": [], "import_names": [], "rhs_call_name": "FK_kdl", "annotation": ""}, "snippet": " frame = self.FK_kdl(q, link_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L189_C8", "label": "pos =", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L186_C4", "vector": [14, 2, 0.6321, 0.0033, 2, 0.77, 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_99325:Assign_L190_C8", "label": "pos = kdl_vec_to_np()", "type": "assigned_variable", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L186_C4", "vector": [14, 2, 0.6355, 0.0033, 2, 0.77, 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_99325:Assign_L191_C8", "label": "m =", "type": "assigned_variable", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L186_C4", "vector": [14, 2, 0.6388, 0.0033, 2, 0.77, 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_99325:Assign_L192_C8", "label": "rot = kdl_rot_to_np()", "type": "assigned_variable", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L186_C4", "vector": [14, 2, 0.6421, 0.0033, 2, 0.77, 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_99325:Return_L193_C8", "label": "return", "type": "return", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L186_C4", "vector": [13, 2, 0.6455, 0.0033, 2, 0.77, 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_99325:FunctionDef_L201_C4", "label": "jacobian", "type": "function", "loc": [201, 202], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "vector": [2, 1, 0.6739, 0.0067, 1, 0.32, 0.625, 8, 0, 3, 1, 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 return self.Jacobian(q, pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Return_L202_C8", "label": "return", "type": "return", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L201_C4", "vector": [13, 2, 0.6756, 0.0033, 2, 0.85, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.Jacobian(q, pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L206_C4", "label": "Jacobian", "type": "function", "loc": [206, 233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "vector": [2, 1, 0.7341, 0.0936, 1, 0.32, 0.6875, 182, 0, 3, 1, 0, 0, 0, 13], "semantic": {"name": "Jacobian", "arg_names": ["self", "q", "pos"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def Jacobian(self, q, pos=None):\n if pos == None:\n pos = self.FK(q)[0]\n\n ch = self.kdl_chains['chain']\n v_list = []\n w_list = []\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L207_C8", "label": "if", "type": "if", "loc": [207, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L206_C4", "vector": [4, 2, 0.694, 0.0067, 2, 0.36, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pos == None:\n pos = self.FK(q)[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L208_C12", "label": "pos =", "type": "assigned_variable", "loc": [208, 208], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L207_C8", "vector": [14, 3, 0.6957, 0.0033, 3, 0.47, 0.0, 627, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = self.FK(q)[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L210_C8", "label": "ch =", "type": "assigned_variable", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L206_C4", "vector": [14, 2, 0.7023, 0.0033, 2, 0.36, 0.1667, 263, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ch", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ch = self.kdl_chains['chain']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L211_C8", "label": "v_list =", "type": "assigned_variable", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L206_C4", "vector": [14, 2, 0.7057, 0.0033, 2, 0.36, 0.3333, 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_99325:Assign_L212_C8", "label": "w_list =", "type": "assigned_variable", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L206_C4", "vector": [14, 2, 0.709, 0.0033, 2, 0.36, 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_99325:For_L214_C8", "label": "for i", "type": "for", "loc": [214, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L206_C4", "vector": [6, 2, 0.7425, 0.0569, 2, 0.36, 0.6667, 826, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange(self.n_jts):\n p, rot = self.FK_vanilla(q, i)\n r = pos - p\n z_idx = ch.getSegment(i).getJoint().getType() - 1\n z = rot[:, z_idx]\n\n # this is a nasty trick. The rotation matrix returned by\n # FK_vanilla describes the orientation of a frame of the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L215_C12", "label": "p, rot = FK_vanilla()", "type": "assigned_variable", "loc": [215, 215], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L214_C8", "vector": [14, 3, 0.7191, 0.0033, 3, 0.69, 0.0, 466, 3, 2, 0, 0, 646, 10, 1], "semantic": {"name": "p, rot", "arg_names": [], "import_names": [], "rhs_call_name": "FK_vanilla", "annotation": ""}, "snippet": " p, rot = self.FK_vanilla(q, i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L216_C12", "label": "r =", "type": "assigned_variable", "loc": [216, 216], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L214_C8", "vector": [14, 3, 0.7224, 0.0033, 3, 0.69, 0.1667, 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_99325:Assign_L217_C12", "label": "z_idx =", "type": "assigned_variable", "loc": [217, 217], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L214_C8", "vector": [14, 3, 0.7258, 0.0033, 3, 0.69, 0.3333, 160, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "z_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_idx = ch.getSegment(i).getJoint().getType() - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L218_C12", "label": "z =", "type": "assigned_variable", "loc": [218, 218], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L214_C8", "vector": [14, 3, 0.7291, 0.0033, 3, 0.69, 0.5, 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_99325:Assign_L227_C12", "label": "z =", "type": "assigned_variable", "loc": [227, 227], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L214_C8", "vector": [14, 3, 0.7592, 0.0033, 3, 0.69, 0.6667, 859, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = -z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L229_C12", "label": "append()", "type": "expression", "loc": [229, 229], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L214_C8", "vector": [8, 3, 0.7659, 0.0033, 3, 0.69, 0.8333, 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_99325:Expr_L230_C12", "label": "append()", "type": "expression", "loc": [230, 230], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L214_C8", "vector": [8, 3, 0.7692, 0.0033, 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": " w_list.append(z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L232_C8", "label": "J = row_stack()", "type": "assigned_variable", "loc": [232, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L206_C4", "vector": [14, 2, 0.7759, 0.0033, 2, 0.36, 0.8333, 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_99325:Return_L233_C8", "label": "return", "type": "return", "loc": [233, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L206_C4", "vector": [13, 2, 0.7793, 0.0033, 2, 0.36, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return J"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L235_C4", "label": "IK_vanilla", "type": "function", "loc": [235, 246], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "vector": [2, 1, 0.8043, 0.0401, 1, 0.32, 0.75, 969, 0, 4, 1, 0, 0, 0, 7], "semantic": {"name": "IK_vanilla", "arg_names": ["self", "p", "rot", "q_guess"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def IK_vanilla(self, 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 q_guess = cgd.find_good_config(p, self.q_guess_dict)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L236_C8", "label": "p_kdl = np_vec_to_kdl()", "type": "assigned_variable", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L235_C4", "vector": [14, 2, 0.7893, 0.0033, 2, 0.45, 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_99325:Assign_L237_C8", "label": "rot_kdl = np_rot_to_kdl()", "type": "assigned_variable", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L235_C4", "vector": [14, 2, 0.7926, 0.0033, 2, 0.45, 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_99325:Assign_L238_C8", "label": "fr = Frame()", "type": "assigned_variable", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L235_C4", "vector": [14, 2, 0.796, 0.0033, 2, 0.45, 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_99325:If_L240_C8", "label": "if", "type": "if", "loc": [240, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L235_C4", "vector": [4, 2, 0.8043, 0.0067, 2, 0.45, 0.4286, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if q_guess == None:\n q_guess = cgd.find_good_config(p, self.q_guess_dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L241_C12", "label": "q_guess = find_good_config()", "type": "assigned_variable", "loc": [241, 241], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L240_C8", "vector": [14, 3, 0.806, 0.0033, 3, 0.61, 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)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L243_C8", "label": "q_guess = meka_angles_to_kdl()", "type": "assigned_variable", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L235_C4", "vector": [14, 2, 0.8127, 0.0033, 2, 0.45, 0.5714, 993, 3, 1, 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(q_guess)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L244_C8", "label": "q_res = IK_kdl()", "type": "assigned_variable", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L235_C4", "vector": [14, 2, 0.8161, 0.0033, 2, 0.45, 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_99325:Assign_L245_C8", "label": "q_res = kdl_angles_to_meka()", "type": "assigned_variable", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L235_C4", "vector": [14, 2, 0.8194, 0.0033, 2, 0.45, 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_99325:Return_L246_C8", "label": "return", "type": "return", "loc": [246, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L235_C4", "vector": [13, 2, 0.8227, 0.0033, 2, 0.45, 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_99325:FunctionDef_L253_C4", "label": "clamp_to_joint_limits", "type": "function", "loc": [253, 257], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "vector": [2, 1, 0.8528, 0.0167, 1, 0.32, 0.8125, 606, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "clamp_to_joint_limits", "arg_names": ["self", "q", "delta_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def clamp_to_joint_limits(self, q, delta_list=[0.,0.,0.,0.,0.,0.,0.]):\n min_arr, max_arr = self.get_joint_limits()\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_99325:Assign_L254_C8", "label": "min_arr, max_arr = get_joint_limits()", "type": "assigned_variable", "loc": [254, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L253_C4", "vector": [14, 2, 0.8495, 0.0033, 2, 0.0, 0.0, 583, 3, 0, 0, 0, 13, 10, 1], "semantic": {"name": "min_arr, max_arr", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_limits", "annotation": ""}, "snippet": " min_arr, max_arr = self.get_joint_limits()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L255_C8", "label": "q_arr = array()", "type": "assigned_variable", "loc": [255, 255], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L253_C4", "vector": [14, 2, 0.8528, 0.0033, 2, 0.0, 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_99325:Assign_L256_C8", "label": "d_arr = array()", "type": "assigned_variable", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L253_C4", "vector": [14, 2, 0.8562, 0.0033, 2, 0.0, 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_99325:Return_L257_C8", "label": "return", "type": "return", "loc": [257, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L253_C4", "vector": [13, 2, 0.8595, 0.0033, 2, 0.0, 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_99325:FunctionDef_L259_C4", "label": "within_joint_limits", "type": "function", "loc": [259, 263], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "vector": [2, 1, 0.8729, 0.0167, 1, 0.32, 0.875, 596, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "within_joint_limits", "arg_names": ["self", "q", "delta_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def within_joint_limits(self, q, delta_list=[0.,0.,0.,0.,0.,0.,0.]):\n min_arr, max_arr = self.get_joint_limits()\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_99325:Assign_L260_C8", "label": "min_arr, max_arr = get_joint_limits()", "type": "assigned_variable", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L259_C4", "vector": [14, 2, 0.8696, 0.0033, 2, 0.76, 0.0, 583, 3, 0, 0, 0, 13, 10, 1], "semantic": {"name": "min_arr, max_arr", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_limits", "annotation": ""}, "snippet": " min_arr, max_arr = self.get_joint_limits()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L261_C8", "label": "q_arr = array()", "type": "assigned_variable", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L259_C4", "vector": [14, 2, 0.8729, 0.0033, 2, 0.76, 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_99325:Assign_L262_C8", "label": "d_arr = array()", "type": "assigned_variable", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L259_C4", "vector": [14, 2, 0.8763, 0.0033, 2, 0.76, 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_99325:Return_L263_C8", "label": "return", "type": "return", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L259_C4", "vector": [13, 2, 0.8796, 0.0033, 2, 0.76, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.all((q_arr <= max_arr+d_arr, q_arr >= min_arr-d_arr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L265_C4", "label": "get_joint_limits", "type": "function", "loc": [265, 266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "vector": [2, 1, 0.888, 0.0067, 1, 0.32, 0.9375, 13, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_joint_limits", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_joint_limits(self):\n return self.joint_lim_dict['min'], self.joint_lim_dict['max']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Return_L266_C8", "label": "return", "type": "return", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L265_C4", "vector": [13, 2, 0.8896, 0.0033, 2, 0.59, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.joint_lim_dict['min'], self.joint_lim_dict['max']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L272_C4", "label": "plot_arm", "type": "function", "loc": [272, 293], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "vector": [2, 1, 0.9448, 0.0736, 1, 0.32, 1.0, 796, 0, 4, 0, 0, 0, 0, 13], "semantic": {"name": "plot_arm", "arg_names": ["self", "q", "color", "alpha"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def plot_arm(self, q, color='b', alpha=1.):\n pts = [[0.,0.,0.]]\n for i in range(len(q)):\n p = self.FK(q, i+1)[0]\n pts.append(p.A1.tolist())\n\n pts_2d = np.array(pts)[:,0:2]\n direc_list = (pts_2d[1:] - pts_2d[:-1]).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L273_C8", "label": "pts =", "type": "assigned_variable", "loc": [273, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L272_C4", "vector": [14, 2, 0.913, 0.0033, 2, 0.71, 0.0, 195, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = [[0.,0.,0.]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L274_C8", "label": "for i", "type": "for", "loc": [274, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L272_C4", "vector": [6, 2, 0.9197, 0.01, 2, 0.71, 0.25, 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(q)):\n p = self.FK(q, i+1)[0]\n pts.append(p.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L275_C12", "label": "p =", "type": "assigned_variable", "loc": [275, 275], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L274_C8", "vector": [14, 3, 0.9197, 0.0033, 3, 0.54, 0.0, 491, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = self.FK(q, i+1)[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L276_C12", "label": "append()", "type": "expression", "loc": [276, 276], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L274_C8", "vector": [8, 3, 0.9231, 0.0033, 3, 0.54, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " pts.append(p.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L278_C8", "label": "pts_2d =", "type": "assigned_variable", "loc": [278, 278], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L272_C4", "vector": [14, 2, 0.9298, 0.0033, 2, 0.71, 0.5, 945, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts_2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_2d = np.array(pts)[:,0:2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L279_C8", "label": "direc_list = tolist()", "type": "assigned_variable", "loc": [279, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L272_C4", "vector": [14, 2, 0.9331, 0.0033, 2, 0.71, 0.75, 388, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "direc_list", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " direc_list = (pts_2d[1:] - pts_2d[:-1]).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L281_C8", "label": "for i, d", "type": "for", "loc": [281, 293], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L272_C4", "vector": [6, 2, 0.9599, 0.0435, 2, 0.71, 1.0, 775, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "i, d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, d in enumerate(direc_list):\n d_vec = np.matrix(d).T\n d_vec = d_vec / np.linalg.norm(d_vec)\n w = np.cross(d_vec.A1, np.array([0., 0., 1.])) * 0.03/2\n x1 = pts_2d[i,0]\n y1 = pts_2d[i,1]\n x2 = pts_2d[i+1,0]\n y2 = pts_2d[i+1,1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L282_C12", "label": "d_vec =", "type": "assigned_variable", "loc": [282, 282], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L281_C8", "vector": [14, 3, 0.9431, 0.0033, 3, 0.11, 0.0, 131, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "d_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d_vec = np.matrix(d).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L283_C12", "label": "d_vec =", "type": "assigned_variable", "loc": [283, 283], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L281_C8", "vector": [14, 3, 0.9465, 0.0033, 3, 0.11, 0.1111, 131, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "d_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d_vec = d_vec / np.linalg.norm(d_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L284_C12", "label": "w =", "type": "assigned_variable", "loc": [284, 284], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L281_C8", "vector": [14, 3, 0.9498, 0.0033, 3, 0.11, 0.2222, 549, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " w = np.cross(d_vec.A1, np.array([0., 0., 1.])) * 0.03/2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L285_C12", "label": "x1 =", "type": "assigned_variable", "loc": [285, 285], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L281_C8", "vector": [14, 3, 0.9532, 0.0033, 3, 0.11, 0.3333, 634, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x1 = pts_2d[i,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L286_C12", "label": "y1 =", "type": "assigned_variable", "loc": [286, 286], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L281_C8", "vector": [14, 3, 0.9565, 0.0033, 3, 0.11, 0.4444, 361, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y1 = pts_2d[i,1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L287_C12", "label": "x2 =", "type": "assigned_variable", "loc": [287, 287], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L281_C8", "vector": [14, 3, 0.9599, 0.0033, 3, 0.11, 0.5556, 837, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x2 = pts_2d[i+1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L288_C12", "label": "y2 =", "type": "assigned_variable", "loc": [288, 288], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L281_C8", "vector": [14, 3, 0.9632, 0.0033, 3, 0.11, 0.6667, 160, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y2 = pts_2d[i+1,1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L290_C12", "label": "x_data =", "type": "assigned_variable", "loc": [290, 290], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L281_C8", "vector": [14, 3, 0.9699, 0.0033, 3, 0.11, 0.7778, 734, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "x_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_data = [x1+w[0], x1-w[0], x2-w[0], x2+w[0], x1+w[0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L291_C12", "label": "y_data =", "type": "assigned_variable", "loc": [291, 291], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L281_C8", "vector": [14, 3, 0.9732, 0.0033, 3, 0.11, 0.8889, 102, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "y_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_data = [y1+w[1], y1-w[1], y2-w[1], y2+w[1], y1+w[1]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L293_C12", "label": "l = plot()", "type": "assigned_variable", "loc": [293, 293], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L281_C8", "vector": [14, 3, 0.9799, 0.0033, 3, 0.11, 1.0, 810, 3, 4, 0, 0, 929, 10, 1], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " l, = pp.plot(x_data, y_data, color+'-', alpha=alpha)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L70_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Return_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Return_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L97_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Return_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Return_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Return_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Return_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L134_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L135_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L136_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L137_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Return_L138_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L141_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L141_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L144_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L141_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L141_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L148_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L166_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Return_L168_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L166_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L170_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L166_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Return_L171_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L177_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L178_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L178_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L179_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L177_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Return_L180_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L177_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Return_L182_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L186_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Return_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L201_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L201_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Return_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L206_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L207_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L208_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L214_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L215_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L214_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L216_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L214_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L217_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L214_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L218_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L214_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L227_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L214_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L229_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L214_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L230_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Return_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:If_L240_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L241_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Return_L246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L253_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L253_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L254_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L253_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L255_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L253_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L253_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Return_L257_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L259_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L259_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L259_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L259_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L259_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Return_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L265_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L265_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Return_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L272_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L272_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L272_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L274_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L274_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L275_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L274_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Expr_L276_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L272_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L272_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L279_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:FunctionDef_L272_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L281_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L281_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L282_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L281_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L283_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L281_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L284_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L281_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L285_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L281_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L286_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L281_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L287_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L281_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L288_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L281_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L290_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L281_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L291_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99325:For_L281_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99325:Assign_L293_C12"}]
#!/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 # moved this to the top to get PyKDL from the ROS package for the Meka # modules as well. import roslib; roslib.load_manifest('hrl_cody_arms') roslib.load_manifest('force_torque') # Advait hack on Oct 25, 2011 import force_torque.FTClient as ftc 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 cody_arm_client as ac import numpy as np, math import sys, time, os import copy from threading import RLock import rospy import hrl_lib.transforms as tr from hrl_msgs.msg import FloatArray from std_msgs.msg import Header, Bool, Empty 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, use_netft_r = False, use_netft_l = False, enable_right_arm=True, enable_left_arm=True): self.arm_settings = {} # dict is set in set_arm_settings 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'))} # 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, 1e-3, 1e-3, 1e-3] self.R_force['right_arm'] = [0.1**2, 0.1**2, 0.1**2, 0.05**2, 0.05**2, 0.05**2] self.xhat_force['right_arm'] = [0., 0., 0., 0., 0., 0.] self.P_force['right_arm'] = [1.0, 1.0, 1.0, 0., 0., 0.] self.Q_force['left_arm'] = [1e-3, 1e-3, 1e-3, 1e-3, 1e-3, 1e-3] self.R_force['left_arm'] = [0.1**2, 0.1**2, 0.1**2, 0.05**2, 0.05**2, 0.05**2] self.xhat_force['left_arm'] = [0., 0., 0., 0., 0., 0.] self.P_force['left_arm'] = [1.0, 1.0, 1.0, 0., 0., 0.] self.enable_left_arm = enable_left_arm self.enable_right_arm = enable_right_arm if not enable_right_arm: right_arm_settings = None self.right_arm_ft = None self.Q_force['right_arm'] = None self.R_force['right_arm'] = None self.P_force['right_arm'] = None self.xhat_force['right_arm'] = None if not enable_left_arm: left_arm_settings = None self.left_arm_ft = None self.Q_force['left_arm'] = None self.R_force['left_arm'] = None self.P_force['left_arm'] = None self.xhat_force['left_arm'] = None self.initialize_joints(right_arm_settings, left_arm_settings) #self.initialize_gripper() #----- ROS interface --------- rospy.init_node('arm_server', anonymous=False) if use_netft_r: self.ftclient_r = ftc.FTClient('force_torque_ft5', True) self.ftclient_r.bias() else: self.ftclient_r = None if use_netft_l: self.ftclient_l = ftc.FTClient('force_torque_ft6', True) self.ftclient_l.bias() else: self.ftclient_l = None self.q_r_pub = rospy.Publisher('/r_arm/q', FloatArray) self.q_l_pub = rospy.Publisher('/l_arm/q', FloatArray) self.qdot_r_pub = rospy.Publisher('/r_arm/qdot', FloatArray) self.qdot_l_pub = rospy.Publisher('/l_arm/qdot', 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.torque_r_pub = rospy.Publisher('/r_arm/joint_torque', FloatArray) self.torque_l_pub = rospy.Publisher('/l_arm/joint_torque', FloatArray) self.mot_temp_r_pub = rospy.Publisher('/r_arm/joint_motor_temp', FloatArray) self.mot_temp_l_pub = rospy.Publisher('/l_arm/joint_motor_temp', 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.q_r = None # using this to compute qdot self.q_l = None # using this to compute qdot self.q_rHOT = None # using this to compute qdot # added_by_tapo, Jan 23-2013 self.q_lHOT = None # using this to compute qdot # added_by_tapo, Jan 23-2013 self.time_stamp = None # using this to compute qdot d = {} d['right_arm'] = ac.get_joint_name_list('r') d['left_arm'] = ac.get_joint_name_list('l') self.joint_names_list = d 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: if joint_component_list != 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(True, True) # the second true enables ROS (needed for the skin patch) l1 = ['m3pwr_pwr003'] if self.enable_right_arm: l1.append('m3loadx6_ma1_l0') l1.append('m3arm_ma1') if left_arm_settings is not None: l1.append('m3loadx6_ma2_l0') l1.append('m3arm_ma2') for c in l1: if not self.proxy.is_component_available(c): raise m3t.M3Exception('Component '+c+' is not available.') self.joint_list_dict = {} if self.enable_right_arm: 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 else: self.joint_list_dict['right_arm'] = None if self.enable_left_arm: 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 else: self.joint_list_dict['left_arm'] = None 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) self.pwr=m3f.create_component('m3pwr_pwr003') self.proxy.subscribe_status(self.pwr) self.proxy.publish_command(self.pwr) self.arms = {} if self.enable_right_arm: right_fts=m3.loadx6.M3LoadX6('m3loadx6_ma1_l0') self.proxy.subscribe_status(right_fts) self.arms['right_arm']=m3.arm.M3Arm('m3arm_ma1') self.proxy.subscribe_status(self.arms['right_arm']) else: right_fts = None self.arms['right_arm'] = None if self.enable_left_arm: left_fts=m3.loadx6.M3LoadX6('m3loadx6_ma2_l0') self.proxy.subscribe_status(left_fts) self.arms['left_arm']=m3.arm.M3Arm('m3arm_ma2') self.proxy.subscribe_status(self.arms['left_arm']) else: left_fts = None self.arms['left_arm'] = None self.fts = {'right_arm':right_fts,'left_arm':left_fts} 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() l = [] if self.enable_right_arm: l.append('right_arm') if self.enable_left_arm: l.append('left_arm') for arm in l: z = self.get_wrist_force(arm).A1 # Force vector #if arm == 'right_arm': # z = self.get_wrist_force_nano().A1 for i in range(6): 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() if self.enable_left_arm: l_jep = copy.copy(self.l_jep) l_alpha = copy.copy(self.arm_settings['left_arm'].stiffness_list) if self.enable_right_arm: r_jep = copy.copy(self.r_jep) r_alpha = copy.copy(self.arm_settings['right_arm'].stiffness_list) self.cb_lock.release() if self.enable_left_arm: self.set_jep(l_arm, l_jep) self.set_alpha(l_arm, l_alpha) if self.enable_right_arm: self.set_jep(r_arm, r_jep) self.set_alpha(r_arm, r_alpha) self.step() motor_pwr_state = self.is_motor_power_on() if not motor_pwr_state: self.maintain_configuration() if self.enable_right_arm: q_r = self.get_joint_angles(r_arm) tau_r = self.get_joint_torques(r_arm) mot_temp_r = self.get_motor_temps(r_arm) else: q_r = None tau_r = None mot_temp_r = None if self.enable_left_arm: q_l = self.get_joint_angles(l_arm) tau_l = self.get_joint_torques(l_arm) mot_temp_l = self.get_motor_temps(l_arm) else: q_l = None tau_l = None mot_temp_l = None # it seems like this estimate of joint velocity should really be filtered # or at least a better estimate of the derivative (higher order difference equation) # - marc Jul 13, 2012 # added one more term to achieve a better estimate of the derivative - tapo Jan 23, 2013 t_now = rospy.get_time() if self.q_r != None and self.q_l != None and self.q_rHOT != None and self.q_lHOT != None and self.time_stamp != None: dt = t_now - self.time_stamp #qdot_r = (np.array(q_r) - np.array(self.q_r)) / dt qdot_r = (-np.array(q_r) + 4*np.array(self.q_r) - 3*np.array(self.q_rHOT)) / (2*dt) #qdot_l = (np.array(q_l) - np.array(self.q_l)) / dt qdot_l = (-np.array(q_l) + 4*np.array(self.q_l) - 3*np.array(self.q_lHOT)) / (2*dt) else: qdot_r = np.zeros(7) qdot_l = np.zeros(7) self.q_rHOT = self.q_r self.q_lHOT = self.q_l self.q_r = q_r self.q_l = q_l self.time_stamp = t_now if self.enable_right_arm: f_raw_r = self.get_wrist_force(r_arm).A1.tolist() f_r = self.xhat_force[r_arm] if self.enable_left_arm: f_raw_l = self.get_wrist_force(l_arm).A1.tolist() f_l = self.xhat_force[l_arm] # publish stuff over ROS. time_stamp = rospy.Time.now() h = Header() h.stamp = time_stamp h.frame_id = '/torso_lift_link' pos = [] nms = [] if self.enable_right_arm: self.q_r_pub.publish(FloatArray(h, q_r)) self.qdot_r_pub.publish(FloatArray(h, qdot_r)) self.jep_r_pub.publish(FloatArray(h, r_jep)) self.alph_r_pub.publish(FloatArray(h, r_alpha)) self.torque_r_pub.publish(FloatArray(h, tau_r)) self.mot_temp_r_pub.publish(FloatArray(h, mot_temp_r)) nms = nms + self.joint_names_list['right_arm'] pos = pos + q_r h.frame_id = 'should_not_be_using_this' self.force_raw_r_pub.publish(FloatArray(h, f_raw_r)) self.force_r_pub.publish(FloatArray(h, f_r)) if enable_left_arm: self.q_l_pub.publish(FloatArray(h, q_l)) self.qdot_l_pub.publish(FloatArray(h, qdot_l)) self.jep_l_pub.publish(FloatArray(h, l_jep)) self.alph_l_pub.publish(FloatArray(h, l_alpha)) self.torque_l_pub.publish(FloatArray(h, tau_l)) self.mot_temp_l_pub.publish(FloatArray(h, mot_temp_l)) nms = nms + self.joint_names_list['left_arm'] pos = pos + q_l h.frame_id = 'should_not_be_using_this' self.force_raw_l_pub.publish(FloatArray(h, f_raw_l)) self.force_l_pub.publish(FloatArray(h, f_l)) self.joint_state_pub.publish(JointState(h, nms, pos, [0.]*len(pos), [0.]*len(pos))) 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): l = [] if self.enable_left_arm: l.append('left_arm') if self.enable_right_arm: l.append('right_arm') for arm in l: 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): if arm == 'right_arm' and self.ftclient_r != None: return self.get_wrist_force_netft('r') if arm == 'left_arm' and self.ftclient_l != None: return self.get_wrist_force_netft('l') 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.append(lc.get_Tx_mNm()/1000.) m.append(lc.get_Ty_mNm()/1000.) m.append(-lc.get_Tz_mNm()/1000.) m = np.matrix(m).T r = tr.Rz(math.radians(-30.0)) m1 = r * m[0:3,:] m1[1,0] = -m1[1,0] m1[2,0] = -m1[2,0] m2 = r * m[3:,:] m2[1,0] = -m2[1,0] m2[2,0] = -m2[2,0] return np.row_stack((m1, m2)) def get_wrist_force_netft(self, arm): if arm == 'r': w = self.ftclient_r.read() elif arm == 'l': w = self.ftclient_l.read() r = tr.Rz(math.radians(30.)) f = r * w[0:3] t = r * w[0:3] f[1,0] = f[1,0] * -1 t[1,0] = t[1,0] * -1 return np.row_stack((f,t)) def get_wrist_torque(self, arm): m = [] lc = self.fts[arm] 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 #-------------------- 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() raise RuntimeError('The meka joint accelerations are incorrect (Because the joint velocities are incorrect - Tapo, Jan 23, 2013). Computing my own joint accelerations.') ## # @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() raise RuntimeError('The meka joint velocities seem incorrect. (Advait, July 6, 2011). Computing my own joint velocities.') def get_joint_torques(self, arm): ''' returns list of 7 joint torques in mNm ''' return self.arms[arm].get_torque_mNm().tolist() def get_motor_temps(self, arm): ''' returns list of 7 motor temperatures in Celsius ''' return self.arms[arm].get_motor_temp_C().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__': import optparse p = optparse.OptionParser() p.add_option('--enable_net_ft_r', action='store_true', dest='netft_r', help='use net ft for the right arm') p.add_option('--enable_net_ft_l', action='store_true', dest='netft_l', help='use net ft for the left arm') #Tiffany 11/11/2011 p.add_option('--arm_to_use', action='store', dest='arm_to_use', help='use only one arm (l or r)', type='string') opt, args = p.parse_args() 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 if opt.arm_to_use == 'l': enable_left_arm = True enable_right_arm = False elif opt.arm_to_use == 'r': enable_left_arm = False enable_right_arm = True elif opt.arm_to_use == 'b': enable_right_arm = True enable_left_arm = True else: raise RuntimeError('Unrecognized value for the arm_to_use command line argument') cody_arms = MekaArmServer(settings_r, settings_l, opt.netft_r, opt.netft_l, enable_right_arm, enable_left_arm) # 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_99326
463
752
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Import_L33_C0", "label": "roslib import roslib", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.0439, 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('hrl_cody_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L33_C15", "label": "load_manifest()", "type": "expression", "loc": [33, 33], "level": 0, "parent": null, "vector": [8, 0, 0.0439, 0.0013, 0, 0.66, 0.037, 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_cody_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L34_C0", "label": "load_manifest()", "type": "expression", "loc": [34, 34], "level": 0, "parent": null, "vector": [8, 0, 0.0452, 0.0013, 0, 0.66, 0.0741, 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') # Advait hack on Oct 25, 2011"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Import_L36_C0", "label": "force_torque.FTClient import ftc", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.0479, 0.0013, 0, 0.66, 0.1111, 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_99326:Import_L39_C0", "label": "m3.rt_proxy import m3p", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.0519, 0.0013, 0, 0.66, 0.1481, 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_99326:Import_L40_C0", "label": "m3.arm import m3.arm", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.0532, 0.0013, 0, 0.66, 0.1852, 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_99326:Import_L41_C0", "label": "m3.toolbox import m3t", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.0545, 0.0013, 0, 0.66, 0.2222, 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_99326:Import_L42_C0", "label": "m3.pwr import m3w", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.0559, 0.0013, 0, 0.66, 0.2593, 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_99326:Import_L43_C0", "label": "m3.loadx6 import m3.loadx6", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.0572, 0.0013, 0, 0.66, 0.2963, 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_99326:Import_L45_C0", "label": "m3.component_factory import m3f", "type": "import", "loc": [45, 45], "level": 0, "parent": null, "vector": [1, 0, 0.0598, 0.0013, 0, 0.66, 0.3333, 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_99326:Import_L47_C0", "label": "cody_arm_client import ac", "type": "import", "loc": [47, 47], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0013, 0, 0.66, 0.3704, 943, 0, 1, 0, 0, 943, 0, 0], "semantic": {"name": "cody_arm_client", "arg_names": [], "import_names": ["ac"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cody_arm_client as ac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Import_L49_C0", "label": "numpy import np, math", "type": "import", "loc": [49, 49], "level": 0, "parent": null, "vector": [1, 0, 0.0652, 0.0013, 0, 0.66, 0.4074, 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_99326:Import_L50_C0", "label": "sys import sys, time, os", "type": "import", "loc": [50, 50], "level": 0, "parent": null, "vector": [1, 0, 0.0665, 0.0013, 0, 0.66, 0.4444, 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_99326:Import_L51_C0", "label": "copy import copy", "type": "import", "loc": [51, 51], "level": 0, "parent": null, "vector": [1, 0, 0.0678, 0.0013, 0, 0.66, 0.4815, 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_99326:ImportFrom_L52_C0", "label": "from threading import RLock", "type": "import", "loc": [52, 52], "level": 0, "parent": null, "vector": [1, 0, 0.0691, 0.0013, 0, 0.66, 0.5185, 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_99326:Import_L54_C0", "label": "rospy import rospy", "type": "import", "loc": [54, 54], "level": 0, "parent": null, "vector": [1, 0, 0.0718, 0.0013, 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_99326:Import_L56_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [56, 56], "level": 0, "parent": null, "vector": [1, 0, 0.0745, 0.0013, 0, 0.66, 0.5926, 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_99326:ImportFrom_L57_C0", "label": "from hrl_msgs.msg import FloatArray", "type": "import", "loc": [57, 57], "level": 0, "parent": null, "vector": [1, 0, 0.0758, 0.0013, 0, 0.66, 0.6296, 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_99326:ImportFrom_L58_C0", "label": "from std_msgs.msg import Header, Bool, Empty", "type": "import", "loc": [58, 58], "level": 0, "parent": null, "vector": [1, 0, 0.0771, 0.0013, 0, 0.66, 0.6667, 366, 0, 3, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Header", "Bool", "Empty"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Header, Bool, Empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:ImportFrom_L60_C0", "label": "from sensor_msgs.msg import JointState", "type": "import", "loc": [60, 60], "level": 0, "parent": null, "vector": [1, 0, 0.0798, 0.0013, 0, 0.66, 0.7037, 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_99326:Assign_L62_C0", "label": "THETA_GC =", "type": "assigned_variable", "loc": [62, 62], "level": 0, "parent": null, "vector": [14, 0, 0.0824, 0.0013, 0, 0.66, 0.7407, 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_99326:Assign_L63_C0", "label": "TORQUE_GC =", "type": "assigned_variable", "loc": [63, 63], "level": 0, "parent": null, "vector": [14, 0, 0.0838, 0.0013, 0, 0.66, 0.7778, 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_99326:Assign_L64_C0", "label": "THETA =", "type": "assigned_variable", "loc": [64, 64], "level": 0, "parent": null, "vector": [14, 0, 0.0851, 0.0013, 0, 0.66, 0.8148, 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_99326:Assign_L65_C0", "label": "OFF =", "type": "assigned_variable", "loc": [65, 65], "level": 0, "parent": null, "vector": [14, 0, 0.0864, 0.0013, 0, 0.66, 0.8519, 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_99326:FunctionDef_L69_C0", "label": "kalman_update", "type": "function", "loc": [69, 77], "level": 0, "parent": null, "vector": [2, 0, 0.0971, 0.012, 0, 0.66, 0.8889, 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_99326:Assign_L71_C4", "label": "xhatminus =", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L69_C0", "vector": [14, 1, 0.0944, 0.0013, 1, 0.7, 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_99326:Assign_L72_C4", "label": "Pminus =", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L69_C0", "vector": [14, 1, 0.0957, 0.0013, 1, 0.7, 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_99326:Assign_L74_C4", "label": "K =", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L69_C0", "vector": [14, 1, 0.0984, 0.0013, 1, 0.7, 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_99326:Assign_L75_C4", "label": "xhat =", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L69_C0", "vector": [14, 1, 0.0997, 0.0013, 1, 0.7, 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_99326:Assign_L76_C4", "label": "P =", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L69_C0", "vector": [14, 1, 0.1011, 0.0013, 1, 0.7, 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_99326:Return_L77_C4", "label": "return", "type": "return", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L69_C0", "vector": [13, 1, 0.1024, 0.0013, 1, 0.7, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return xhat, P"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L79_C0", "label": "MekaArmSettings", "type": "class", "loc": [79, 92], "level": 0, "parent": null, "vector": [3, 0, 0.1137, 0.0186, 0, 0.66, 0.9259, 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_99326:FunctionDef_L80_C4", "label": "__init__", "type": "function", "loc": [80, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L79_C0", "vector": [2, 1, 0.1104, 0.0093, 1, 0.65, 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_99326:Expr_L82_C8", "label": "expression", "type": "expression", "loc": [82, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L80_C4", "vector": [8, 2, 0.1104, 0.004, 2, 0.01, 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_99326:Expr_L85_C8", "label": "set_stiffness_scale()", "type": "expression", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L80_C4", "vector": [8, 2, 0.113, 0.0013, 2, 0.01, 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_99326:Assign_L86_C8", "label": "self.control_mode =", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L80_C4", "vector": [14, 2, 0.1144, 0.0013, 2, 0.01, 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_99326:FunctionDef_L88_C4", "label": "set_stiffness_scale", "type": "function", "loc": [88, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L79_C0", "vector": [2, 1, 0.1197, 0.0066, 1, 0.65, 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_99326:Assign_L91_C8", "label": " = min()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L88_C4", "vector": [14, 2, 0.121, 0.0013, 2, 0.75, 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_99326:Assign_L92_C8", "label": "self.stiffness_list =", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L88_C4", "vector": [14, 2, 0.1223, 0.0013, 2, 0.75, 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_99326:ClassDef_L95_C0", "label": "MekaArmServer", "type": "class", "loc": [95, 691], "level": 0, "parent": null, "vector": [3, 0, 0.5226, 0.7939, 0, 0.66, 0.963, 388, 0, 27, 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,\n left_arm_settings=None, use_netft_r = False,\n use_netft_l = False, enable_right_arm=True,\n enable_left_arm=True):\n self.arm_settings = {} # dict is set in set_arm_settings\n\n self.left_arm_ft = {'force': np.matrix(np.zeros((3,1),dtype='float32')),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "label": "__init__", "type": "function", "loc": [96, 209], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.2028, 0.1516, 1, 0.3, 0.0, 555, 0, 7, 0, 0, 0, 0, 41], "semantic": {"name": "__init__", "arg_names": ["self", "right_arm_settings", "left_arm_settings", "use_netft_r", "use_netft_l", "enable_right_arm", "enable_left_arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, right_arm_settings=None,\n left_arm_settings=None, use_netft_r = False,\n use_netft_l = False, enable_right_arm=True,\n enable_left_arm=True):\n self.arm_settings = {} # dict is set in set_arm_settings\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_99326:Assign_L100_C8", "label": "self.arm_settings =", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.133, 0.0013, 2, 0.4, 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_99326:Assign_L102_C8", "label": "self.left_arm_ft =", "type": "assigned_variable", "loc": [102, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.1363, 0.0027, 2, 0.4, 0.0179, 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_99326:Assign_L104_C8", "label": "self.right_arm_ft =", "type": "assigned_variable", "loc": [104, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.139, 0.0027, 2, 0.4, 0.0357, 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_99326:Assign_L108_C8", "label": "assign", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.1436, 0.0013, 2, 0.4, 0.0536, 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_99326:Assign_L109_C8", "label": "assign", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.1449, 0.0013, 2, 0.4, 0.0714, 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_99326:Assign_L111_C8", "label": "assign", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.1476, 0.0013, 2, 0.4, 0.0893, 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, 1e-3, 1e-3, 1e-3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L112_C8", "label": "assign", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.1489, 0.0013, 2, 0.4, 0.1071, 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.1**2, 0.1**2, 0.1**2, 0.05**2, 0.05**2, 0.05**2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L113_C8", "label": "assign", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.1503, 0.0013, 2, 0.4, 0.125, 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., 0., 0., 0.]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L114_C8", "label": "assign", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.1516, 0.0013, 2, 0.4, 0.1429, 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, 0., 0., 0.]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L116_C8", "label": "assign", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.1543, 0.0013, 2, 0.4, 0.1607, 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, 1e-3, 1e-3, 1e-3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L117_C8", "label": "assign", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.1556, 0.0013, 2, 0.4, 0.1786, 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.1**2, 0.1**2, 0.1**2, 0.05**2, 0.05**2, 0.05**2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L118_C8", "label": "assign", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.1569, 0.0013, 2, 0.4, 0.1964, 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., 0., 0., 0.]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L119_C8", "label": "assign", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.1582, 0.0013, 2, 0.4, 0.2143, 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, 0., 0., 0.]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L121_C8", "label": "self.enable_left_arm =", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.1609, 0.0013, 2, 0.4, 0.2321, 357, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.enable_left_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.enable_left_arm = enable_left_arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L122_C8", "label": "self.enable_right_arm =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.1622, 0.0013, 2, 0.4, 0.25, 116, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.enable_right_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.enable_right_arm = enable_right_arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L124_C8", "label": "if", "type": "if", "loc": [124, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [4, 2, 0.1689, 0.0093, 2, 0.4, 0.2679, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not enable_right_arm:\n right_arm_settings = None\n self.right_arm_ft = None\n self.Q_force['right_arm'] = None\n self.R_force['right_arm'] = None\n self.P_force['right_arm'] = None\n self.xhat_force['right_arm'] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L125_C12", "label": "right_arm_settings =", "type": "assigned_variable", "loc": [125, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L124_C8", "vector": [14, 3, 0.1662, 0.0013, 3, 0.32, 0.0, 929, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "right_arm_settings", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " right_arm_settings = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L126_C12", "label": "self.right_arm_ft =", "type": "assigned_variable", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L124_C8", "vector": [14, 3, 0.1676, 0.0013, 3, 0.32, 0.2, 452, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.right_arm_ft", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_arm_ft = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L127_C12", "label": "assign", "type": "assigned_variable", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L124_C8", "vector": [14, 3, 0.1689, 0.0013, 3, 0.32, 0.4, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.Q_force['right_arm'] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L128_C12", "label": "assign", "type": "assigned_variable", "loc": [128, 128], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L124_C8", "vector": [14, 3, 0.1702, 0.0013, 3, 0.32, 0.6, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.R_force['right_arm'] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L129_C12", "label": "assign", "type": "assigned_variable", "loc": [129, 129], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L124_C8", "vector": [14, 3, 0.1715, 0.0013, 3, 0.32, 0.8, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.P_force['right_arm'] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L130_C12", "label": "assign", "type": "assigned_variable", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L124_C8", "vector": [14, 3, 0.1729, 0.0013, 3, 0.32, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.xhat_force['right_arm'] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L132_C8", "label": "if", "type": "if", "loc": [132, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [4, 2, 0.1795, 0.0093, 2, 0.4, 0.2857, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not enable_left_arm:\n left_arm_settings = None\n self.left_arm_ft = None\n self.Q_force['left_arm'] = None\n self.R_force['left_arm'] = None\n self.P_force['left_arm'] = None\n self.xhat_force['left_arm'] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L133_C12", "label": "left_arm_settings =", "type": "assigned_variable", "loc": [133, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L132_C8", "vector": [14, 3, 0.1769, 0.0013, 3, 0.32, 0.0, 278, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "left_arm_settings", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " left_arm_settings = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L134_C12", "label": "self.left_arm_ft =", "type": "assigned_variable", "loc": [134, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L132_C8", "vector": [14, 3, 0.1782, 0.0013, 3, 0.32, 0.2, 527, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.left_arm_ft", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.left_arm_ft = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L135_C12", "label": "assign", "type": "assigned_variable", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L132_C8", "vector": [14, 3, 0.1795, 0.0013, 3, 0.32, 0.4, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.Q_force['left_arm'] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L136_C12", "label": "assign", "type": "assigned_variable", "loc": [136, 136], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L132_C8", "vector": [14, 3, 0.1809, 0.0013, 3, 0.32, 0.6, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.R_force['left_arm'] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L137_C12", "label": "assign", "type": "assigned_variable", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L132_C8", "vector": [14, 3, 0.1822, 0.0013, 3, 0.32, 0.8, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.P_force['left_arm'] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L138_C12", "label": "assign", "type": "assigned_variable", "loc": [138, 138], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L132_C8", "vector": [14, 3, 0.1835, 0.0013, 3, 0.32, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.xhat_force['left_arm'] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L140_C8", "label": "initialize_joints()", "type": "expression", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [8, 2, 0.1862, 0.0013, 2, 0.4, 0.3036, 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_99326:Expr_L146_C8", "label": "init_node()", "type": "expression", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [8, 2, 0.1941, 0.0013, 2, 0.4, 0.3214, 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_99326:If_L148_C8", "label": "if", "type": "if", "loc": [148, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [4, 2, 0.1995, 0.0066, 2, 0.4, 0.3393, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if use_netft_r:\n self.ftclient_r = ftc.FTClient('force_torque_ft5', True)\n self.ftclient_r.bias()\n else:\n self.ftclient_r = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L149_C12", "label": "self.ftclient_r = FTClient()", "type": "assigned_variable", "loc": [149, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L148_C8", "vector": [14, 3, 0.1981, 0.0013, 3, 0.38, 0.0, 494, 3, 2, 0, 0, 78, 10, 1], "semantic": {"name": "self.ftclient_r", "arg_names": [], "import_names": [], "rhs_call_name": "FTClient", "annotation": ""}, "snippet": " self.ftclient_r = ftc.FTClient('force_torque_ft5', True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L150_C12", "label": "bias()", "type": "expression", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L148_C8", "vector": [8, 3, 0.1995, 0.0013, 3, 0.38, 0.5, 354, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bias", "arg_names": [], "import_names": [], "rhs_call_name": "bias", "annotation": ""}, "snippet": " self.ftclient_r.bias()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L152_C12", "label": "self.ftclient_r =", "type": "assigned_variable", "loc": [152, 152], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L148_C8", "vector": [14, 3, 0.2021, 0.0013, 3, 0.38, 1.0, 494, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.ftclient_r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ftclient_r = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L154_C8", "label": "if", "type": "if", "loc": [154, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [4, 2, 0.2074, 0.0066, 2, 0.4, 0.3571, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if use_netft_l:\n self.ftclient_l = ftc.FTClient('force_torque_ft6', True)\n self.ftclient_l.bias()\n else:\n self.ftclient_l = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L155_C12", "label": "self.ftclient_l = FTClient()", "type": "assigned_variable", "loc": [155, 155], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L154_C8", "vector": [14, 3, 0.2061, 0.0013, 3, 0.41, 0.0, 188, 3, 2, 0, 0, 78, 10, 1], "semantic": {"name": "self.ftclient_l", "arg_names": [], "import_names": [], "rhs_call_name": "FTClient", "annotation": ""}, "snippet": " self.ftclient_l = ftc.FTClient('force_torque_ft6', True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L156_C12", "label": "bias()", "type": "expression", "loc": [156, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L154_C8", "vector": [8, 3, 0.2074, 0.0013, 3, 0.41, 0.5, 354, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bias", "arg_names": [], "import_names": [], "rhs_call_name": "bias", "annotation": ""}, "snippet": " self.ftclient_l.bias()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L158_C12", "label": "self.ftclient_l =", "type": "assigned_variable", "loc": [158, 158], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L154_C8", "vector": [14, 3, 0.2101, 0.0013, 3, 0.41, 1.0, 188, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.ftclient_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ftclient_l = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L161_C8", "label": "self.q_r_pub = Publisher()", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2141, 0.0013, 2, 0.4, 0.375, 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_99326:Assign_L162_C8", "label": "self.q_l_pub = Publisher()", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2154, 0.0013, 2, 0.4, 0.3929, 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_99326:Assign_L164_C8", "label": "self.qdot_r_pub = Publisher()", "type": "assigned_variable", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2181, 0.0013, 2, 0.4, 0.4107, 357, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.qdot_r_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.qdot_r_pub = rospy.Publisher('/r_arm/qdot', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L165_C8", "label": "self.qdot_l_pub = Publisher()", "type": "assigned_variable", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2194, 0.0013, 2, 0.4, 0.4286, 193, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.qdot_l_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.qdot_l_pub = rospy.Publisher('/l_arm/qdot', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L167_C8", "label": "self.force_raw_r_pub = Publisher()", "type": "assigned_variable", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2221, 0.0013, 2, 0.4, 0.4464, 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_99326:Assign_L168_C8", "label": "self.force_raw_l_pub = Publisher()", "type": "assigned_variable", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2234, 0.0013, 2, 0.4, 0.4643, 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_99326:Assign_L169_C8", "label": "self.force_r_pub = Publisher()", "type": "assigned_variable", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2247, 0.0013, 2, 0.4, 0.4821, 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_99326:Assign_L170_C8", "label": "self.force_l_pub = Publisher()", "type": "assigned_variable", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2261, 0.0013, 2, 0.4, 0.5, 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_99326:Assign_L172_C8", "label": "self.jep_r_pub = Publisher()", "type": "assigned_variable", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2287, 0.0013, 2, 0.4, 0.5179, 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_99326:Assign_L173_C8", "label": "self.jep_l_pub = Publisher()", "type": "assigned_variable", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2301, 0.0013, 2, 0.4, 0.5357, 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_99326:Assign_L174_C8", "label": "self.alph_r_pub = Publisher()", "type": "assigned_variable", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2314, 0.0013, 2, 0.4, 0.5536, 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_99326:Assign_L175_C8", "label": "self.alph_l_pub = Publisher()", "type": "assigned_variable", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2327, 0.0013, 2, 0.4, 0.5714, 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_99326:Assign_L177_C8", "label": "self.torque_r_pub = Publisher()", "type": "assigned_variable", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2354, 0.0013, 2, 0.4, 0.5893, 968, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.torque_r_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.torque_r_pub = rospy.Publisher('/r_arm/joint_torque', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L178_C8", "label": "self.torque_l_pub = Publisher()", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2367, 0.0013, 2, 0.4, 0.6071, 513, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.torque_l_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.torque_l_pub = rospy.Publisher('/l_arm/joint_torque', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L180_C8", "label": "self.mot_temp_r_pub = Publisher()", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2394, 0.0013, 2, 0.4, 0.625, 735, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.mot_temp_r_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.mot_temp_r_pub = rospy.Publisher('/r_arm/joint_motor_temp', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L181_C8", "label": "self.mot_temp_l_pub = Publisher()", "type": "assigned_variable", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2407, 0.0013, 2, 0.4, 0.6429, 750, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.mot_temp_l_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.mot_temp_l_pub = rospy.Publisher('/l_arm/joint_motor_temp', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L183_C8", "label": "self.pwr_state_pub = Publisher()", "type": "assigned_variable", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2434, 0.0013, 2, 0.4, 0.6607, 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_99326:Assign_L184_C8", "label": "self.joint_state_pub = Publisher()", "type": "assigned_variable", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2447, 0.0013, 2, 0.4, 0.6786, 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_99326:Expr_L186_C8", "label": "Subscriber()", "type": "expression", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [8, 2, 0.2473, 0.0013, 2, 0.4, 0.6964, 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_99326:Expr_L187_C8", "label": "Subscriber()", "type": "expression", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [8, 2, 0.2487, 0.0013, 2, 0.4, 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_99326:Expr_L188_C8", "label": "Subscriber()", "type": "expression", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [8, 2, 0.25, 0.0013, 2, 0.4, 0.7321, 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_99326:Expr_L189_C8", "label": "Subscriber()", "type": "expression", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [8, 2, 0.2513, 0.0013, 2, 0.4, 0.75, 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_99326:Expr_L193_C8", "label": "Subscriber()", "type": "expression", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [8, 2, 0.2566, 0.0013, 2, 0.4, 0.7679, 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_99326:Expr_L194_C8", "label": "Subscriber()", "type": "expression", "loc": [194, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [8, 2, 0.2586, 0.0027, 2, 0.4, 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/command/motors_off', Empty,\n self.motors_off)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L197_C8", "label": "self.cb_lock = RLock()", "type": "assigned_variable", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.262, 0.0013, 2, 0.4, 0.8036, 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_99326:Assign_L198_C8", "label": "self.r_jep =", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2633, 0.0013, 2, 0.4, 0.8214, 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_99326:Assign_L199_C8", "label": "self.l_jep =", "type": "assigned_variable", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2646, 0.0013, 2, 0.4, 0.8393, 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_99326:Assign_L200_C8", "label": "self.q_r =", "type": "assigned_variable", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.266, 0.0013, 2, 0.4, 0.8571, 707, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.q_r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_r = None # using this to compute qdot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L201_C8", "label": "self.q_l =", "type": "assigned_variable", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2673, 0.0013, 2, 0.4, 0.875, 651, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.q_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_l = None # using this to compute qdot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L202_C8", "label": "self.q_rHOT =", "type": "assigned_variable", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2686, 0.0013, 2, 0.4, 0.8929, 355, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.q_rHOT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_rHOT = None # using this to compute qdot # added_by_tapo, Jan 23-2013"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L203_C8", "label": "self.q_lHOT =", "type": "assigned_variable", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2699, 0.0013, 2, 0.4, 0.9107, 934, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.q_lHOT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_lHOT = None # using this to compute qdot # added_by_tapo, Jan 23-2013"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L204_C8", "label": "self.time_stamp =", "type": "assigned_variable", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2713, 0.0013, 2, 0.4, 0.9286, 520, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.time_stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.time_stamp = None # using this to compute qdot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L206_C8", "label": "d =", "type": "assigned_variable", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2739, 0.0013, 2, 0.4, 0.9464, 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_99326:Assign_L207_C8", "label": " = get_joint_name_list()", "type": "assigned_variable", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2753, 0.0013, 2, 0.4, 0.9643, 0, 3, 1, 0, 0, 178, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_name_list", "annotation": ""}, "snippet": " d['right_arm'] = ac.get_joint_name_list('r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L208_C8", "label": " = get_joint_name_list()", "type": "assigned_variable", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2766, 0.0013, 2, 0.4, 0.9821, 0, 3, 1, 0, 0, 178, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_name_list", "annotation": ""}, "snippet": " d['left_arm'] = ac.get_joint_name_list('l')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L209_C8", "label": "self.joint_names_list =", "type": "assigned_variable", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "vector": [14, 2, 0.2779, 0.0013, 2, 0.4, 1.0, 515, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.joint_names_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_names_list = d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L211_C4", "label": "set_arm_settings", "type": "function", "loc": [211, 252], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.3078, 0.0559, 1, 0.3, 0.0385, 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_99326:Assign_L212_C8", "label": "assign", "type": "assigned_variable", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L211_C4", "vector": [14, 2, 0.2819, 0.0013, 2, 0.98, 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_99326:Assign_L213_C8", "label": "assign", "type": "assigned_variable", "loc": [213, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L211_C4", "vector": [14, 2, 0.2832, 0.0013, 2, 0.98, 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_99326:For_L215_C8", "label": "for arm, arm_settings", "type": "for", "loc": [215, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L211_C4", "vector": [6, 2, 0.3105, 0.0505, 2, 0.98, 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 if joint_component_list != None:\n for c in joint_component_list:\n c.set_control_mode(OFF)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L216_C12", "label": "joint_component_list =", "type": "assigned_variable", "loc": [216, 216], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L215_C8", "vector": [14, 3, 0.2872, 0.0013, 3, 0.34, 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_99326:If_L219_C12", "label": "if", "type": "if", "loc": [219, 223], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L215_C8", "vector": [4, 3, 0.2939, 0.0066, 3, 0.34, 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 if joint_component_list != None:\n for c in joint_component_list:\n c.set_control_mode(OFF)\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L220_C16", "label": "if", "type": "if", "loc": [220, 222], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L219_C12", "vector": [4, 4, 0.2939, 0.004, 4, 0.34, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if joint_component_list != None:\n for c in joint_component_list:\n c.set_control_mode(OFF)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L221_C20", "label": "for c", "type": "for", "loc": [221, 222], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L220_C16", "vector": [6, 5, 0.2945, 0.0027, 5, 0.99, 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_99326:Expr_L222_C24", "label": "set_control_mode()", "type": "expression", "loc": [222, 222], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L221_C20", "vector": [8, 6, 0.2952, 0.0013, 6, 0.23, 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_99326:Assign_L225_C12", "label": "stiffness_list =", "type": "assigned_variable", "loc": [225, 225], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L215_C8", "vector": [14, 3, 0.2992, 0.0013, 3, 0.34, 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_99326:If_L227_C12", "label": "if", "type": "if", "loc": [227, 252], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L215_C8", "vector": [4, 3, 0.3185, 0.0346, 3, 0.34, 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_99326:Expr_L228_C16", "label": "print()", "type": "expression", "loc": [228, 228], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L227_C12", "vector": [8, 4, 0.3032, 0.0013, 4, 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('setting control mode to torque_gc')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L229_C16", "label": "for c", "type": "for", "loc": [229, 231], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L227_C12", "vector": [6, 4, 0.3059, 0.004, 4, 0.33, 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_99326:Expr_L230_C20", "label": "set_control_mode()", "type": "expression", "loc": [230, 230], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L229_C16", "vector": [8, 5, 0.3059, 0.0013, 5, 0.2, 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_99326:Expr_L231_C20", "label": "set_torque_mNm()", "type": "expression", "loc": [231, 231], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L229_C16", "vector": [8, 5, 0.3072, 0.0013, 5, 0.2, 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_99326:If_L232_C12", "label": "if", "type": "if", "loc": [232, 252], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L227_C12", "vector": [4, 4, 0.3218, 0.0279, 4, 0.33, 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_99326:Expr_L233_C16", "label": "print()", "type": "expression", "loc": [233, 233], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L232_C12", "vector": [8, 5, 0.3098, 0.0013, 5, 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('setting control mode to theta_gc')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L234_C16", "label": "for i", "type": "for", "loc": [234, 237], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L232_C12", "vector": [6, 5, 0.3132, 0.0053, 5, 0.37, 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_99326:Expr_L235_C20", "label": "set_control_mode()", "type": "expression", "loc": [235, 235], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L234_C16", "vector": [8, 6, 0.3125, 0.0013, 6, 0.0, 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_99326:Expr_L236_C20", "label": "set_stiffness()", "type": "expression", "loc": [236, 236], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L234_C16", "vector": [8, 6, 0.3138, 0.0013, 6, 0.0, 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_99326:Expr_L237_C20", "label": "set_slew_rate_proportion()", "type": "expression", "loc": [237, 237], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L234_C16", "vector": [8, 6, 0.3152, 0.0013, 6, 0.0, 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_99326:Expr_L239_C16", "label": "set_control_mode()", "type": "expression", "loc": [239, 239], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L232_C12", "vector": [8, 5, 0.3178, 0.0013, 5, 0.37, 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_99326:Expr_L240_C16", "label": "set_slew_rate_proportion()", "type": "expression", "loc": [240, 240], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L232_C12", "vector": [8, 5, 0.3191, 0.0013, 5, 0.37, 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_99326:Expr_L241_C16", "label": "set_control_mode()", "type": "expression", "loc": [241, 241], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L232_C12", "vector": [8, 5, 0.3205, 0.0013, 5, 0.37, 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_99326:Expr_L242_C16", "label": "set_slew_rate_proportion()", "type": "expression", "loc": [242, 242], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L232_C12", "vector": [8, 5, 0.3218, 0.0013, 5, 0.37, 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_99326:If_L244_C12", "label": "if", "type": "if", "loc": [244, 252], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L232_C12", "vector": [4, 5, 0.3298, 0.012, 5, 0.37, 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_99326:Expr_L245_C16", "label": "print()", "type": "expression", "loc": [245, 245], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L244_C12", "vector": [8, 6, 0.3258, 0.0013, 6, 0.05, 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_99326:For_L246_C16", "label": "for i", "type": "for", "loc": [246, 249], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L244_C12", "vector": [6, 6, 0.3291, 0.0053, 6, 0.05, 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_99326:Expr_L247_C20", "label": "set_control_mode()", "type": "expression", "loc": [247, 247], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L246_C16", "vector": [8, 7, 0.3285, 0.0013, 7, 0.13, 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_99326:Expr_L248_C20", "label": "set_stiffness()", "type": "expression", "loc": [248, 248], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L246_C16", "vector": [8, 7, 0.3298, 0.0013, 7, 0.13, 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_99326:Expr_L249_C20", "label": "set_slew_rate_proportion()", "type": "expression", "loc": [249, 249], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L246_C16", "vector": [8, 7, 0.3311, 0.0013, 7, 0.13, 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_99326:Expr_L252_C16", "label": "print()", "type": "expression", "loc": [252, 252], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L244_C12", "vector": [8, 6, 0.3351, 0.0013, 6, 0.05, 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_99326:FunctionDef_L256_C4", "label": "safeop_things", "type": "function", "loc": [256, 265], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.3464, 0.0133, 1, 0.3, 0.0769, 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_99326:Assign_L257_C8", "label": "robot_name =", "type": "assigned_variable", "loc": [257, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L256_C4", "vector": [14, 2, 0.3418, 0.0013, 2, 0.94, 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_99326:Assign_L258_C8", "label": "chain_names =", "type": "assigned_variable", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L256_C4", "vector": [14, 2, 0.3431, 0.0013, 2, 0.94, 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_99326:Assign_L259_C8", "label": "dynamatics_nms =", "type": "assigned_variable", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L256_C4", "vector": [14, 2, 0.3444, 0.0013, 2, 0.94, 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_99326:Expr_L261_C8", "label": "make_safe_operational()", "type": "expression", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L256_C4", "vector": [8, 2, 0.3471, 0.0013, 2, 0.94, 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_99326:For_L262_C8", "label": "for c", "type": "for", "loc": [262, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L256_C4", "vector": [6, 2, 0.3491, 0.0027, 2, 0.94, 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_99326:Expr_L263_C12", "label": "make_safe_operational()", "type": "expression", "loc": [263, 263], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L262_C8", "vector": [8, 3, 0.3497, 0.0013, 3, 0.88, 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_99326:For_L264_C8", "label": "for d", "type": "for", "loc": [264, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L256_C4", "vector": [6, 2, 0.3517, 0.0027, 2, 0.94, 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_99326:Expr_L265_C12", "label": "make_safe_operational()", "type": "expression", "loc": [265, 265], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L264_C8", "vector": [8, 3, 0.3524, 0.0013, 3, 0.0, 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_99326:FunctionDef_L267_C4", "label": "initialize_joints", "type": "function", "loc": [267, 349], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.4096, 0.1104, 1, 0.3, 0.1154, 254, 0, 3, 0, 0, 0, 0, 33], "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(True, True) # the second true enables ROS (needed for the skin patch)\n\n l1 = ['m3pwr_pwr003']\n\n if self.enable_right_arm:\n l1.append('m3loadx6_ma1_l0')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L268_C8", "label": "self.proxy = M3RtProxy()", "type": "assigned_variable", "loc": [268, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "vector": [14, 2, 0.3564, 0.0013, 2, 0.41, 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_99326:Expr_L269_C8", "label": "start()", "type": "expression", "loc": [269, 269], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "vector": [8, 2, 0.3577, 0.0013, 2, 0.41, 0.0526, 511, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.proxy.start(True, True) # the second true enables ROS (needed for the skin patch)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L271_C8", "label": "l1 =", "type": "assigned_variable", "loc": [271, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "vector": [14, 2, 0.3604, 0.0013, 2, 0.41, 0.1053, 888, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "l1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l1 = ['m3pwr_pwr003']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L273_C8", "label": "if", "type": "if", "loc": [273, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "vector": [4, 2, 0.3644, 0.004, 2, 0.41, 0.1579, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.enable_right_arm:\n l1.append('m3loadx6_ma1_l0')\n l1.append('m3arm_ma1')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L274_C12", "label": "append()", "type": "expression", "loc": [274, 274], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L273_C8", "vector": [8, 3, 0.3644, 0.0013, 3, 0.26, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " l1.append('m3loadx6_ma1_l0')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L275_C12", "label": "append()", "type": "expression", "loc": [275, 275], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L273_C8", "vector": [8, 3, 0.3657, 0.0013, 3, 0.26, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " l1.append('m3arm_ma1')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L277_C8", "label": "if", "type": "if", "loc": [277, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "vector": [4, 2, 0.3697, 0.004, 2, 0.41, 0.2105, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if left_arm_settings is not None:\n l1.append('m3loadx6_ma2_l0')\n l1.append('m3arm_ma2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L278_C12", "label": "append()", "type": "expression", "loc": [278, 278], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L277_C8", "vector": [8, 3, 0.3697, 0.0013, 3, 0.22, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " l1.append('m3loadx6_ma2_l0')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L279_C12", "label": "append()", "type": "expression", "loc": [279, 279], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L277_C8", "vector": [8, 3, 0.371, 0.0013, 3, 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": " l1.append('m3arm_ma2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L281_C8", "label": "for c", "type": "for", "loc": [281, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "vector": [6, 2, 0.375, 0.004, 2, 0.41, 0.2632, 411, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for c in l1:\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_99326:If_L282_C12", "label": "if", "type": "if", "loc": [282, 283], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L281_C8", "vector": [4, 3, 0.3757, 0.0027, 3, 0.7, 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_99326:Assign_L285_C8", "label": "self.joint_list_dict =", "type": "assigned_variable", "loc": [285, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "vector": [14, 2, 0.379, 0.0013, 2, 0.41, 0.3158, 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_99326:If_L287_C8", "label": "if", "type": "if", "loc": [287, 297], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "vector": [4, 2, 0.3883, 0.0146, 2, 0.41, 0.3684, 0, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.enable_right_arm:\n right_l = []\n 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_99326:Assign_L288_C12", "label": "right_l =", "type": "assigned_variable", "loc": [288, 288], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L287_C8", "vector": [14, 3, 0.383, 0.0013, 3, 0.03, 0.0, 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_99326:For_L289_C12", "label": "for c", "type": "for", "loc": [289, 294], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L287_C8", "vector": [6, 3, 0.3876, 0.008, 3, 0.03, 0.3333, 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_99326:If_L292_C16", "label": "if", "type": "if", "loc": [292, 293], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L289_C12", "vector": [4, 4, 0.389, 0.0027, 4, 0.06, 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_99326:Expr_L294_C16", "label": "append()", "type": "expression", "loc": [294, 294], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L289_C12", "vector": [8, 4, 0.391, 0.0013, 4, 0.06, 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_99326:Assign_L295_C12", "label": "assign", "type": "assigned_variable", "loc": [295, 295], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L287_C8", "vector": [14, 3, 0.3923, 0.0013, 3, 0.03, 0.6667, 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_99326:Assign_L297_C12", "label": "assign", "type": "assigned_variable", "loc": [297, 297], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L287_C8", "vector": [14, 3, 0.3949, 0.0013, 3, 0.03, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_list_dict['right_arm'] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L299_C8", "label": "if", "type": "if", "loc": [299, 309], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "vector": [4, 2, 0.4043, 0.0146, 2, 0.41, 0.4211, 0, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.enable_left_arm:\n left_l = []\n 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_99326:Assign_L300_C12", "label": "left_l =", "type": "assigned_variable", "loc": [300, 300], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L299_C8", "vector": [14, 3, 0.3989, 0.0013, 3, 0.57, 0.0, 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_99326:For_L301_C12", "label": "for c", "type": "for", "loc": [301, 306], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L299_C8", "vector": [6, 3, 0.4036, 0.008, 3, 0.57, 0.3333, 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_99326:If_L304_C16", "label": "if", "type": "if", "loc": [304, 305], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L301_C12", "vector": [4, 4, 0.4049, 0.0027, 4, 0.09, 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_99326:Expr_L306_C16", "label": "append()", "type": "expression", "loc": [306, 306], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L301_C12", "vector": [8, 4, 0.4069, 0.0013, 4, 0.09, 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_99326:Assign_L307_C12", "label": "assign", "type": "assigned_variable", "loc": [307, 307], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L299_C8", "vector": [14, 3, 0.4082, 0.0013, 3, 0.57, 0.6667, 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_99326:Assign_L309_C12", "label": "assign", "type": "assigned_variable", "loc": [309, 309], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L299_C8", "vector": [14, 3, 0.4109, 0.0013, 3, 0.57, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_list_dict['left_arm'] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L311_C8", "label": "for arm, arm_settings", "type": "for", "loc": [311, 316], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "vector": [6, 2, 0.4169, 0.008, 2, 0.41, 0.4737, 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 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_99326:If_L312_C12", "label": "if", "type": "if", "loc": [312, 313], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L311_C8", "vector": [4, 3, 0.4156, 0.0027, 3, 0.31, 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_99326:For_L314_C12", "label": "for comp", "type": "for", "loc": [314, 316], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L311_C8", "vector": [6, 3, 0.4189, 0.004, 3, 0.31, 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_99326:Expr_L315_C16", "label": "subscribe_status()", "type": "expression", "loc": [315, 315], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L314_C12", "vector": [8, 4, 0.4189, 0.0013, 4, 0.69, 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_99326:Expr_L316_C16", "label": "publish_command()", "type": "expression", "loc": [316, 316], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L314_C12", "vector": [8, 4, 0.4202, 0.0013, 4, 0.69, 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_99326:Expr_L318_C8", "label": "set_arm_settings()", "type": "expression", "loc": [318, 318], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "vector": [8, 2, 0.4229, 0.0013, 2, 0.41, 0.5263, 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_99326:Assign_L320_C8", "label": "self.pwr = create_component()", "type": "assigned_variable", "loc": [320, 320], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "vector": [14, 2, 0.4255, 0.0013, 2, 0.41, 0.5789, 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_99326:Expr_L321_C8", "label": "subscribe_status()", "type": "expression", "loc": [321, 321], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "vector": [8, 2, 0.4269, 0.0013, 2, 0.41, 0.6316, 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_99326:Expr_L322_C8", "label": "publish_command()", "type": "expression", "loc": [322, 322], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "vector": [8, 2, 0.4282, 0.0013, 2, 0.41, 0.6842, 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_99326:Assign_L324_C8", "label": "self.arms =", "type": "assigned_variable", "loc": [324, 324], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "vector": [14, 2, 0.4309, 0.0013, 2, 0.41, 0.7368, 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_99326:If_L326_C8", "label": "if", "type": "if", "loc": [326, 334], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "vector": [4, 2, 0.4388, 0.012, 2, 0.41, 0.7895, 0, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.enable_right_arm:\n right_fts=m3.loadx6.M3LoadX6('m3loadx6_ma1_l0')\n self.proxy.subscribe_status(right_fts)\n\n self.arms['right_arm']=m3.arm.M3Arm('m3arm_ma1')\n self.proxy.subscribe_status(self.arms['right_arm'])\n else:\n right_fts = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L327_C12", "label": "right_fts = M3LoadX6()", "type": "assigned_variable", "loc": [327, 327], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L326_C8", "vector": [14, 3, 0.4348, 0.0013, 3, 0.83, 0.0, 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_99326:Expr_L328_C12", "label": "subscribe_status()", "type": "expression", "loc": [328, 328], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L326_C8", "vector": [8, 3, 0.4362, 0.0013, 3, 0.83, 0.2, 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_99326:Assign_L330_C12", "label": " = M3Arm()", "type": "assigned_variable", "loc": [330, 330], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L326_C8", "vector": [14, 3, 0.4388, 0.0013, 3, 0.83, 0.4, 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_99326:Expr_L331_C12", "label": "subscribe_status()", "type": "expression", "loc": [331, 331], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L326_C8", "vector": [8, 3, 0.4402, 0.0013, 3, 0.83, 0.6, 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_99326:Assign_L333_C12", "label": "right_fts =", "type": "assigned_variable", "loc": [333, 333], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L326_C8", "vector": [14, 3, 0.4428, 0.0013, 3, 0.83, 0.8, 777, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "right_fts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " right_fts = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L334_C12", "label": "assign", "type": "assigned_variable", "loc": [334, 334], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L326_C8", "vector": [14, 3, 0.4441, 0.0013, 3, 0.83, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arms['right_arm'] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L336_C8", "label": "if", "type": "if", "loc": [336, 344], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "vector": [4, 2, 0.4521, 0.012, 2, 0.41, 0.8421, 0, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.enable_left_arm:\n left_fts=m3.loadx6.M3LoadX6('m3loadx6_ma2_l0')\n self.proxy.subscribe_status(left_fts)\n\n self.arms['left_arm']=m3.arm.M3Arm('m3arm_ma2')\n self.proxy.subscribe_status(self.arms['left_arm'])\n else:\n left_fts = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L337_C12", "label": "left_fts = M3LoadX6()", "type": "assigned_variable", "loc": [337, 337], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L336_C8", "vector": [14, 3, 0.4481, 0.0013, 3, 0.75, 0.0, 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_99326:Expr_L338_C12", "label": "subscribe_status()", "type": "expression", "loc": [338, 338], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L336_C8", "vector": [8, 3, 0.4495, 0.0013, 3, 0.75, 0.2, 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_99326:Assign_L340_C12", "label": " = M3Arm()", "type": "assigned_variable", "loc": [340, 340], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L336_C8", "vector": [14, 3, 0.4521, 0.0013, 3, 0.75, 0.4, 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_99326:Expr_L341_C12", "label": "subscribe_status()", "type": "expression", "loc": [341, 341], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L336_C8", "vector": [8, 3, 0.4535, 0.0013, 3, 0.75, 0.6, 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_99326:Assign_L343_C12", "label": "left_fts =", "type": "assigned_variable", "loc": [343, 343], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L336_C8", "vector": [14, 3, 0.4561, 0.0013, 3, 0.75, 0.8, 428, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "left_fts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " left_fts = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L344_C12", "label": "assign", "type": "assigned_variable", "loc": [344, 344], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L336_C8", "vector": [14, 3, 0.4574, 0.0013, 3, 0.75, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arms['left_arm'] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L346_C8", "label": "self.fts =", "type": "assigned_variable", "loc": [346, 346], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "vector": [14, 2, 0.4601, 0.0013, 2, 0.41, 0.8947, 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_99326:Expr_L348_C8", "label": "step()", "type": "expression", "loc": [348, 348], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "vector": [8, 2, 0.4628, 0.0013, 2, 0.41, 0.9474, 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_99326:Expr_L349_C8", "label": "step()", "type": "expression", "loc": [349, 349], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "vector": [8, 2, 0.4641, 0.0013, 2, 0.41, 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_99326:FunctionDef_L351_C4", "label": "initialize_gripper", "type": "function", "loc": [351, 355], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.4694, 0.0066, 1, 0.3, 0.1538, 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_99326:Assign_L353_C8", "label": "self.right_gripper = M3Gripper()", "type": "assigned_variable", "loc": [353, 353], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L351_C4", "vector": [14, 2, 0.4694, 0.0013, 2, 0.32, 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_99326:Expr_L354_C8", "label": "publish_command()", "type": "expression", "loc": [354, 354], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L351_C4", "vector": [8, 2, 0.4707, 0.0013, 2, 0.32, 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_99326:Expr_L355_C8", "label": "subscribe_status()", "type": "expression", "loc": [355, 355], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L351_C4", "vector": [8, 2, 0.4721, 0.0013, 2, 0.32, 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_99326:FunctionDef_L357_C4", "label": "step", "type": "function", "loc": [357, 378], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.4887, 0.0293, 1, 0.3, 0.1923, 880, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "step", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def step(self):\n self.proxy.step()\n l = []\n if self.enable_right_arm:\n l.append('right_arm')\n if self.enable_left_arm:\n l.append('left_arm')\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L358_C8", "label": "step()", "type": "expression", "loc": [358, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L357_C4", "vector": [8, 2, 0.4761, 0.0013, 2, 0.68, 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_99326:Assign_L359_C8", "label": "l =", "type": "assigned_variable", "loc": [359, 359], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L357_C4", "vector": [14, 2, 0.4774, 0.0013, 2, 0.68, 0.25, 810, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L360_C8", "label": "if", "type": "if", "loc": [360, 361], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L357_C4", "vector": [4, 2, 0.4794, 0.0027, 2, 0.68, 0.5, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.enable_right_arm:\n l.append('right_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L361_C12", "label": "append()", "type": "expression", "loc": [361, 361], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L360_C8", "vector": [8, 3, 0.4801, 0.0013, 3, 0.44, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " l.append('right_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L362_C8", "label": "if", "type": "if", "loc": [362, 363], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L357_C4", "vector": [4, 2, 0.482, 0.0027, 2, 0.68, 0.75, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.enable_left_arm:\n l.append('left_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L363_C12", "label": "append()", "type": "expression", "loc": [363, 363], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L362_C8", "vector": [8, 3, 0.4827, 0.0013, 3, 0.63, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " l.append('left_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L365_C8", "label": "for arm", "type": "for", "loc": [365, 378], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L357_C4", "vector": [6, 2, 0.494, 0.0186, 2, 0.68, 1.0, 413, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for arm in l:\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(6):\n xhat, p = kalman_update(self.xhat_force[arm][i],\n self.P_force[arm][i],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L366_C12", "label": "z =", "type": "assigned_variable", "loc": [366, 366], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L365_C8", "vector": [14, 3, 0.4867, 0.0013, 3, 0.45, 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_99326:For_L370_C12", "label": "for i", "type": "for", "loc": [370, 378], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L365_C8", "vector": [6, 3, 0.4973, 0.012, 3, 0.45, 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(6):\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_99326:Assign_L371_C16", "label": "xhat, p = kalman_update()", "type": "assigned_variable", "loc": [371, 374], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L370_C12", "vector": [14, 4, 0.4953, 0.0053, 4, 0.03, 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_99326:If_L375_C16", "label": "if", "type": "if", "loc": [375, 376], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L370_C12", "vector": [4, 4, 0.4993, 0.0027, 4, 0.03, 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_99326:Assign_L376_C20", "label": "xhat =", "type": "assigned_variable", "loc": [376, 376], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L375_C16", "vector": [14, 5, 0.5, 0.0013, 5, 0.11, 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_99326:Assign_L377_C16", "label": "assign", "type": "assigned_variable", "loc": [377, 377], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L370_C12", "vector": [14, 4, 0.5013, 0.0013, 4, 0.03, 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_99326:Assign_L378_C16", "label": "assign", "type": "assigned_variable", "loc": [378, 378], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L370_C12", "vector": [14, 4, 0.5027, 0.0013, 4, 0.03, 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_99326:FunctionDef_L380_C4", "label": "step_ros", "type": "function", "loc": [380, 499], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.5844, 0.1596, 1, 0.3, 0.2308, 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\n if self.enable_left_arm:\n l_jep = copy.copy(self.l_jep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L381_C8", "label": "r_arm =", "type": "assigned_variable", "loc": [381, 381], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [14, 2, 0.5066, 0.0013, 2, 0.43, 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_99326:Assign_L382_C8", "label": "l_arm =", "type": "assigned_variable", "loc": [382, 382], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [14, 2, 0.508, 0.0013, 2, 0.43, 0.0323, 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_99326:Expr_L384_C8", "label": "acquire()", "type": "expression", "loc": [384, 384], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [8, 2, 0.5106, 0.0013, 2, 0.43, 0.0645, 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_99326:If_L386_C8", "label": "if", "type": "if", "loc": [386, 388], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [4, 2, 0.5146, 0.004, 2, 0.43, 0.0968, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.enable_left_arm:\n l_jep = copy.copy(self.l_jep)\n l_alpha = copy.copy(self.arm_settings['left_arm'].stiffness_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L387_C12", "label": "l_jep = copy()", "type": "assigned_variable", "loc": [387, 387], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L386_C8", "vector": [14, 3, 0.5146, 0.0013, 3, 0.73, 0.0, 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_99326:Assign_L388_C12", "label": "l_alpha = copy()", "type": "assigned_variable", "loc": [388, 388], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L386_C8", "vector": [14, 3, 0.516, 0.0013, 3, 0.73, 1.0, 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_99326:If_L390_C8", "label": "if", "type": "if", "loc": [390, 392], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [4, 2, 0.5199, 0.004, 2, 0.43, 0.129, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.enable_right_arm:\n r_jep = copy.copy(self.r_jep)\n r_alpha = copy.copy(self.arm_settings['right_arm'].stiffness_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L391_C12", "label": "r_jep = copy()", "type": "assigned_variable", "loc": [391, 391], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L390_C8", "vector": [14, 3, 0.5199, 0.0013, 3, 0.54, 0.0, 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_99326:Assign_L392_C12", "label": "r_alpha = copy()", "type": "assigned_variable", "loc": [392, 392], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L390_C8", "vector": [14, 3, 0.5213, 0.0013, 3, 0.54, 1.0, 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_99326:Expr_L394_C8", "label": "release()", "type": "expression", "loc": [394, 394], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [8, 2, 0.5239, 0.0013, 2, 0.43, 0.1613, 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_99326:If_L396_C8", "label": "if", "type": "if", "loc": [396, 398], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [4, 2, 0.5279, 0.004, 2, 0.43, 0.1935, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.enable_left_arm:\n self.set_jep(l_arm, l_jep)\n self.set_alpha(l_arm, l_alpha)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L397_C12", "label": "set_jep()", "type": "expression", "loc": [397, 397], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L396_C8", "vector": [8, 3, 0.5279, 0.0013, 3, 0.75, 0.0, 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_99326:Expr_L398_C12", "label": "set_alpha()", "type": "expression", "loc": [398, 398], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L396_C8", "vector": [8, 3, 0.5293, 0.0013, 3, 0.75, 1.0, 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_99326:If_L400_C8", "label": "if", "type": "if", "loc": [400, 402], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [4, 2, 0.5332, 0.004, 2, 0.43, 0.2258, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.enable_right_arm:\n self.set_jep(r_arm, r_jep)\n self.set_alpha(r_arm, r_alpha)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L401_C12", "label": "set_jep()", "type": "expression", "loc": [401, 401], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L400_C8", "vector": [8, 3, 0.5332, 0.0013, 3, 0.38, 0.0, 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_99326:Expr_L402_C12", "label": "set_alpha()", "type": "expression", "loc": [402, 402], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L400_C8", "vector": [8, 3, 0.5346, 0.0013, 3, 0.38, 1.0, 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_99326:Expr_L404_C8", "label": "step()", "type": "expression", "loc": [404, 404], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [8, 2, 0.5372, 0.0013, 2, 0.43, 0.2581, 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_99326:Assign_L406_C8", "label": "motor_pwr_state = is_motor_power_on()", "type": "assigned_variable", "loc": [406, 406], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [14, 2, 0.5399, 0.0013, 2, 0.43, 0.2903, 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_99326:If_L408_C8", "label": "if", "type": "if", "loc": [408, 409], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [4, 2, 0.5432, 0.0027, 2, 0.43, 0.3226, 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_99326:Expr_L409_C12", "label": "maintain_configuration()", "type": "expression", "loc": [409, 409], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L408_C8", "vector": [8, 3, 0.5439, 0.0013, 3, 0.22, 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_99326:If_L411_C8", "label": "if", "type": "if", "loc": [411, 418], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [4, 2, 0.5512, 0.0106, 2, 0.43, 0.3548, 0, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.enable_right_arm:\n q_r = self.get_joint_angles(r_arm)\n tau_r = self.get_joint_torques(r_arm)\n mot_temp_r = self.get_motor_temps(r_arm)\n else:\n q_r = None\n tau_r = None\n mot_temp_r = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L412_C12", "label": "q_r = get_joint_angles()", "type": "assigned_variable", "loc": [412, 412], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L411_C8", "vector": [14, 3, 0.5479, 0.0013, 3, 0.17, 0.0, 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_99326:Assign_L413_C12", "label": "tau_r = get_joint_torques()", "type": "assigned_variable", "loc": [413, 413], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L411_C8", "vector": [14, 3, 0.5492, 0.0013, 3, 0.17, 0.2, 869, 3, 1, 0, 0, 216, 10, 1], "semantic": {"name": "tau_r", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_torques", "annotation": ""}, "snippet": " tau_r = self.get_joint_torques(r_arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L414_C12", "label": "mot_temp_r = get_motor_temps()", "type": "assigned_variable", "loc": [414, 414], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L411_C8", "vector": [14, 3, 0.5505, 0.0013, 3, 0.17, 0.4, 862, 3, 1, 0, 0, 813, 10, 1], "semantic": {"name": "mot_temp_r", "arg_names": [], "import_names": [], "rhs_call_name": "get_motor_temps", "annotation": ""}, "snippet": " mot_temp_r = self.get_motor_temps(r_arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L416_C12", "label": "q_r =", "type": "assigned_variable", "loc": [416, 416], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L411_C8", "vector": [14, 3, 0.5532, 0.0013, 3, 0.17, 0.6, 126, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "q_r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_r = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L417_C12", "label": "tau_r =", "type": "assigned_variable", "loc": [417, 417], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L411_C8", "vector": [14, 3, 0.5545, 0.0013, 3, 0.17, 0.8, 869, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "tau_r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tau_r = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L418_C12", "label": "mot_temp_r =", "type": "assigned_variable", "loc": [418, 418], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L411_C8", "vector": [14, 3, 0.5559, 0.0013, 3, 0.17, 1.0, 862, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "mot_temp_r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mot_temp_r = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L420_C8", "label": "if", "type": "if", "loc": [420, 427], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [4, 2, 0.5632, 0.0106, 2, 0.43, 0.3871, 0, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.enable_left_arm:\n q_l = self.get_joint_angles(l_arm)\n tau_l = self.get_joint_torques(l_arm)\n mot_temp_l = self.get_motor_temps(l_arm)\n else:\n q_l = None\n tau_l = None\n mot_temp_l = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L421_C12", "label": "q_l = get_joint_angles()", "type": "assigned_variable", "loc": [421, 421], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L420_C8", "vector": [14, 3, 0.5598, 0.0013, 3, 0.98, 0.0, 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_99326:Assign_L422_C12", "label": "tau_l = get_joint_torques()", "type": "assigned_variable", "loc": [422, 422], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L420_C8", "vector": [14, 3, 0.5612, 0.0013, 3, 0.98, 0.2, 542, 3, 1, 0, 0, 216, 10, 1], "semantic": {"name": "tau_l", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_torques", "annotation": ""}, "snippet": " tau_l = self.get_joint_torques(l_arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L423_C12", "label": "mot_temp_l = get_motor_temps()", "type": "assigned_variable", "loc": [423, 423], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L420_C8", "vector": [14, 3, 0.5625, 0.0013, 3, 0.98, 0.4, 181, 3, 1, 0, 0, 813, 10, 1], "semantic": {"name": "mot_temp_l", "arg_names": [], "import_names": [], "rhs_call_name": "get_motor_temps", "annotation": ""}, "snippet": " mot_temp_l = self.get_motor_temps(l_arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L425_C12", "label": "q_l =", "type": "assigned_variable", "loc": [425, 425], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L420_C8", "vector": [14, 3, 0.5652, 0.0013, 3, 0.98, 0.6, 649, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "q_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_l = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L426_C12", "label": "tau_l =", "type": "assigned_variable", "loc": [426, 426], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L420_C8", "vector": [14, 3, 0.5665, 0.0013, 3, 0.98, 0.8, 542, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "tau_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tau_l = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L427_C12", "label": "mot_temp_l =", "type": "assigned_variable", "loc": [427, 427], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L420_C8", "vector": [14, 3, 0.5678, 0.0013, 3, 0.98, 1.0, 181, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "mot_temp_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mot_temp_l = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L433_C8", "label": "t_now = get_time()", "type": "assigned_variable", "loc": [433, 433], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [14, 2, 0.5758, 0.0013, 2, 0.43, 0.4194, 23, 3, 0, 0, 0, 164, 10, 1], "semantic": {"name": "t_now", "arg_names": [], "import_names": [], "rhs_call_name": "get_time", "annotation": ""}, "snippet": " t_now = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L434_C8", "label": "if", "type": "if", "loc": [434, 442], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [4, 2, 0.5824, 0.012, 2, 0.43, 0.4516, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.q_r != None and self.q_l != None and self.q_rHOT != None and self.q_lHOT != None and self.time_stamp != None:\n dt = t_now - self.time_stamp\n #qdot_r = (np.array(q_r) - np.array(self.q_r)) / dt\n qdot_r = (-np.array(q_r) + 4*np.array(self.q_r) - 3*np.array(self.q_rHOT)) / (2*dt)\n #qdot_l = (np.array(q_l) - np.array(self.q_l)) / dt\n qdot_l = (-np.array(q_l) + 4*np.array(self.q_l) - 3*np.array(self.q_lHOT)) / (2*dt)\n else:\n qdot_r = np.zeros(7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L435_C12", "label": "dt =", "type": "assigned_variable", "loc": [435, 435], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L434_C8", "vector": [14, 3, 0.5785, 0.0013, 3, 0.28, 0.0, 455, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dt = t_now - self.time_stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L437_C12", "label": "qdot_r =", "type": "assigned_variable", "loc": [437, 437], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L434_C8", "vector": [14, 3, 0.5811, 0.0013, 3, 0.28, 0.25, 582, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "qdot_r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qdot_r = (-np.array(q_r) + 4*np.array(self.q_r) - 3*np.array(self.q_rHOT)) / (2*dt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L439_C12", "label": "qdot_l =", "type": "assigned_variable", "loc": [439, 439], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L434_C8", "vector": [14, 3, 0.5838, 0.0013, 3, 0.28, 0.5, 790, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "qdot_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qdot_l = (-np.array(q_l) + 4*np.array(self.q_l) - 3*np.array(self.q_lHOT)) / (2*dt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L441_C12", "label": "qdot_r = zeros()", "type": "assigned_variable", "loc": [441, 441], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L434_C8", "vector": [14, 3, 0.5864, 0.0013, 3, 0.28, 0.75, 582, 3, 1, 0, 0, 213, 10, 1], "semantic": {"name": "qdot_r", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " qdot_r = np.zeros(7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L442_C12", "label": "qdot_l = zeros()", "type": "assigned_variable", "loc": [442, 442], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L434_C8", "vector": [14, 3, 0.5878, 0.0013, 3, 0.28, 1.0, 790, 3, 1, 0, 0, 213, 10, 1], "semantic": {"name": "qdot_l", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " qdot_l = np.zeros(7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L444_C8", "label": "self.q_rHOT =", "type": "assigned_variable", "loc": [444, 444], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [14, 2, 0.5904, 0.0013, 2, 0.43, 0.4839, 355, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.q_rHOT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_rHOT = self.q_r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L445_C8", "label": "self.q_lHOT =", "type": "assigned_variable", "loc": [445, 445], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [14, 2, 0.5918, 0.0013, 2, 0.43, 0.5161, 934, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.q_lHOT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_lHOT = self.q_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L446_C8", "label": "self.q_r =", "type": "assigned_variable", "loc": [446, 446], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [14, 2, 0.5931, 0.0013, 2, 0.43, 0.5484, 707, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.q_r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_r = q_r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L447_C8", "label": "self.q_l =", "type": "assigned_variable", "loc": [447, 447], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [14, 2, 0.5944, 0.0013, 2, 0.43, 0.5806, 651, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.q_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_l = q_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L448_C8", "label": "self.time_stamp =", "type": "assigned_variable", "loc": [448, 448], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [14, 2, 0.5957, 0.0013, 2, 0.43, 0.6129, 520, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.time_stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.time_stamp = t_now"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L450_C8", "label": "if", "type": "if", "loc": [450, 452], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [4, 2, 0.5997, 0.004, 2, 0.43, 0.6452, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.enable_right_arm:\n f_raw_r = self.get_wrist_force(r_arm).A1.tolist()\n f_r = self.xhat_force[r_arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L451_C12", "label": "f_raw_r = tolist()", "type": "assigned_variable", "loc": [451, 451], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L450_C8", "vector": [14, 3, 0.5997, 0.0013, 3, 0.86, 0.0, 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_99326:Assign_L452_C12", "label": "f_r =", "type": "assigned_variable", "loc": [452, 452], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L450_C8", "vector": [14, 3, 0.6011, 0.0013, 3, 0.86, 1.0, 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_99326:If_L454_C8", "label": "if", "type": "if", "loc": [454, 456], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [4, 2, 0.6051, 0.004, 2, 0.43, 0.6774, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.enable_left_arm:\n f_raw_l = self.get_wrist_force(l_arm).A1.tolist()\n f_l = self.xhat_force[l_arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L455_C12", "label": "f_raw_l = tolist()", "type": "assigned_variable", "loc": [455, 455], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L454_C8", "vector": [14, 3, 0.6051, 0.0013, 3, 0.84, 0.0, 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_99326:Assign_L456_C12", "label": "f_l =", "type": "assigned_variable", "loc": [456, 456], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L454_C8", "vector": [14, 3, 0.6064, 0.0013, 3, 0.84, 1.0, 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_99326:Assign_L459_C8", "label": "time_stamp = now()", "type": "assigned_variable", "loc": [459, 459], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [14, 2, 0.6104, 0.0013, 2, 0.43, 0.7097, 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_99326:Assign_L460_C8", "label": "h = Header()", "type": "assigned_variable", "loc": [460, 460], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [14, 2, 0.6117, 0.0013, 2, 0.43, 0.7419, 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_99326:Assign_L461_C8", "label": "h.stamp =", "type": "assigned_variable", "loc": [461, 461], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [14, 2, 0.613, 0.0013, 2, 0.43, 0.7742, 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_99326:Assign_L463_C8", "label": "h.frame_id =", "type": "assigned_variable", "loc": [463, 463], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [14, 2, 0.6157, 0.0013, 2, 0.43, 0.8065, 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_99326:Assign_L464_C8", "label": "pos =", "type": "assigned_variable", "loc": [464, 464], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [14, 2, 0.617, 0.0013, 2, 0.43, 0.8387, 627, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L465_C8", "label": "nms =", "type": "assigned_variable", "loc": [465, 465], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [14, 2, 0.6184, 0.0013, 2, 0.43, 0.871, 550, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "nms", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " nms = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L467_C8", "label": "if", "type": "if", "loc": [467, 480], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [4, 2, 0.6297, 0.0186, 2, 0.43, 0.9032, 0, 7, 0, 0, 0, 0, 0, 16], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.enable_right_arm:\n self.q_r_pub.publish(FloatArray(h, q_r))\n self.qdot_r_pub.publish(FloatArray(h, qdot_r))\n self.jep_r_pub.publish(FloatArray(h, r_jep))\n self.alph_r_pub.publish(FloatArray(h, r_alpha))\n self.torque_r_pub.publish(FloatArray(h, tau_r))\n self.mot_temp_r_pub.publish(FloatArray(h, mot_temp_r))\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L468_C12", "label": "publish()", "type": "expression", "loc": [468, 468], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L467_C8", "vector": [8, 3, 0.6223, 0.0013, 3, 0.72, 0.0, 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_99326:Expr_L469_C12", "label": "publish()", "type": "expression", "loc": [469, 469], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L467_C8", "vector": [8, 3, 0.6237, 0.0013, 3, 0.72, 0.1, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.qdot_r_pub.publish(FloatArray(h, qdot_r))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L470_C12", "label": "publish()", "type": "expression", "loc": [470, 470], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L467_C8", "vector": [8, 3, 0.625, 0.0013, 3, 0.72, 0.2, 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_99326:Expr_L471_C12", "label": "publish()", "type": "expression", "loc": [471, 471], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L467_C8", "vector": [8, 3, 0.6263, 0.0013, 3, 0.72, 0.3, 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_99326:Expr_L472_C12", "label": "publish()", "type": "expression", "loc": [472, 472], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L467_C8", "vector": [8, 3, 0.6277, 0.0013, 3, 0.72, 0.4, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.torque_r_pub.publish(FloatArray(h, tau_r))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L473_C12", "label": "publish()", "type": "expression", "loc": [473, 473], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L467_C8", "vector": [8, 3, 0.629, 0.0013, 3, 0.72, 0.5, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.mot_temp_r_pub.publish(FloatArray(h, mot_temp_r))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L475_C12", "label": "nms =", "type": "assigned_variable", "loc": [475, 475], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L467_C8", "vector": [14, 3, 0.6316, 0.0013, 3, 0.72, 0.6, 550, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "nms", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " nms = nms + self.joint_names_list['right_arm']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L476_C12", "label": "pos =", "type": "assigned_variable", "loc": [476, 476], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L467_C8", "vector": [14, 3, 0.633, 0.0013, 3, 0.72, 0.7, 627, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = pos + q_r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L478_C12", "label": "h.frame_id =", "type": "assigned_variable", "loc": [478, 478], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L467_C8", "vector": [14, 3, 0.6356, 0.0013, 3, 0.72, 0.8, 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 = 'should_not_be_using_this'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L479_C12", "label": "publish()", "type": "expression", "loc": [479, 479], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L467_C8", "vector": [8, 3, 0.637, 0.0013, 3, 0.72, 0.9, 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_99326:Expr_L480_C12", "label": "publish()", "type": "expression", "loc": [480, 480], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L467_C8", "vector": [8, 3, 0.6383, 0.0013, 3, 0.72, 1.0, 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_99326:If_L482_C8", "label": "if", "type": "if", "loc": [482, 495], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [4, 2, 0.6496, 0.0186, 2, 0.43, 0.9355, 0, 2, 0, 0, 0, 0, 0, 16], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if enable_left_arm:\n self.q_l_pub.publish(FloatArray(h, q_l))\n self.qdot_l_pub.publish(FloatArray(h, qdot_l))\n self.jep_l_pub.publish(FloatArray(h, l_jep))\n self.alph_l_pub.publish(FloatArray(h, l_alpha))\n self.torque_l_pub.publish(FloatArray(h, tau_l))\n self.mot_temp_l_pub.publish(FloatArray(h, mot_temp_l))\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L483_C12", "label": "publish()", "type": "expression", "loc": [483, 483], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L482_C8", "vector": [8, 3, 0.6423, 0.0013, 3, 0.96, 0.0, 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_99326:Expr_L484_C12", "label": "publish()", "type": "expression", "loc": [484, 484], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L482_C8", "vector": [8, 3, 0.6436, 0.0013, 3, 0.96, 0.1, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.qdot_l_pub.publish(FloatArray(h, qdot_l))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L485_C12", "label": "publish()", "type": "expression", "loc": [485, 485], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L482_C8", "vector": [8, 3, 0.6449, 0.0013, 3, 0.96, 0.2, 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_99326:Expr_L486_C12", "label": "publish()", "type": "expression", "loc": [486, 486], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L482_C8", "vector": [8, 3, 0.6463, 0.0013, 3, 0.96, 0.3, 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_99326:Expr_L487_C12", "label": "publish()", "type": "expression", "loc": [487, 487], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L482_C8", "vector": [8, 3, 0.6476, 0.0013, 3, 0.96, 0.4, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.torque_l_pub.publish(FloatArray(h, tau_l))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L488_C12", "label": "publish()", "type": "expression", "loc": [488, 488], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L482_C8", "vector": [8, 3, 0.6489, 0.0013, 3, 0.96, 0.5, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.mot_temp_l_pub.publish(FloatArray(h, mot_temp_l))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L490_C12", "label": "nms =", "type": "assigned_variable", "loc": [490, 490], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L482_C8", "vector": [14, 3, 0.6516, 0.0013, 3, 0.96, 0.6, 550, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "nms", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " nms = nms + self.joint_names_list['left_arm']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L491_C12", "label": "pos =", "type": "assigned_variable", "loc": [491, 491], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L482_C8", "vector": [14, 3, 0.6529, 0.0013, 3, 0.96, 0.7, 627, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = pos + q_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L493_C12", "label": "h.frame_id =", "type": "assigned_variable", "loc": [493, 493], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L482_C8", "vector": [14, 3, 0.6556, 0.0013, 3, 0.96, 0.8, 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 = 'should_not_be_using_this'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L494_C12", "label": "publish()", "type": "expression", "loc": [494, 494], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L482_C8", "vector": [8, 3, 0.6569, 0.0013, 3, 0.96, 0.9, 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_99326:Expr_L495_C12", "label": "publish()", "type": "expression", "loc": [495, 495], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L482_C8", "vector": [8, 3, 0.6582, 0.0013, 3, 0.96, 1.0, 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_99326:Expr_L497_C8", "label": "publish()", "type": "expression", "loc": [497, 498], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [8, 2, 0.6616, 0.0027, 2, 0.43, 0.9677, 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_99326:Expr_L499_C8", "label": "publish()", "type": "expression", "loc": [499, 499], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "vector": [8, 2, 0.6636, 0.0013, 2, 0.43, 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_99326:FunctionDef_L501_C4", "label": "is_motor_power_on", "type": "function", "loc": [501, 502], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.6669, 0.0027, 1, 0.3, 0.2692, 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_99326:Return_L502_C8", "label": "return", "type": "return", "loc": [502, 502], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L501_C4", "vector": [13, 2, 0.6676, 0.0013, 2, 0.61, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.pwr.is_motor_power_on(None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L509_C4", "label": "motors_off", "type": "function", "loc": [509, 510], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.6775, 0.0027, 1, 0.3, 0.3077, 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_99326:Expr_L510_C8", "label": "set_motor_power_off()", "type": "expression", "loc": [510, 510], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L509_C4", "vector": [8, 2, 0.6782, 0.0013, 2, 0.6, 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_99326:FunctionDef_L512_C4", "label": "motors_on", "type": "function", "loc": [512, 516], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.6835, 0.0066, 1, 0.3, 0.3462, 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_99326:Expr_L513_C8", "label": "maintain_configuration()", "type": "expression", "loc": [513, 513], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L512_C4", "vector": [8, 2, 0.6822, 0.0013, 2, 0.46, 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_99326:Expr_L514_C8", "label": "set_motor_power_on()", "type": "expression", "loc": [514, 514], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L512_C4", "vector": [8, 2, 0.6835, 0.0013, 2, 0.46, 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_99326:Expr_L515_C8", "label": "step()", "type": "expression", "loc": [515, 515], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L512_C4", "vector": [8, 2, 0.6848, 0.0013, 2, 0.46, 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_99326:Expr_L516_C8", "label": "step()", "type": "expression", "loc": [516, 516], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L512_C4", "vector": [8, 2, 0.6862, 0.0013, 2, 0.46, 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_99326:FunctionDef_L518_C4", "label": "maintain_configuration", "type": "function", "loc": [518, 537], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.7015, 0.0266, 1, 0.3, 0.3846, 171, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "maintain_configuration", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def maintain_configuration(self):\n l = []\n if self.enable_left_arm:\n l.append('left_arm')\n if self.enable_right_arm:\n l.append('right_arm')\n\n for arm in l:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L519_C8", "label": "l =", "type": "assigned_variable", "loc": [519, 519], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L518_C4", "vector": [14, 2, 0.6902, 0.0013, 2, 0.77, 0.0, 810, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L520_C8", "label": "if", "type": "if", "loc": [520, 521], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L518_C4", "vector": [4, 2, 0.6922, 0.0027, 2, 0.77, 0.3333, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.enable_left_arm:\n l.append('left_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L521_C12", "label": "append()", "type": "expression", "loc": [521, 521], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L520_C8", "vector": [8, 3, 0.6928, 0.0013, 3, 0.92, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " l.append('left_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L522_C8", "label": "if", "type": "if", "loc": [522, 523], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L518_C4", "vector": [4, 2, 0.6948, 0.0027, 2, 0.77, 0.6667, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.enable_right_arm:\n l.append('right_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L523_C12", "label": "append()", "type": "expression", "loc": [523, 523], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L522_C8", "vector": [8, 3, 0.6955, 0.0013, 3, 0.97, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " l.append('right_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L525_C8", "label": "for arm", "type": "for", "loc": [525, 537], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L518_C4", "vector": [6, 2, 0.7061, 0.0173, 2, 0.77, 1.0, 413, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for arm in l:\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_99326:Assign_L526_C12", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [526, 526], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L525_C8", "vector": [14, 3, 0.6995, 0.0013, 3, 0.45, 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_99326:If_L527_C12", "label": "if", "type": "if", "loc": [527, 528], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L525_C8", "vector": [4, 3, 0.7015, 0.0027, 3, 0.45, 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_99326:If_L529_C12", "label": "if", "type": "if", "loc": [529, 530], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L525_C8", "vector": [4, 3, 0.7041, 0.0027, 3, 0.45, 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_99326:Expr_L531_C12", "label": "set_jep()", "type": "expression", "loc": [531, 531], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L525_C8", "vector": [8, 3, 0.7061, 0.0013, 3, 0.45, 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_99326:Expr_L532_C12", "label": "acquire()", "type": "expression", "loc": [532, 532], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L525_C8", "vector": [8, 3, 0.7074, 0.0013, 3, 0.45, 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_99326:If_L533_C12", "label": "if", "type": "if", "loc": [533, 536], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L525_C8", "vector": [4, 3, 0.7108, 0.0053, 3, 0.45, 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_99326:Assign_L534_C16", "label": "self.r_jep =", "type": "assigned_variable", "loc": [534, 534], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L533_C12", "vector": [14, 4, 0.7101, 0.0013, 4, 0.61, 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_99326:Assign_L536_C16", "label": "self.l_jep =", "type": "assigned_variable", "loc": [536, 536], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L533_C12", "vector": [14, 4, 0.7128, 0.0013, 4, 0.61, 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_99326:Expr_L537_C12", "label": "release()", "type": "expression", "loc": [537, 537], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L525_C8", "vector": [8, 3, 0.7141, 0.0013, 3, 0.45, 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_99326:FunctionDef_L539_C4", "label": "power_on", "type": "function", "loc": [539, 545], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.7207, 0.0093, 1, 0.3, 0.4231, 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_99326:Expr_L540_C8", "label": "maintain_configuration()", "type": "expression", "loc": [540, 540], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L539_C4", "vector": [8, 2, 0.7181, 0.0013, 2, 0.29, 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_99326:Expr_L541_C8", "label": "make_operational_all()", "type": "expression", "loc": [541, 541], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L539_C4", "vector": [8, 2, 0.7194, 0.0013, 2, 0.29, 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_99326:Expr_L542_C8", "label": "safeop_things()", "type": "expression", "loc": [542, 542], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L539_C4", "vector": [8, 2, 0.7207, 0.0013, 2, 0.29, 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_99326:Expr_L543_C8", "label": "set_motor_power_on()", "type": "expression", "loc": [543, 543], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L539_C4", "vector": [8, 2, 0.7221, 0.0013, 2, 0.29, 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_99326:Expr_L544_C8", "label": "step()", "type": "expression", "loc": [544, 544], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L539_C4", "vector": [8, 2, 0.7234, 0.0013, 2, 0.29, 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_99326:Expr_L545_C8", "label": "step()", "type": "expression", "loc": [545, 545], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L539_C4", "vector": [8, 2, 0.7247, 0.0013, 2, 0.29, 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_99326:FunctionDef_L547_C4", "label": "stop", "type": "function", "loc": [547, 550], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.7294, 0.0053, 1, 0.3, 0.4615, 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_99326:Expr_L548_C8", "label": "set_motor_power_off()", "type": "expression", "loc": [548, 548], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L547_C4", "vector": [8, 2, 0.7287, 0.0013, 2, 0.48, 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_99326:Expr_L549_C8", "label": "step()", "type": "expression", "loc": [549, 549], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L547_C4", "vector": [8, 2, 0.7301, 0.0013, 2, 0.48, 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_99326:Expr_L550_C8", "label": "stop()", "type": "expression", "loc": [550, 550], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L547_C4", "vector": [8, 2, 0.7314, 0.0013, 2, 0.48, 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_99326:FunctionDef_L559_C4", "label": "get_wrist_force", "type": "function", "loc": [559, 587], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.762, 0.0386, 1, 0.3, 0.5, 854, 0, 2, 1, 0, 0, 0, 18], "semantic": {"name": "get_wrist_force", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_wrist_force(self, arm):\n if arm == 'right_arm' and self.ftclient_r != None:\n return self.get_wrist_force_netft('r')\n\n if arm == 'left_arm' and self.ftclient_l != None:\n return self.get_wrist_force_netft('l')\n\n m = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L560_C8", "label": "if", "type": "if", "loc": [560, 561], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "vector": [4, 2, 0.7453, 0.0027, 2, 0.71, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'right_arm' and self.ftclient_r != None:\n return self.get_wrist_force_netft('r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Return_L561_C12", "label": "return", "type": "return", "loc": [561, 561], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L560_C8", "vector": [13, 3, 0.746, 0.0013, 3, 0.97, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_wrist_force_netft('r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L563_C8", "label": "if", "type": "if", "loc": [563, 564], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "vector": [4, 2, 0.7493, 0.0027, 2, 0.71, 0.0556, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'left_arm' and self.ftclient_l != None:\n return self.get_wrist_force_netft('l')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Return_L564_C12", "label": "return", "type": "return", "loc": [564, 564], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L563_C8", "vector": [13, 3, 0.75, 0.0013, 3, 0.98, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_wrist_force_netft('l')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L566_C8", "label": "m =", "type": "assigned_variable", "loc": [566, 566], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "vector": [14, 2, 0.7527, 0.0013, 2, 0.71, 0.1111, 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_99326:Assign_L567_C8", "label": "lc =", "type": "assigned_variable", "loc": [567, 567], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "vector": [14, 2, 0.754, 0.0013, 2, 0.71, 0.1667, 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_99326:Expr_L568_C8", "label": "append()", "type": "expression", "loc": [568, 568], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "vector": [8, 2, 0.7553, 0.0013, 2, 0.71, 0.2222, 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_99326:Expr_L569_C8", "label": "append()", "type": "expression", "loc": [569, 569], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "vector": [8, 2, 0.7566, 0.0013, 2, 0.71, 0.2778, 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_99326:Expr_L570_C8", "label": "append()", "type": "expression", "loc": [570, 570], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "vector": [8, 2, 0.758, 0.0013, 2, 0.71, 0.3333, 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_99326:Expr_L572_C8", "label": "append()", "type": "expression", "loc": [572, 572], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "vector": [8, 2, 0.7606, 0.0013, 2, 0.71, 0.3889, 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_Tx_mNm()/1000.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L573_C8", "label": "append()", "type": "expression", "loc": [573, 573], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "vector": [8, 2, 0.762, 0.0013, 2, 0.71, 0.4444, 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_Ty_mNm()/1000.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L574_C8", "label": "append()", "type": "expression", "loc": [574, 574], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "vector": [8, 2, 0.7633, 0.0013, 2, 0.71, 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_Tz_mNm()/1000.) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L576_C8", "label": "m =", "type": "assigned_variable", "loc": [576, 576], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "vector": [14, 2, 0.766, 0.0013, 2, 0.71, 0.5556, 711, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m = np.matrix(m).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L577_C8", "label": "r = Rz()", "type": "assigned_variable", "loc": [577, 577], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "vector": [14, 2, 0.7673, 0.0013, 2, 0.71, 0.6111, 436, 3, 1, 0, 0, 936, 10, 2], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rz", "annotation": ""}, "snippet": " r = tr.Rz(math.radians(-30.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L579_C8", "label": "m1 =", "type": "assigned_variable", "loc": [579, 579], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "vector": [14, 2, 0.7699, 0.0013, 2, 0.71, 0.6667, 814, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m1 = r * m[0:3,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L580_C8", "label": "assign", "type": "assigned_variable", "loc": [580, 580], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "vector": [14, 2, 0.7713, 0.0013, 2, 0.71, 0.7222, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m1[1,0] = -m1[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L581_C8", "label": "assign", "type": "assigned_variable", "loc": [581, 581], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "vector": [14, 2, 0.7726, 0.0013, 2, 0.71, 0.7778, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m1[2,0] = -m1[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L583_C8", "label": "m2 =", "type": "assigned_variable", "loc": [583, 583], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "vector": [14, 2, 0.7753, 0.0013, 2, 0.71, 0.8333, 562, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m2 = r * m[3:,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L584_C8", "label": "assign", "type": "assigned_variable", "loc": [584, 584], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "vector": [14, 2, 0.7766, 0.0013, 2, 0.71, 0.8889, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m2[1,0] = -m2[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L585_C8", "label": "assign", "type": "assigned_variable", "loc": [585, 585], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "vector": [14, 2, 0.7779, 0.0013, 2, 0.71, 0.9444, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m2[2,0] = -m2[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Return_L587_C8", "label": "return", "type": "return", "loc": [587, 587], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "vector": [13, 2, 0.7806, 0.0013, 2, 0.71, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.row_stack((m1, m2))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L589_C4", "label": "get_wrist_force_netft", "type": "function", "loc": [589, 600], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.7906, 0.016, 1, 0.3, 0.5385, 372, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "get_wrist_force_netft", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_wrist_force_netft(self, arm):\n if arm == 'r':\n w = self.ftclient_r.read()\n elif arm == 'l':\n w = self.ftclient_l.read()\n\n r = tr.Rz(math.radians(30.))\n f = r * w[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L590_C8", "label": "if", "type": "if", "loc": [590, 593], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L589_C4", "vector": [4, 2, 0.7866, 0.0053, 2, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'r':\n w = self.ftclient_r.read()\n elif arm == 'l':\n w = self.ftclient_l.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L591_C12", "label": "w = read()", "type": "assigned_variable", "loc": [591, 591], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L590_C8", "vector": [14, 3, 0.7859, 0.0013, 3, 0.02, 0.0, 549, 3, 0, 0, 0, 453, 10, 1], "semantic": {"name": "w", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " w = self.ftclient_r.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L592_C8", "label": "if", "type": "if", "loc": [592, 593], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L590_C8", "vector": [4, 3, 0.7879, 0.0027, 3, 0.02, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif arm == 'l':\n w = self.ftclient_l.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L593_C12", "label": "w = read()", "type": "assigned_variable", "loc": [593, 593], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L592_C8", "vector": [14, 4, 0.7886, 0.0013, 4, 0.81, 0.0, 549, 3, 0, 0, 0, 453, 10, 1], "semantic": {"name": "w", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " w = self.ftclient_l.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L595_C8", "label": "r = Rz()", "type": "assigned_variable", "loc": [595, 595], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L589_C4", "vector": [14, 2, 0.7912, 0.0013, 2, 0.37, 0.1667, 436, 3, 1, 0, 0, 936, 10, 2], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rz", "annotation": ""}, "snippet": " r = tr.Rz(math.radians(30.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L596_C8", "label": "f =", "type": "assigned_variable", "loc": [596, 596], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L589_C4", "vector": [14, 2, 0.7926, 0.0013, 2, 0.37, 0.3333, 899, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = r * w[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L597_C8", "label": "t =", "type": "assigned_variable", "loc": [597, 597], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L589_C4", "vector": [14, 2, 0.7939, 0.0013, 2, 0.37, 0.5, 15, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t = r * w[0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L598_C8", "label": "assign", "type": "assigned_variable", "loc": [598, 598], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L589_C4", "vector": [14, 2, 0.7952, 0.0013, 2, 0.37, 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_99326:Assign_L599_C8", "label": "assign", "type": "assigned_variable", "loc": [599, 599], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L589_C4", "vector": [14, 2, 0.7965, 0.0013, 2, 0.37, 0.8333, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t[1,0] = t[1,0] * -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Return_L600_C8", "label": "return", "type": "return", "loc": [600, 600], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L589_C4", "vector": [13, 2, 0.7979, 0.0013, 2, 0.37, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.row_stack((f,t))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L602_C4", "label": "get_wrist_torque", "type": "function", "loc": [602, 608], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.8045, 0.0093, 1, 0.3, 0.5769, 476, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "get_wrist_torque", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_wrist_torque(self, arm):\n m = []\n lc = self.fts[arm]\n m = tr.Rz(math.radians(-30.0))*np.matrix(m).T\n m[1,0] = -m[1,0]\n m[2,0] = -m[2,0]\n return m"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L603_C8", "label": "m =", "type": "assigned_variable", "loc": [603, 603], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L602_C4", "vector": [14, 2, 0.8019, 0.0013, 2, 0.75, 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_99326:Assign_L604_C8", "label": "lc =", "type": "assigned_variable", "loc": [604, 604], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L602_C4", "vector": [14, 2, 0.8032, 0.0013, 2, 0.75, 0.2, 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_99326:Assign_L605_C8", "label": "m =", "type": "assigned_variable", "loc": [605, 605], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L602_C4", "vector": [14, 2, 0.8045, 0.0013, 2, 0.75, 0.4, 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_99326:Assign_L606_C8", "label": "assign", "type": "assigned_variable", "loc": [606, 606], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L602_C4", "vector": [14, 2, 0.8059, 0.0013, 2, 0.75, 0.6, 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_99326:Assign_L607_C8", "label": "assign", "type": "assigned_variable", "loc": [607, 607], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L602_C4", "vector": [14, 2, 0.8072, 0.0013, 2, 0.75, 0.8, 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_99326:Return_L608_C8", "label": "return", "type": "return", "loc": [608, 608], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L602_C4", "vector": [13, 2, 0.8085, 0.0013, 2, 0.75, 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_99326:FunctionDef_L618_C4", "label": "get_joint_accelerations", "type": "function", "loc": [618, 620], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.8231, 0.004, 1, 0.3, 0.6154, 8, 0, 2, 0, 0, 0, 0, 1], "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()\n raise RuntimeError('The meka joint accelerations are incorrect (Because the joint velocities are incorrect - Tapo, Jan 23, 2013). Computing my own joint accelerations.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L626_C4", "label": "get_joint_velocities", "type": "function", "loc": [626, 628], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.8338, 0.004, 1, 0.3, 0.6538, 27, 0, 2, 0, 0, 0, 0, 1], "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()\n raise RuntimeError('The meka joint velocities seem incorrect. (Advait, July 6, 2011). Computing my own joint velocities.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L630_C4", "label": "get_joint_torques", "type": "function", "loc": [630, 633], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.8398, 0.0053, 1, 0.3, 0.6923, 216, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_joint_torques", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_joint_torques(self, arm):\n ''' returns list of 7 joint torques in mNm\n '''\n return self.arms[arm].get_torque_mNm().tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L631_C8", "label": "expression", "type": "expression", "loc": [631, 632], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L630_C4", "vector": [8, 2, 0.8398, 0.0027, 2, 0.18, 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 torques in mNm\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Return_L633_C8", "label": "return", "type": "return", "loc": [633, 633], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L630_C4", "vector": [13, 2, 0.8418, 0.0013, 2, 0.18, 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_torque_mNm().tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L635_C4", "label": "get_motor_temps", "type": "function", "loc": [635, 638], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.8464, 0.0053, 1, 0.3, 0.7308, 813, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_motor_temps", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_motor_temps(self, arm):\n ''' returns list of 7 motor temperatures in Celsius\n '''\n return self.arms[arm].get_motor_temp_C().tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L636_C8", "label": "expression", "type": "expression", "loc": [636, 637], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L635_C4", "vector": [8, 2, 0.8464, 0.0027, 2, 0.73, 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 motor temperatures in Celsius\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Return_L638_C8", "label": "return", "type": "return", "loc": [638, 638], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L635_C4", "vector": [13, 2, 0.8484, 0.0013, 2, 0.73, 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_motor_temp_C().tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L640_C4", "label": "get_joint_angles", "type": "function", "loc": [640, 644], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.8537, 0.0066, 1, 0.3, 0.7692, 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_99326:Expr_L641_C8", "label": "expression", "type": "expression", "loc": [641, 643], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L640_C4", "vector": [8, 2, 0.8537, 0.004, 2, 0.75, 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_99326:Return_L644_C8", "label": "return", "type": "return", "loc": [644, 644], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L640_C4", "vector": [13, 2, 0.8564, 0.0013, 2, 0.75, 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_99326:FunctionDef_L646_C4", "label": "l_jep_cb", "type": "function", "loc": [646, 649], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.861, 0.0053, 1, 0.3, 0.8077, 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_99326:Expr_L647_C8", "label": "acquire()", "type": "expression", "loc": [647, 647], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L646_C4", "vector": [8, 2, 0.8604, 0.0013, 2, 0.19, 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_99326:Assign_L648_C8", "label": "self.l_jep =", "type": "assigned_variable", "loc": [648, 648], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L646_C4", "vector": [14, 2, 0.8617, 0.0013, 2, 0.19, 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_99326:Expr_L649_C8", "label": "release()", "type": "expression", "loc": [649, 649], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L646_C4", "vector": [8, 2, 0.863, 0.0013, 2, 0.19, 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_99326:FunctionDef_L651_C4", "label": "r_jep_cb", "type": "function", "loc": [651, 654], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.8677, 0.0053, 1, 0.3, 0.8462, 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_99326:Expr_L652_C8", "label": "acquire()", "type": "expression", "loc": [652, 652], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L651_C4", "vector": [8, 2, 0.867, 0.0013, 2, 0.86, 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_99326:Assign_L653_C8", "label": "self.r_jep =", "type": "assigned_variable", "loc": [653, 653], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L651_C4", "vector": [14, 2, 0.8684, 0.0013, 2, 0.86, 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_99326:Expr_L654_C8", "label": "release()", "type": "expression", "loc": [654, 654], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L651_C4", "vector": [8, 2, 0.8697, 0.0013, 2, 0.86, 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_99326:FunctionDef_L658_C4", "label": "set_jep", "type": "function", "loc": [658, 676], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.887, 0.0253, 1, 0.3, 0.8846, 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_99326:If_L659_C8", "label": "if", "type": "if", "loc": [659, 660], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L658_C4", "vector": [4, 2, 0.877, 0.0027, 2, 0.3, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.arm_settings[arm] == None:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Return_L660_C12", "label": "return", "type": "return", "loc": [660, 660], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L659_C8", "vector": [13, 3, 0.8777, 0.0013, 3, 0.51, 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_99326:If_L661_C8", "label": "if", "type": "if", "loc": [661, 663], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L658_C4", "vector": [4, 2, 0.8803, 0.004, 2, 0.3, 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_99326:For_L665_C8", "label": "for i, qi", "type": "for", "loc": [665, 669], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L658_C4", "vector": [6, 2, 0.887, 0.0066, 2, 0.3, 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_99326:Expr_L669_C12", "label": "set_theta_rad()", "type": "expression", "loc": [669, 669], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L665_C8", "vector": [8, 3, 0.8896, 0.0013, 3, 0.64, 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_99326:Expr_L671_C8", "label": "acquire()", "type": "expression", "loc": [671, 671], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L658_C4", "vector": [8, 2, 0.8923, 0.0013, 2, 0.3, 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_99326:If_L672_C8", "label": "if", "type": "if", "loc": [672, 675], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L658_C4", "vector": [4, 2, 0.8956, 0.0053, 2, 0.3, 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_99326:Assign_L673_C12", "label": "self.r_jep =", "type": "assigned_variable", "loc": [673, 673], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L672_C8", "vector": [14, 3, 0.8949, 0.0013, 3, 0.87, 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_99326:Assign_L675_C12", "label": "self.l_jep =", "type": "assigned_variable", "loc": [675, 675], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L672_C8", "vector": [14, 3, 0.8976, 0.0013, 3, 0.87, 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_99326:Expr_L676_C8", "label": "release()", "type": "expression", "loc": [676, 676], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L658_C4", "vector": [8, 2, 0.8989, 0.0013, 2, 0.3, 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_99326:FunctionDef_L678_C4", "label": "r_alpha_cb", "type": "function", "loc": [678, 681], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.9036, 0.0053, 1, 0.3, 0.9231, 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_99326:Expr_L679_C8", "label": "acquire()", "type": "expression", "loc": [679, 679], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L678_C4", "vector": [8, 2, 0.9029, 0.0013, 2, 0.31, 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_99326:Expr_L680_C8", "label": "set_stiffness_scale()", "type": "expression", "loc": [680, 680], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L678_C4", "vector": [8, 2, 0.9043, 0.0013, 2, 0.31, 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_99326:Expr_L681_C8", "label": "release()", "type": "expression", "loc": [681, 681], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L678_C4", "vector": [8, 2, 0.9056, 0.0013, 2, 0.31, 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_99326:FunctionDef_L683_C4", "label": "l_alpha_cb", "type": "function", "loc": [683, 686], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.9102, 0.0053, 1, 0.3, 0.9615, 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_99326:Expr_L684_C8", "label": "acquire()", "type": "expression", "loc": [684, 684], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L683_C4", "vector": [8, 2, 0.9096, 0.0013, 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_99326:Expr_L685_C8", "label": "set_stiffness_scale()", "type": "expression", "loc": [685, 685], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L683_C4", "vector": [8, 2, 0.9109, 0.0013, 2, 0.7, 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_99326:Expr_L686_C8", "label": "release()", "type": "expression", "loc": [686, 686], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L683_C4", "vector": [8, 2, 0.9122, 0.0013, 2, 0.7, 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_99326:FunctionDef_L688_C4", "label": "set_alpha", "type": "function", "loc": [688, 691], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "vector": [2, 1, 0.9169, 0.0053, 1, 0.3, 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_99326:Assign_L689_C8", "label": "jcl =", "type": "assigned_variable", "loc": [689, 689], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L688_C4", "vector": [14, 2, 0.9162, 0.0013, 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_99326:For_L690_C8", "label": "for i, a", "type": "for", "loc": [690, 691], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L688_C4", "vector": [6, 2, 0.9182, 0.0027, 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_99326:Expr_L691_C12", "label": "set_stiffness()", "type": "expression", "loc": [691, 691], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L690_C8", "vector": [8, 3, 0.9189, 0.0013, 3, 0.39, 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_99326:If_L695_C0", "label": "if", "type": "if", "loc": [695, 747], "level": 0, "parent": null, "vector": [4, 0, 0.9588, 0.0705, 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 optparse\n\n p = optparse.OptionParser()\n p.add_option('--enable_net_ft_r', action='store_true', dest='netft_r',\n help='use net ft for the right arm')\n p.add_option('--enable_net_ft_l', action='store_true', dest='netft_l',\n help='use net ft for the left arm') #Tiffany 11/11/2011"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Import_L696_C4", "label": "optparse import optparse", "type": "import", "loc": [696, 696], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L695_C0", "vector": [1, 1, 0.9255, 0.0013, 1, 0.79, 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_99326:Assign_L698_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [698, 698], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L695_C0", "vector": [14, 1, 0.9282, 0.0013, 1, 0.79, 0.1667, 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_99326:Expr_L699_C4", "label": "add_option()", "type": "expression", "loc": [699, 700], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L695_C0", "vector": [8, 1, 0.9302, 0.0027, 1, 0.79, 0.3333, 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('--enable_net_ft_r', action='store_true', dest='netft_r',\n help='use net ft for the right arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L701_C4", "label": "add_option()", "type": "expression", "loc": [701, 702], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L695_C0", "vector": [8, 1, 0.9328, 0.0027, 1, 0.79, 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('--enable_net_ft_l', action='store_true', dest='netft_l',\n help='use net ft for the left arm') #Tiffany 11/11/2011"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L703_C4", "label": "add_option()", "type": "expression", "loc": [703, 704], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L695_C0", "vector": [8, 1, 0.9355, 0.0027, 1, 0.79, 0.6667, 176, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--arm_to_use', action='store', dest='arm_to_use',\n help='use only one arm (l or r)', type='string')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L705_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [705, 705], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L695_C0", "vector": [14, 1, 0.9375, 0.0013, 1, 0.79, 0.8333, 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_99326:Try_L707_C4", "label": "try", "type": "try", "loc": [707, 747], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L695_C0", "vector": [7, 1, 0.9668, 0.0545, 1, 0.79, 1.0, 0, 0, 2, 0, 0, 0, 0, 14], "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\n if opt.arm_to_use == 'l':\n enable_left_arm = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L708_C8", "label": "settings_r = MekaArmSettings()", "type": "assigned_variable", "loc": [708, 708], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:Try_L707_C4", "vector": [14, 2, 0.9415, 0.0013, 2, 0.37, 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_99326:Assign_L710_C8", "label": "settings_l = MekaArmSettings()", "type": "assigned_variable", "loc": [710, 710], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:Try_L707_C4", "vector": [14, 2, 0.9441, 0.0013, 2, 0.37, 0.1667, 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_99326:If_L713_C8", "label": "if", "type": "if", "loc": [713, 723], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:Try_L707_C4", "vector": [4, 2, 0.9548, 0.0146, 2, 0.37, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.arm_to_use == 'l':\n enable_left_arm = True\n enable_right_arm = False\n elif opt.arm_to_use == 'r':\n enable_left_arm = False\n enable_right_arm = True\n elif opt.arm_to_use == 'b':\n enable_right_arm = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L714_C12", "label": "enable_left_arm =", "type": "assigned_variable", "loc": [714, 714], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L713_C8", "vector": [14, 3, 0.9495, 0.0013, 3, 0.03, 0.0, 636, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "enable_left_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " enable_left_arm = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L715_C12", "label": "enable_right_arm =", "type": "assigned_variable", "loc": [715, 715], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L713_C8", "vector": [14, 3, 0.9508, 0.0013, 3, 0.03, 0.5, 531, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "enable_right_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " enable_right_arm = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L716_C8", "label": "if", "type": "if", "loc": [716, 723], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L713_C8", "vector": [4, 3, 0.9568, 0.0106, 3, 0.03, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif opt.arm_to_use == 'r':\n enable_left_arm = False\n enable_right_arm = True\n elif opt.arm_to_use == 'b':\n enable_right_arm = True\n enable_left_arm = True\n else:\n raise RuntimeError('Unrecognized value for the arm_to_use command line argument')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L717_C12", "label": "enable_left_arm =", "type": "assigned_variable", "loc": [717, 717], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L716_C8", "vector": [14, 4, 0.9535, 0.0013, 4, 0.17, 0.0, 636, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "enable_left_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " enable_left_arm = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L718_C12", "label": "enable_right_arm =", "type": "assigned_variable", "loc": [718, 718], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L716_C8", "vector": [14, 4, 0.9548, 0.0013, 4, 0.17, 0.5, 531, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "enable_right_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " enable_right_arm = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L719_C8", "label": "if", "type": "if", "loc": [719, 723], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L716_C8", "vector": [4, 4, 0.9588, 0.0066, 4, 0.17, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif opt.arm_to_use == 'b':\n enable_right_arm = True\n enable_left_arm = True\n else:\n raise RuntimeError('Unrecognized value for the arm_to_use command line argument')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L720_C12", "label": "enable_right_arm =", "type": "assigned_variable", "loc": [720, 720], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L719_C8", "vector": [14, 5, 0.9574, 0.0013, 5, 0.57, 0.0, 531, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "enable_right_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " enable_right_arm = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L721_C12", "label": "enable_left_arm =", "type": "assigned_variable", "loc": [721, 721], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L719_C8", "vector": [14, 5, 0.9588, 0.0013, 5, 0.57, 1.0, 636, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "enable_left_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " enable_left_arm = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L725_C8", "label": "cody_arms = MekaArmServer()", "type": "assigned_variable", "loc": [725, 727], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:Try_L707_C4", "vector": [14, 2, 0.9654, 0.004, 2, 0.37, 0.5, 723, 3, 6, 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, opt.netft_r,\n opt.netft_l, enable_right_arm,\n enable_left_arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L731_C8", "label": "power_on()", "type": "expression", "loc": [731, 731], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:Try_L707_C4", "vector": [8, 2, 0.9721, 0.0013, 2, 0.37, 0.6667, 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_99326:While_L733_C8", "label": "while", "type": "while", "loc": [733, 735], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:Try_L707_C4", "vector": [5, 2, 0.9761, 0.004, 2, 0.37, 0.8333, 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_99326:Expr_L734_C12", "label": "step_ros()", "type": "expression", "loc": [734, 734], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:While_L733_C8", "vector": [8, 3, 0.9761, 0.0013, 3, 0.08, 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_99326:Expr_L735_C12", "label": "sleep()", "type": "expression", "loc": [735, 735], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:While_L733_C8", "vector": [8, 3, 0.9774, 0.0013, 3, 0.08, 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_99326:Expr_L736_C8", "label": "stop()", "type": "expression", "loc": [736, 736], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:Try_L707_C4", "vector": [8, 2, 0.9787, 0.0013, 2, 0.37, 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_99326:Expr_L739_C8", "label": "print()", "type": "expression", "loc": [739, 739], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:Try_L707_C4", "vector": [8, 2, 0.9827, 0.0013, 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('############################################################')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L740_C8", "label": "print()", "type": "expression", "loc": [740, 740], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:Try_L707_C4", "vector": [8, 2, 0.984, 0.0013, 2, 0.37, 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_99326:Expr_L741_C8", "label": "print()", "type": "expression", "loc": [741, 741], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:Try_L707_C4", "vector": [8, 2, 0.9854, 0.0013, 2, 0.37, 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_99326:If_L745_C8", "label": "if", "type": "if", "loc": [745, 746], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:Try_L707_C4", "vector": [4, 2, 0.9914, 0.0027, 2, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'cody_arms' in locals():\n cody_arms.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L746_C12", "label": "stop()", "type": "expression", "loc": [746, 746], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L745_C8", "vector": [8, 3, 0.992, 0.0013, 3, 0.41, 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_99326:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Return_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L128_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L129_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L133_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L134_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L136_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L138_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L149_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L150_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L152_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L154_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L155_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L154_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L154_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L158_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L211_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L211_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L211_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L213_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L211_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L215_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L216_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L215_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L219_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L219_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L220_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L220_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L221_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L221_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L222_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L215_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L225_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L215_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L227_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L227_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L228_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L227_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L229_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L229_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L230_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L229_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L231_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L227_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L232_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L232_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L233_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L232_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L234_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L234_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L235_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L234_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L236_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L234_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L237_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L232_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L239_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L232_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L240_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L232_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L241_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L232_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L242_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L232_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L244_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L244_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L245_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L244_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L246_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L246_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L247_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L246_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L248_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L246_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L249_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L244_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L252_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L256_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L256_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L257_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L256_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L256_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L259_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L256_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L256_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L262_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L263_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L256_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L264_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L265_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L273_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L274_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L273_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L275_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L277_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L278_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L277_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L279_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L281_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L281_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L282_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L285_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L287_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L287_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L288_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L287_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L289_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L289_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L292_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L289_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L294_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L287_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L295_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L287_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L297_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L299_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L299_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L300_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L299_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L301_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L301_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L304_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L301_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L306_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L299_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L307_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L299_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L309_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L311_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L311_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L312_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L311_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L314_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L314_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L315_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L314_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L316_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L318_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L320_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L321_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L322_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L324_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L326_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L326_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L327_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L326_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L328_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L326_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L330_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L326_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L331_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L326_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L333_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L326_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L334_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L336_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L336_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L337_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L336_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L338_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L336_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L340_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L336_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L341_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L336_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L343_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L336_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L344_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L346_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L348_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L349_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L351_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L351_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L353_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L351_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L354_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L351_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L355_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L357_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L357_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L358_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L357_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L359_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L357_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L360_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L360_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L361_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L357_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L362_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L362_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L363_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L357_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L365_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L365_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L366_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L365_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L370_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L370_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L371_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L370_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L375_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L375_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L376_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L370_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L377_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L370_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L378_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L381_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L382_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L384_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L386_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L386_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L387_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L386_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L388_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L390_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L390_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L391_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L390_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L392_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L394_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L396_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L396_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L397_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L396_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L398_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L400_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L400_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L401_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L400_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L402_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L404_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L406_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L408_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L408_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L409_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L411_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L411_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L412_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L411_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L413_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L411_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L414_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L411_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L416_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L411_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L417_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L411_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L418_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L420_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L420_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L421_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L420_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L422_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L420_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L423_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L420_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L425_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L420_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L426_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L420_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L427_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L433_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L434_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L434_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L435_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L434_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L437_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L434_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L439_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L434_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L441_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L434_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L442_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L444_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L445_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L446_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L447_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L448_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L450_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L450_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L451_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L450_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L452_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L454_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L454_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L455_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L454_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L456_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L459_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L460_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L461_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L463_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L464_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L465_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L467_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L467_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L468_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L467_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L469_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L467_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L470_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L467_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L471_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L467_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L472_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L467_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L473_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L467_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L475_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L467_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L476_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L467_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L478_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L467_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L479_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L467_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L480_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L482_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L482_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L483_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L482_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L484_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L482_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L485_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L482_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L486_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L482_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L487_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L482_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L488_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L482_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L490_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L482_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L491_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L482_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L493_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L482_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L494_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L482_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L495_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L497_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L380_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L499_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L501_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L501_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Return_L502_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L509_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L509_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L510_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L512_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L512_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L513_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L512_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L514_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L512_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L515_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L512_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L516_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L518_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L518_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L519_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L518_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L520_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L520_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L521_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L518_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L522_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L522_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L523_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L518_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L525_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L525_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L526_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L525_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L527_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L525_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L529_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L525_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L531_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L525_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L532_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L525_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L533_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L533_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L534_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L533_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L536_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L525_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L537_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L539_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L539_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L540_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L539_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L541_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L539_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L542_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L539_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L543_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L539_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L544_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L539_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L545_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L547_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L547_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L548_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L547_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L549_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L547_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L550_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L560_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L560_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Return_L561_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L563_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L563_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Return_L564_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L566_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L567_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L568_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L569_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L570_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L572_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L573_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L574_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L576_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L577_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L579_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L580_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L581_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L583_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L584_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L585_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L559_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Return_L587_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L589_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L589_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L590_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L590_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L591_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L590_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L592_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L592_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L593_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L589_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L595_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L589_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L596_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L589_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L597_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L589_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L598_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L589_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L599_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L589_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Return_L600_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L602_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L602_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L603_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L602_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L604_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L602_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L605_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L602_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L606_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L602_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L607_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L602_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Return_L608_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L618_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L626_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L630_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L630_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L631_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L630_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Return_L633_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L635_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L635_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L636_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L635_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Return_L638_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L640_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L640_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L641_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L640_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Return_L644_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L646_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L647_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L648_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L649_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L651_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L651_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L652_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L651_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L653_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L651_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L654_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L658_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L658_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L659_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L659_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Return_L660_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L658_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L661_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L658_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L665_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L665_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L669_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L658_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L671_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L658_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L672_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L672_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L673_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L672_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L675_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L658_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L676_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L678_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L678_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L679_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L678_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L680_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L678_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L681_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L683_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L683_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L684_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L683_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L685_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L683_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L686_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L688_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L688_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L689_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:FunctionDef_L688_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L690_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:For_L690_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L691_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L695_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Import_L696_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L695_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L698_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L695_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L699_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L695_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L701_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L695_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L703_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L695_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L705_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L695_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Try_L707_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:Try_L707_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L708_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:Try_L707_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L710_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:Try_L707_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L713_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L713_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L714_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L713_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L715_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L713_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L716_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L716_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L717_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L716_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L718_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L716_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L719_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L719_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L720_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L719_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L721_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:Try_L707_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Assign_L725_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:Try_L707_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L731_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:Try_L707_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:While_L733_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:While_L733_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L734_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:While_L733_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L735_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:Try_L707_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L736_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:Try_L707_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L739_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:Try_L707_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L740_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:Try_L707_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L741_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:Try_L707_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L745_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99326:If_L745_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99326:Expr_L746_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 cody_arm_kinematics as cak import math, numpy as np import sys, optparse import roslib; roslib.load_manifest('hrl_cody_arms') import hrl_lib.transforms as tr import hrl_lib.util as ut def find_good_config(pt,dic): ''' finds a good configuration for the 3x1 pt. ''' m = dic['cart_pts_mat'] min_idx = np.argmin(ut.norm(m-pt)) c = dic['good_configs_list'][min_idx] # print 'good configuration:', [math.degrees(qi) for qi in c] return c def test_dict(fname): dic = ut.load_pickle(fname) firenze = cak.CodyArmKinematics('r') rot = tr.rotY(math.radians(-90)) p = np.matrix([0.4,-0.42,-0.2]).T c = find_good_config(p, dic) res = firenze.IK(p, rot, q_guess=c) print 'IK soln: ', [math.degrees(qi) for qi in res] def create_dict(fname): firenze = cak.CodyArmKinematics('r') good_configs_list = ut.load_pickle(fname) cartesian_points_list = [] for gc in good_configs_list: cartesian_points_list.append(firenze.FK(gc).A1.tolist()) m = np.matrix(cartesian_points_list).T print 'm.shape:', m.shape dic = {'cart_pts_mat':m, 'good_configs_list':good_configs_list} ut.save_pickle(dic,ut.formatted_time()+'_goodconf_dict.pkl') def record_good_configs(use_left_arm): import m3.toolbox as m3t import cody_arm_client as cac if use_left_arm: arm = 'l' else: arm = 'r' firenze = cac.CodyArmClient(arm) print 'hit ENTER to start the recording process' k=m3t.get_keystroke() good_configs_list = [] while k == '\r': print 'hit ENTER to record configuration, something else to exit' k=m3t.get_keystroke() q = firenze.get_joint_angles(arm) good_configs_list.append(np.matrix(q).A1.tolist()) 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_99327
79
135
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99327:Import_L30_C0", "label": "cody_arm_kinematics import cak", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.2222, 0.0074, 0, 0.66, 0.0, 201, 0, 1, 0, 0, 201, 0, 0], "semantic": {"name": "cody_arm_kinematics", "arg_names": [], "import_names": ["cak"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cody_arm_kinematics as cak"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:Import_L31_C0", "label": "math import math, np", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.2296, 0.0074, 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_99327:Import_L32_C0", "label": "sys import sys, optparse", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.237, 0.0074, 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_99327:Import_L34_C0", "label": "roslib import roslib", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.2519, 0.0074, 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('hrl_cody_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L34_C15", "label": "load_manifest()", "type": "expression", "loc": [34, 34], "level": 0, "parent": null, "vector": [8, 0, 0.2519, 0.0074, 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('hrl_cody_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:Import_L35_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.2593, 0.0074, 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_99327:Import_L36_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.2667, 0.0074, 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_99327:FunctionDef_L38_C0", "label": "find_good_config", "type": "function", "loc": [38, 45], "level": 0, "parent": null, "vector": [2, 0, 0.3074, 0.0593, 0, 0.66, 0.6364, 858, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "find_good_config", "arg_names": ["pt", "dic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def find_good_config(pt,dic):\n ''' finds a good configuration for the 3x1 pt.\n '''\n m = dic['cart_pts_mat']\n min_idx = np.argmin(ut.norm(m-pt))\n c = dic['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_99327:Expr_L39_C4", "label": "expression", "type": "expression", "loc": [39, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L38_C0", "vector": [8, 1, 0.2926, 0.0148, 1, 0.06, 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_99327:Assign_L41_C4", "label": "m =", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L38_C0", "vector": [14, 1, 0.3037, 0.0074, 1, 0.06, 0.25, 711, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m = dic['cart_pts_mat']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L42_C4", "label": "min_idx = argmin()", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L38_C0", "vector": [14, 1, 0.3111, 0.0074, 1, 0.06, 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_99327:Assign_L43_C4", "label": "c =", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L38_C0", "vector": [14, 1, 0.3185, 0.0074, 1, 0.06, 0.75, 411, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c = dic['good_configs_list'][min_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:Return_L45_C4", "label": "return", "type": "return", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L38_C0", "vector": [13, 1, 0.3333, 0.0074, 1, 0.06, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L47_C0", "label": "test_dict", "type": "function", "loc": [47, 56], "level": 0, "parent": null, "vector": [2, 0, 0.3815, 0.0741, 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 dic = ut.load_pickle(fname)\n firenze = cak.CodyArmKinematics('r')\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, dic)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L48_C4", "label": "dic = load_pickle()", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L47_C0", "vector": [14, 1, 0.3556, 0.0074, 1, 0.03, 0.0, 37, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "dic", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " dic = ut.load_pickle(fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L49_C4", "label": "firenze = CodyArmKinematics()", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L47_C0", "vector": [14, 1, 0.363, 0.0074, 1, 0.03, 0.1667, 736, 3, 1, 0, 0, 11, 10, 1], "semantic": {"name": "firenze", "arg_names": [], "import_names": [], "rhs_call_name": "CodyArmKinematics", "annotation": ""}, "snippet": " firenze = cak.CodyArmKinematics('r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L51_C4", "label": "rot = rotY()", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L47_C0", "vector": [14, 1, 0.3778, 0.0074, 1, 0.03, 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_99327:Assign_L52_C4", "label": "p =", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L47_C0", "vector": [14, 1, 0.3852, 0.0074, 1, 0.03, 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_99327:Assign_L54_C4", "label": "c = find_good_config()", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L47_C0", "vector": [14, 1, 0.4, 0.0074, 1, 0.03, 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, dic)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L55_C4", "label": "res = IK()", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L47_C0", "vector": [14, 1, 0.4074, 0.0074, 1, 0.03, 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_99327:Expr_L56_C4", "label": "print()", "type": "expression", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L47_C0", "vector": [8, 1, 0.4148, 0.0074, 1, 0.03, 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_99327:FunctionDef_L58_C0", "label": "create_dict", "type": "function", "loc": [58, 68], "level": 0, "parent": null, "vector": [2, 0, 0.4667, 0.0815, 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 = cak.CodyArmKinematics('r')\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(gc).A1.tolist())\n\n m = np.matrix(cartesian_points_list).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L59_C4", "label": "firenze = CodyArmKinematics()", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L58_C0", "vector": [14, 1, 0.437, 0.0074, 1, 0.45, 0.0, 736, 3, 1, 0, 0, 11, 10, 1], "semantic": {"name": "firenze", "arg_names": [], "import_names": [], "rhs_call_name": "CodyArmKinematics", "annotation": ""}, "snippet": " firenze = cak.CodyArmKinematics('r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327: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_99327:FunctionDef_L58_C0", "vector": [14, 1, 0.4444, 0.0074, 1, 0.45, 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_99327:Assign_L61_C4", "label": "cartesian_points_list =", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L58_C0", "vector": [14, 1, 0.4519, 0.0074, 1, 0.45, 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_99327:For_L62_C4", "label": "for gc", "type": "for", "loc": [62, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L58_C0", "vector": [6, 1, 0.463, 0.0148, 1, 0.45, 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(gc).A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L63_C8", "label": "append()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:For_L62_C4", "vector": [8, 2, 0.4667, 0.0074, 2, 0.04, 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(gc).A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L65_C4", "label": "m =", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L58_C0", "vector": [14, 1, 0.4815, 0.0074, 1, 0.45, 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_99327:Expr_L66_C4", "label": "print()", "type": "expression", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L58_C0", "vector": [8, 1, 0.4889, 0.0074, 1, 0.45, 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_99327:Assign_L67_C4", "label": "dic =", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L58_C0", "vector": [14, 1, 0.4963, 0.0074, 1, 0.45, 0.8571, 37, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "dic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dic = {'cart_pts_mat':m, 'good_configs_list':good_configs_list}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L68_C4", "label": "save_pickle()", "type": "expression", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L58_C0", "vector": [8, 1, 0.5037, 0.0074, 1, 0.45, 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(dic,ut.formatted_time()+'_goodconf_dict.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L70_C0", "label": "record_good_configs", "type": "function", "loc": [70, 90], "level": 0, "parent": null, "vector": [2, 0, 0.5926, 0.1556, 0, 0.66, 0.9091, 421, 0, 1, 0, 0, 0, 0, 11], "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 import cody_arm_client as cac\n if use_left_arm:\n arm = 'l'\n else:\n arm = 'r'\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:Import_L71_C4", "label": "m3.toolbox import m3t", "type": "import", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L70_C0", "vector": [1, 1, 0.5259, 0.0074, 1, 0.25, 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_99327:Import_L72_C4", "label": "cody_arm_client import cac", "type": "import", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L70_C0", "vector": [1, 1, 0.5333, 0.0074, 1, 0.25, 0.125, 943, 0, 1, 0, 0, 943, 0, 0], "semantic": {"name": "cody_arm_client", "arg_names": [], "import_names": ["cac"], "rhs_call_name": "", "annotation": ""}, "snippet": " import cody_arm_client as cac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L73_C4", "label": "if", "type": "if", "loc": [73, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L70_C0", "vector": [4, 1, 0.5519, 0.0296, 1, 0.25, 0.25, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if use_left_arm:\n arm = 'l'\n else:\n arm = 'r'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L74_C8", "label": "arm =", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L73_C4", "vector": [14, 2, 0.5481, 0.0074, 2, 0.16, 0.0, 413, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = 'l'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L76_C8", "label": "arm =", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L73_C4", "vector": [14, 2, 0.563, 0.0074, 2, 0.16, 1.0, 413, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = 'r'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L78_C4", "label": "firenze = CodyArmClient()", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L70_C0", "vector": [14, 1, 0.5778, 0.0074, 1, 0.25, 0.375, 736, 3, 1, 0, 0, 48, 10, 1], "semantic": {"name": "firenze", "arg_names": [], "import_names": [], "rhs_call_name": "CodyArmClient", "annotation": ""}, "snippet": " firenze = cac.CodyArmClient(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L79_C4", "label": "print()", "type": "expression", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L70_C0", "vector": [8, 1, 0.5852, 0.0074, 1, 0.25, 0.5, 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_99327:Assign_L80_C4", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L70_C0", "vector": [14, 1, 0.5926, 0.0074, 1, 0.25, 0.625, 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_99327:Assign_L82_C4", "label": "good_configs_list =", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L70_C0", "vector": [14, 1, 0.6074, 0.0074, 1, 0.25, 0.75, 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_99327:While_L84_C4", "label": "while", "type": "while", "loc": [84, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L70_C0", "vector": [5, 1, 0.637, 0.037, 1, 0.25, 0.875, 0, 0, 0, 0, 0, 0, 0, 6], "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 q = firenze.get_joint_angles(arm)\n good_configs_list.append(np.matrix(q).A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L85_C8", "label": "print()", "type": "expression", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:While_L84_C4", "vector": [8, 2, 0.6296, 0.0074, 2, 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('hit ENTER to record configuration, something else to exit')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L86_C8", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:While_L84_C4", "vector": [14, 2, 0.637, 0.0074, 2, 0.19, 0.3333, 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_99327:Assign_L87_C8", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:While_L84_C4", "vector": [14, 2, 0.6444, 0.0074, 2, 0.19, 0.6667, 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_99327:Expr_L88_C8", "label": "append()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:While_L84_C4", "vector": [8, 2, 0.6519, 0.0074, 2, 0.19, 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_99327:Expr_L90_C4", "label": "save_pickle()", "type": "expression", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L70_C0", "vector": [8, 1, 0.6667, 0.0074, 1, 0.25, 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_99327:If_L92_C0", "label": "if", "type": "if", "loc": [92, 133], "level": 0, "parent": null, "vector": [4, 0, 0.8333, 0.3111, 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_99327:Assign_L93_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "vector": [14, 1, 0.6889, 0.0074, 1, 0.52, 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_99327:Expr_L94_C4", "label": "add_option()", "type": "expression", "loc": [94, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "vector": [8, 1, 0.7, 0.0148, 1, 0.52, 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_99327:Expr_L96_C4", "label": "add_option()", "type": "expression", "loc": [96, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "vector": [8, 1, 0.7148, 0.0148, 1, 0.52, 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_99327:Expr_L98_C4", "label": "add_option()", "type": "expression", "loc": [98, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "vector": [8, 1, 0.7296, 0.0148, 1, 0.52, 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_99327:Expr_L100_C4", "label": "add_option()", "type": "expression", "loc": [100, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "vector": [8, 1, 0.7444, 0.0148, 1, 0.52, 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_99327:Expr_L102_C4", "label": "add_option()", "type": "expression", "loc": [102, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "vector": [8, 1, 0.7593, 0.0148, 1, 0.52, 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_99327:Expr_L104_C4", "label": "add_option()", "type": "expression", "loc": [104, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "vector": [8, 1, 0.7741, 0.0148, 1, 0.52, 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_99327:Assign_L107_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "vector": [14, 1, 0.7926, 0.0074, 1, 0.52, 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_99327:Assign_L108_C4", "label": "record =", "type": "assigned_variable", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "vector": [14, 1, 0.8, 0.0074, 1, 0.52, 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_99327:Assign_L109_C4", "label": "create =", "type": "assigned_variable", "loc": [109, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "vector": [14, 1, 0.8074, 0.0074, 1, 0.52, 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_99327:Assign_L110_C4", "label": "test =", "type": "assigned_variable", "loc": [110, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "vector": [14, 1, 0.8148, 0.0074, 1, 0.52, 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_99327:Assign_L111_C4", "label": "fname =", "type": "assigned_variable", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "vector": [14, 1, 0.8222, 0.0074, 1, 0.52, 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_99327:Assign_L112_C4", "label": "use_left_arm =", "type": "assigned_variable", "loc": [112, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "vector": [14, 1, 0.8296, 0.0074, 1, 0.52, 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_99327:Assign_L113_C4", "label": "use_right_arm =", "type": "assigned_variable", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "vector": [14, 1, 0.837, 0.0074, 1, 0.52, 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_99327:If_L115_C4", "label": "if", "type": "if", "loc": [115, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "vector": [4, 1, 0.9185, 0.1407, 1, 0.52, 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_99327:If_L116_C8", "label": "if", "type": "if", "loc": [116, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L115_C4", "vector": [4, 2, 0.8667, 0.0222, 2, 0.04, 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_99327:Expr_L117_C12", "label": "print()", "type": "expression", "loc": [117, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L116_C8", "vector": [8, 3, 0.8667, 0.0074, 3, 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('Specify a file name.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L118_C12", "label": "exit()", "type": "expression", "loc": [118, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L116_C8", "vector": [8, 3, 0.8741, 0.0074, 3, 0.73, 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_99327:Expr_L119_C8", "label": "test_dict()", "type": "expression", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L115_C4", "vector": [8, 2, 0.8815, 0.0074, 2, 0.04, 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_99327:If_L120_C4", "label": "if", "type": "if", "loc": [120, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L115_C4", "vector": [4, 2, 0.937, 0.1037, 2, 0.04, 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_99327:If_L121_C8", "label": "if", "type": "if", "loc": [121, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L120_C4", "vector": [4, 3, 0.9037, 0.0222, 3, 0.17, 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_99327:Expr_L122_C12", "label": "print()", "type": "expression", "loc": [122, 122], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L121_C8", "vector": [8, 4, 0.9037, 0.0074, 4, 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('Specify a file name.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L123_C12", "label": "exit()", "type": "expression", "loc": [123, 123], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L121_C8", "vector": [8, 4, 0.9111, 0.0074, 4, 0.02, 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_99327:Expr_L124_C8", "label": "create_dict()", "type": "expression", "loc": [124, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L120_C4", "vector": [8, 3, 0.9185, 0.0074, 3, 0.17, 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_99327:If_L125_C4", "label": "if", "type": "if", "loc": [125, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L120_C4", "vector": [4, 3, 0.9556, 0.0667, 3, 0.17, 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_99327:If_L126_C8", "label": "if", "type": "if", "loc": [126, 129], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L125_C4", "vector": [4, 4, 0.9444, 0.0296, 4, 0.74, 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_99327:Expr_L127_C12", "label": "print()", "type": "expression", "loc": [127, 127], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L126_C8", "vector": [8, 5, 0.9407, 0.0074, 5, 0.83, 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_99327:Expr_L128_C12", "label": "print()", "type": "expression", "loc": [128, 128], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L126_C8", "vector": [8, 5, 0.9481, 0.0074, 5, 0.83, 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_99327:Expr_L129_C12", "label": "exit()", "type": "expression", "loc": [129, 129], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L126_C8", "vector": [8, 5, 0.9556, 0.0074, 5, 0.83, 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_99327:Expr_L131_C8", "label": "record_good_configs()", "type": "expression", "loc": [131, 131], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L125_C4", "vector": [8, 4, 0.9704, 0.0074, 4, 0.74, 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_99327:Expr_L133_C8", "label": "print()", "type": "expression", "loc": [133, 133], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L125_C4", "vector": [8, 4, 0.9852, 0.0074, 4, 0.74, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Please specify either record or create.')"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Return_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:For_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:For_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Import_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Import_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:While_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:While_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:While_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:While_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:While_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:FunctionDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Assign_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L118_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L123_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L126_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L126_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L128_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L126_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L129_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99327:If_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99327:Expr_L133_C8"}]
import numpy as np, math import copy import roslib; roslib.load_manifest('equilibrium_point_control') import rospy from std_msgs.msg import Bool class EP_Generator(): # @param ep_gen_func: function that returns stop, ea where ea is the param to the control_function and stop: string which is '' for epc motion to continue def __init__(self, ep_gen_func, control_function, ep_clamp_func=None): self.ep_gen_func = ep_gen_func self.control_function = control_function self.ep_clamp_func = ep_clamp_func ## 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, robot, epc_name = 'epc'): self.robot = robot 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 ep_gen - object of EP_Generator. can include any state that you want. # @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, time_step, timeout=np.inf): ep_gen_func = ep_gen.ep_gen_func control_function = ep_gen.control_function ep_clamp_func = ep_gen.ep_clamp_func 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 = ep_gen_func(ep_gen) if stop == 'reset timing': stop = '' t_end = rospy.get_time() if stop == '': if ep_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 ## # this function only makes sense for arms where we have Joint # space Equilibrium Point Control. def go_jep(self, goal_jep, speed=math.radians(20)): start_jep = self.robot.get_ep() diff_jep = np.array(goal_jep) - np.array(start_jep) time_step = 0.02 max_ch = np.max(np.abs(diff_jep)) total_time = max_ch / speed n_steps = max(np.round(total_time / time_step + 0.5), 1) jep_step = diff_jep / n_steps def eq_gen_func(ep_gen): jep = ep_gen.jep step_num = ep_gen.step_num if step_num < n_steps: q = list(np.array(jep) + jep_step) stop = '' else: q = None stop = 'Reached' step_num += 1 ep_gen.jep = q ep_gen.step_num = step_num return stop, (q, time_step*1.2) ep_gen = EP_Generator(eq_gen_func, self.robot.set_ep) ep_gen.step_num = 0 ep_gen.jep = copy.copy(start_jep) return self.epc_motion(ep_gen, time_step)
ajibawa-2023/Python-Code-Large/train/row_99328
77
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_99328:Import_L2_C0", "label": "numpy import np, math", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0171, 0.0085, 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_99328:Import_L3_C0", "label": "copy import copy", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0256, 0.0085, 0, 0.66, 0.1429, 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_99328:Import_L4_C0", "label": "roslib import roslib", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0342, 0.0085, 0, 0.66, 0.2857, 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('equilibrium_point_control')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Expr_L4_C15", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0342, 0.0085, 0, 0.66, 0.4286, 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('equilibrium_point_control')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0427, 0.0085, 0, 0.66, 0.5714, 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_99328:ImportFrom_L6_C0", "label": "from std_msgs.msg import Bool", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0513, 0.0085, 0, 0.66, 0.7143, 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_99328:ClassDef_L9_C0", "label": "EP_Generator", "type": "class", "loc": [9, 15], "level": 0, "parent": null, "vector": [3, 0, 0.1026, 0.0598, 0, 0.66, 0.8571, 867, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "EP_Generator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class EP_Generator():\n # @param ep_gen_func: function that returns stop, ea where ea is the param to the control_function and stop: string which is '' for epc motion to continue\n def __init__(self, ep_gen_func, control_function,\n ep_clamp_func=None):\n self.ep_gen_func = ep_gen_func\n self.control_function = control_function\n self.ep_clamp_func = ep_clamp_func"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L11_C4", "label": "__init__", "type": "function", "loc": [11, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:ClassDef_L9_C0", "vector": [2, 1, 0.1111, 0.0427, 1, 0.28, 0.0, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "ep_gen_func", "control_function", "ep_clamp_func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, ep_gen_func, control_function,\n ep_clamp_func=None):\n self.ep_gen_func = ep_gen_func\n self.control_function = control_function\n self.ep_clamp_func = ep_clamp_func"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L13_C8", "label": "self.ep_gen_func =", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L11_C4", "vector": [14, 2, 0.1111, 0.0085, 2, 0.4, 0.0, 539, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.ep_gen_func", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ep_gen_func = ep_gen_func"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L14_C8", "label": "self.control_function =", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L11_C4", "vector": [14, 2, 0.1197, 0.0085, 2, 0.4, 0.5, 372, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.control_function", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.control_function = control_function"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L15_C8", "label": "self.ep_clamp_func =", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L11_C4", "vector": [14, 2, 0.1282, 0.0085, 2, 0.4, 1.0, 31, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.ep_clamp_func", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ep_clamp_func = ep_clamp_func"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:ClassDef_L21_C0", "label": "EPC", "type": "class", "loc": [21, 115], "level": 0, "parent": null, "vector": [3, 0, 0.5812, 0.812, 0, 0.66, 1.0, 417, 0, 6, 0, 0, 0, 0, 27], "semantic": {"name": "EPC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class EPC():\n def __init__(self, robot, epc_name = 'epc'):\n self.robot = robot\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"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L22_C4", "label": "__init__", "type": "function", "loc": [22, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:ClassDef_L21_C0", "vector": [2, 1, 0.2094, 0.0513, 1, 0.29, 0.0, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "robot", "epc_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, robot, epc_name = 'epc'):\n self.robot = robot\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_99328:Assign_L23_C8", "label": "self.robot =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L22_C4", "vector": [14, 2, 0.1966, 0.0085, 2, 0.36, 0.0, 879, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.robot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.robot = robot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L24_C8", "label": "self.stop_epc =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L22_C4", "vector": [14, 2, 0.2051, 0.0085, 2, 0.36, 0.25, 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_99328:Assign_L25_C8", "label": "self.pause_epc =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L22_C4", "vector": [14, 2, 0.2137, 0.0085, 2, 0.36, 0.5, 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_99328:Expr_L26_C8", "label": "Subscriber()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L22_C4", "vector": [8, 2, 0.2222, 0.0085, 2, 0.36, 0.75, 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_99328:Expr_L27_C8", "label": "Subscriber()", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L22_C4", "vector": [8, 2, 0.2308, 0.0085, 2, 0.36, 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_99328:FunctionDef_L29_C4", "label": "stop_cb", "type": "function", "loc": [29, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:ClassDef_L21_C0", "vector": [2, 1, 0.2564, 0.0256, 1, 0.29, 0.25, 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_99328:Assign_L30_C8", "label": "self.stop_epc =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L29_C4", "vector": [14, 2, 0.2564, 0.0085, 2, 0.78, 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_99328:Assign_L31_C8", "label": "self.pause_epc =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L29_C4", "vector": [14, 2, 0.265, 0.0085, 2, 0.78, 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_99328:FunctionDef_L33_C4", "label": "pause_cb", "type": "function", "loc": [33, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:ClassDef_L21_C0", "vector": [2, 1, 0.2863, 0.0171, 1, 0.29, 0.5, 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_99328:Assign_L34_C8", "label": "self.pause_epc =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L33_C4", "vector": [14, 2, 0.2906, 0.0085, 2, 0.27, 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_99328:FunctionDef_L42_C4", "label": "epc_motion", "type": "function", "loc": [42, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:ClassDef_L21_C0", "vector": [2, 1, 0.5385, 0.3675, 1, 0.29, 0.75, 938, 0, 4, 1, 0, 0, 0, 12], "semantic": {"name": "epc_motion", "arg_names": ["self", "ep_gen", "time_step", "timeout"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def epc_motion(self, ep_gen, time_step, timeout=np.inf):\n ep_gen_func = ep_gen.ep_gen_func\n control_function = ep_gen.control_function\n ep_clamp_func = ep_gen.ep_clamp_func\n\n rt = rospy.Rate(1/time_step)\n timeout_at = rospy.get_time() + timeout\n stop = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L43_C8", "label": "ep_gen_func =", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L42_C4", "vector": [14, 2, 0.3675, 0.0085, 2, 0.63, 0.0, 16, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ep_gen_func", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ep_gen_func = ep_gen.ep_gen_func"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L44_C8", "label": "control_function =", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L42_C4", "vector": [14, 2, 0.3761, 0.0085, 2, 0.63, 0.125, 736, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "control_function", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " control_function = ep_gen.control_function"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L45_C8", "label": "ep_clamp_func =", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L42_C4", "vector": [14, 2, 0.3846, 0.0085, 2, 0.63, 0.25, 297, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ep_clamp_func", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ep_clamp_func = ep_gen.ep_clamp_func"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L47_C8", "label": "rt = Rate()", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L42_C4", "vector": [14, 2, 0.4017, 0.0085, 2, 0.63, 0.375, 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_99328:Assign_L48_C8", "label": "timeout_at =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L42_C4", "vector": [14, 2, 0.4103, 0.0085, 2, 0.63, 0.5, 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_99328:Assign_L49_C8", "label": "stop =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L42_C4", "vector": [14, 2, 0.4188, 0.0085, 2, 0.63, 0.625, 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_99328:Assign_L50_C8", "label": "ea =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L42_C4", "vector": [14, 2, 0.4274, 0.0085, 2, 0.63, 0.75, 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_99328:While_L51_C8", "label": "while", "type": "while", "loc": [51, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L42_C4", "vector": [5, 2, 0.5684, 0.2735, 2, 0.63, 0.875, 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_99328:If_L52_C12", "label": "if", "type": "if", "loc": [52, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:While_L51_C8", "vector": [4, 3, 0.453, 0.0256, 3, 0.06, 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_99328:Assign_L53_C16", "label": "stop =", "type": "assigned_variable", "loc": [53, 53], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L52_C12", "vector": [14, 4, 0.453, 0.0085, 4, 0.56, 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_99328:If_L56_C12", "label": "if", "type": "if", "loc": [56, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:While_L51_C8", "vector": [4, 3, 0.4872, 0.0256, 3, 0.06, 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_99328:Assign_L57_C16", "label": "stop =", "type": "assigned_variable", "loc": [57, 57], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L56_C12", "vector": [14, 4, 0.4872, 0.0085, 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 = 'stop_command_over_ROS'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L60_C12", "label": "if", "type": "if", "loc": [60, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:While_L51_C8", "vector": [4, 3, 0.5256, 0.0342, 3, 0.06, 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_99328:Expr_L61_C16", "label": "sleep()", "type": "expression", "loc": [61, 61], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L60_C12", "vector": [8, 4, 0.5214, 0.0085, 4, 0.88, 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_99328:If_L65_C12", "label": "if", "type": "if", "loc": [65, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:While_L51_C8", "vector": [4, 3, 0.5598, 0.0171, 3, 0.06, 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_99328:Assign_L66_C16", "label": "stop =", "type": "assigned_variable", "loc": [66, 66], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L65_C12", "vector": [14, 4, 0.5641, 0.0085, 4, 0.1, 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_99328:If_L67_C12", "label": "if", "type": "if", "loc": [67, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:While_L51_C8", "vector": [4, 3, 0.5769, 0.0171, 3, 0.06, 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 = ep_gen_func(ep_gen)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L68_C16", "label": "stop, ea = ep_gen_func()", "type": "assigned_variable", "loc": [68, 68], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L67_C12", "vector": [14, 4, 0.5812, 0.0085, 4, 0.96, 0.0, 665, 3, 1, 0, 0, 16, 10, 1], "semantic": {"name": "stop, ea", "arg_names": [], "import_names": [], "rhs_call_name": "ep_gen_func", "annotation": ""}, "snippet": " stop, ea = ep_gen_func(ep_gen)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L69_C12", "label": "if", "type": "if", "loc": [69, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:While_L51_C8", "vector": [4, 3, 0.5983, 0.0256, 3, 0.06, 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_99328:Assign_L70_C16", "label": "stop =", "type": "assigned_variable", "loc": [70, 70], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L69_C12", "vector": [14, 4, 0.5983, 0.0085, 4, 0.46, 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_99328:Assign_L71_C16", "label": "t_end = get_time()", "type": "assigned_variable", "loc": [71, 71], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L69_C12", "vector": [14, 4, 0.6068, 0.0085, 4, 0.46, 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_99328:If_L73_C12", "label": "if", "type": "if", "loc": [73, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:While_L51_C8", "vector": [4, 3, 0.6538, 0.0684, 3, 0.06, 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 ep_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_99328:If_L74_C16", "label": "if", "type": "if", "loc": [74, 78], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L73_C12", "vector": [4, 4, 0.6496, 0.0427, 4, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ep_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_99328:Assign_L75_C20", "label": "ep =", "type": "assigned_variable", "loc": [75, 75], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L74_C16", "vector": [14, 5, 0.641, 0.0085, 5, 0.03, 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_99328:Assign_L76_C20", "label": "ea = list()", "type": "assigned_variable", "loc": [76, 76], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L74_C16", "vector": [14, 5, 0.6496, 0.0085, 5, 0.03, 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_99328:Assign_L77_C20", "label": " = ep_clamp_func()", "type": "assigned_variable", "loc": [77, 77], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L74_C16", "vector": [14, 5, 0.6581, 0.0085, 5, 0.03, 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_99328:Assign_L78_C20", "label": "ea = tuple()", "type": "assigned_variable", "loc": [78, 78], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L74_C16", "vector": [14, 5, 0.6667, 0.0085, 5, 0.03, 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_99328:Expr_L80_C16", "label": "control_function()", "type": "expression", "loc": [80, 80], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L73_C12", "vector": [8, 4, 0.6838, 0.0085, 4, 0.37, 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_99328:Expr_L82_C12", "label": "sleep()", "type": "expression", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:While_L51_C8", "vector": [8, 3, 0.7009, 0.0085, 3, 0.06, 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_99328:Return_L84_C8", "label": "return", "type": "return", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L42_C4", "vector": [13, 2, 0.7179, 0.0085, 2, 0.63, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return stop, ea"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "label": "go_jep", "type": "function", "loc": [89, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:ClassDef_L21_C0", "vector": [2, 1, 0.8718, 0.2308, 1, 0.29, 1.0, 177, 0, 3, 1, 0, 0, 0, 13], "semantic": {"name": "go_jep", "arg_names": ["self", "goal_jep", "speed"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def go_jep(self, goal_jep, speed=math.radians(20)):\n start_jep = self.robot.get_ep()\n diff_jep = np.array(goal_jep) - np.array(start_jep)\n time_step = 0.02\n max_ch = np.max(np.abs(diff_jep))\n total_time = max_ch / speed\n n_steps = max(np.round(total_time / time_step + 0.5), 1)\n jep_step = diff_jep / n_steps"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L90_C8", "label": "start_jep = get_ep()", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "vector": [14, 2, 0.7692, 0.0085, 2, 0.48, 0.0, 423, 3, 0, 0, 0, 563, 10, 1], "semantic": {"name": "start_jep", "arg_names": [], "import_names": [], "rhs_call_name": "get_ep", "annotation": ""}, "snippet": " start_jep = self.robot.get_ep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L91_C8", "label": "diff_jep =", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "vector": [14, 2, 0.7778, 0.0085, 2, 0.48, 0.0909, 7, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "diff_jep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " diff_jep = np.array(goal_jep) - np.array(start_jep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L92_C8", "label": "time_step =", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "vector": [14, 2, 0.7863, 0.0085, 2, 0.48, 0.1818, 387, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "time_step", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_step = 0.02"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L93_C8", "label": "max_ch = max()", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "vector": [14, 2, 0.7949, 0.0085, 2, 0.48, 0.2727, 753, 3, 1, 0, 0, 442, 10, 2], "semantic": {"name": "max_ch", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_ch = np.max(np.abs(diff_jep))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L94_C8", "label": "total_time =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "vector": [14, 2, 0.8034, 0.0085, 2, 0.48, 0.3636, 875, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "total_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " total_time = max_ch / speed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L95_C8", "label": "n_steps = max()", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "vector": [14, 2, 0.812, 0.0085, 2, 0.48, 0.4545, 514, 3, 2, 0, 0, 442, 10, 2], "semantic": {"name": "n_steps", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " n_steps = max(np.round(total_time / time_step + 0.5), 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L96_C8", "label": "jep_step =", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "vector": [14, 2, 0.8205, 0.0085, 2, 0.48, 0.5455, 174, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jep_step", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jep_step = diff_jep / n_steps"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L98_C8", "label": "eq_gen_func", "type": "function", "loc": [98, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "vector": [2, 2, 0.8889, 0.1111, 2, 0.48, 0.6364, 429, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "eq_gen_func", "arg_names": ["ep_gen"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def eq_gen_func(ep_gen):\n jep = ep_gen.jep\n step_num = ep_gen.step_num\n if step_num < n_steps:\n q = list(np.array(jep) + jep_step)\n stop = ''\n else:\n q = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L99_C12", "label": "jep =", "type": "assigned_variable", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L98_C8", "vector": [14, 3, 0.8462, 0.0085, 3, 0.04, 0.0, 838, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jep = ep_gen.jep"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L100_C12", "label": "step_num =", "type": "assigned_variable", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L98_C8", "vector": [14, 3, 0.8547, 0.0085, 3, 0.04, 0.2, 474, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "step_num", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " step_num = ep_gen.step_num"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L101_C12", "label": "if", "type": "if", "loc": [101, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L98_C8", "vector": [4, 3, 0.8846, 0.0513, 3, 0.04, 0.4, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if step_num < n_steps:\n q = list(np.array(jep) + jep_step)\n stop = ''\n else:\n q = None\n stop = 'Reached'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L102_C16", "label": "q = list()", "type": "assigned_variable", "loc": [102, 102], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L101_C12", "vector": [14, 4, 0.8718, 0.0085, 4, 0.96, 0.0, 516, 3, 1, 0, 0, 430, 10, 2], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " q = list(np.array(jep) + jep_step)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L103_C16", "label": "stop =", "type": "assigned_variable", "loc": [103, 103], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L101_C12", "vector": [14, 4, 0.8803, 0.0085, 4, 0.96, 0.3333, 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_99328:Assign_L105_C16", "label": "q =", "type": "assigned_variable", "loc": [105, 105], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L101_C12", "vector": [14, 4, 0.8974, 0.0085, 4, 0.96, 0.6667, 516, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L106_C16", "label": "stop =", "type": "assigned_variable", "loc": [106, 106], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L101_C12", "vector": [14, 4, 0.906, 0.0085, 4, 0.96, 1.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'Reached'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L108_C12", "label": "ep_gen.jep =", "type": "assigned_variable", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L98_C8", "vector": [14, 3, 0.9231, 0.0085, 3, 0.04, 0.6, 958, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ep_gen.jep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ep_gen.jep = q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L109_C12", "label": "ep_gen.step_num =", "type": "assigned_variable", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L98_C8", "vector": [14, 3, 0.9316, 0.0085, 3, 0.04, 0.8, 723, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ep_gen.step_num", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ep_gen.step_num = step_num"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Return_L110_C12", "label": "return", "type": "return", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L98_C8", "vector": [13, 3, 0.9402, 0.0085, 3, 0.04, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return stop, (q, time_step*1.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L112_C8", "label": "ep_gen = EP_Generator()", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "vector": [14, 2, 0.9573, 0.0085, 2, 0.48, 0.7273, 167, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "ep_gen", "arg_names": [], "import_names": [], "rhs_call_name": "EP_Generator", "annotation": ""}, "snippet": " ep_gen = EP_Generator(eq_gen_func, self.robot.set_ep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L113_C8", "label": "ep_gen.step_num =", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "vector": [14, 2, 0.9658, 0.0085, 2, 0.48, 0.8182, 723, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "ep_gen.step_num", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ep_gen.step_num = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L114_C8", "label": "ep_gen.jep = copy()", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "vector": [14, 2, 0.9744, 0.0085, 2, 0.48, 0.9091, 958, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "ep_gen.jep", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " ep_gen.jep = copy.copy(start_jep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99328:Return_L115_C8", "label": "return", "type": "return", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "vector": [13, 2, 0.9829, 0.0085, 2, 0.48, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.epc_motion(ep_gen, time_step)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99328:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:While_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:While_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L52_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L53_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:While_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L56_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L57_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:While_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L60_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Expr_L61_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:While_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L65_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L66_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:While_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L67_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L68_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:While_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L69_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L70_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L69_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L71_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:While_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L73_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L74_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L74_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L75_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L74_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L76_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L74_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L77_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L74_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L78_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L73_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Expr_L80_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:While_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Expr_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Return_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L101_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L102_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L101_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L103_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L101_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L105_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:If_L101_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L106_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Return_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99328:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99328:Return_L115_C8"}]
import numpy as np, math import copy import roslib; roslib.load_manifest('equilibrium_point_control') import rospy from std_msgs.msg import Bool ## # Abstract class to be implemented when using equilibrium point control. # If generate_ep produces equilibrium points which are used by control_ep # to move the arm, this object can be passed into EPC.epc_motion to control # the arm. Equilibrium points can be of any type so long as generate_ep, # control_ep, and clamp_ep are all written with this type in mind. class EPGenerator(object): #----------------- abstract functions --------------------- ## # Generates a new equilibrium point. # @return (stop, ep) # stop: EPStopConditions.CONTINUE or non-empty string to terminate # ep: equilibrium point to be sent to control_function def generate_ep(self): raise RuntimeError('Unimplemented Function') ## # Commands the arm to move towards the specified equilibrium point. # @param ep equilibrium point to command the arm towards def control_ep(self, ep): raise RuntimeError('Unimplemented Function') ## # Takes an equilibrium point and clamps it to reasonable control values. # To be overwritten if needed by the child class. # @param ep equilibrium point to clamp # @return clamped equilibrium point def clamp_ep(self, ep): return ep ## # Termination check for collision or goal reaching. # To be overwritten if needed by the child class. # @return EPStopConditions.CONTINUE or non-empty string to terminate def terminate_check(self): return EPStopConditions.CONTINUE #---------------------------------------------------------- ## # Enumerated constants for EPC termination conditions class EPStopConditions: CONTINUE = '' ROSPY_SHUTDOWN = 'rospy shutdown' ROS_STOP = 'stop_command_over_ROS' TIMEOUT = 'timed out' RESET_TIMING = 'reset timing' SUCCESSFUL = 'epc motion successful' COLLISION = 'collision detected' ## # Simple class containing the core EPC function: a control loop paradigm. class EPC(object): ## # Initializes variables and subscribers def __init__(self, epc_name = 'epc'): self.epc_name = epc_name 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) ## # Subscriber callback for stopping the arm's motion def _stop_cb(self, msg): self.stop_epc = msg.data self.pause_epc = False # stop/start overrides pause. ## # Subscriber callback for pausing the arm's motion def _pause_cb(self, msg): self.pause_epc = msg.data ## # Control loop for equilibrium point control. For each time step, ep_gen # provides 4 functions, a termination check, an ep generation step, # a clamping step, and an ep control step. These functions are called in this # order along with helper functionality for stopping and pausing control. # @param ep_gen - Object of type EPGenerator. # @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, time_step, timeout=np.inf): rospy.loginfo("[epc] epc_motion started") timeout_at = rospy.get_time() + timeout stop = EPStopConditions.CONTINUE ea = None while True: # basic rospy shutdown termination if rospy.is_shutdown(): stop = EPStopConditions.ROSPY_SHUTDOWN break # check to see if we should stop (stop_epc changed from another thread) if self.stop_epc: stop = EPStopConditions.ROS_STOP break # check to see if the generator thinks we should stop stop = ep_gen.terminate_check() if stop != EPStopConditions.CONTINUE: break # check to see if we're paused if self.pause_epc: rospy.sleep(0.1) timeout_at += 0.101 # approximate. continue # timeout check if timeout_at < rospy.get_time(): stop = EPStopConditions.TIMEOUT break # create a new ep stop, ep = ep_gen.generate_ep() if stop != EPStopConditions.CONTINUE: break # if a post-processing function exits, use it to process the ep ep = ep_gen.clamp_ep(ep) # command the arm to move to the ep ep_gen.control_ep(ep) rospy.sleep(time_step) rospy.loginfo("[epc] epc_motion stopped with termination condition: %s" % stop) return stop, ea
ajibawa-2023/Python-Code-Large/train/row_99330
56
139
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Import_L2_C0", "label": "numpy import np, math", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0144, 0.0072, 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_99330:Import_L3_C0", "label": "copy import copy", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0216, 0.0072, 0, 0.66, 0.125, 739, 0, 1, 0, 0, 739, 0, 0], "semantic": {"name": "copy", "arg_names": [], "import_names": ["copy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Import_L4_C0", "label": "roslib import roslib", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0288, 0.0072, 0, 0.66, 0.25, 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('equilibrium_point_control')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Expr_L4_C15", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0288, 0.0072, 0, 0.66, 0.375, 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('equilibrium_point_control')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.036, 0.0072, 0, 0.66, 0.5, 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_99330:ImportFrom_L6_C0", "label": "from std_msgs.msg import Bool", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0432, 0.0072, 0, 0.66, 0.625, 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_99330:ClassDef_L14_C0", "label": "EPGenerator", "type": "class", "loc": [14, 43], "level": 0, "parent": null, "vector": [3, 0, 0.205, 0.2158, 0, 0.66, 0.75, 49, 0, 4, 0, 0, 186, 0, 2], "semantic": {"name": "EPGenerator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class EPGenerator(object):\n #----------------- abstract functions ---------------------\n ##\n # Generates a new equilibrium point.\n # @return (stop, ep)\n # stop: EPStopConditions.CONTINUE or non-empty string to terminate\n # ep: equilibrium point to be sent to control_function\n def generate_ep(self):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L21_C4", "label": "generate_ep", "type": "function", "loc": [21, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L14_C0", "vector": [2, 1, 0.1547, 0.0144, 1, 0.26, 0.0, 218, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "generate_ep", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def generate_ep(self):\n raise RuntimeError('Unimplemented Function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L27_C4", "label": "control_ep", "type": "function", "loc": [27, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L14_C0", "vector": [2, 1, 0.1978, 0.0144, 1, 0.26, 0.3333, 752, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "control_ep", "arg_names": ["self", "ep"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def control_ep(self, ep):\n raise RuntimeError('Unimplemented Function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L35_C4", "label": "clamp_ep", "type": "function", "loc": [35, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L14_C0", "vector": [2, 1, 0.2554, 0.0144, 1, 0.26, 0.6667, 692, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "clamp_ep", "arg_names": ["self", "ep"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def clamp_ep(self, ep):\n return ep"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Return_L36_C8", "label": "return", "type": "return", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L35_C4", "vector": [13, 2, 0.259, 0.0072, 2, 0.74, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ep"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L42_C4", "label": "terminate_check", "type": "function", "loc": [42, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L14_C0", "vector": [2, 1, 0.3058, 0.0144, 1, 0.26, 1.0, 980, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "terminate_check", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def terminate_check(self):\n return EPStopConditions.CONTINUE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Return_L43_C8", "label": "return", "type": "return", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L42_C4", "vector": [13, 2, 0.3094, 0.0072, 2, 0.81, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return EPStopConditions.CONTINUE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L48_C0", "label": "EPStopConditions", "type": "class", "loc": [48, 55], "level": 0, "parent": null, "vector": [3, 0, 0.3705, 0.0576, 0, 0.66, 0.875, 847, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "EPStopConditions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class EPStopConditions:\n CONTINUE = ''\n ROSPY_SHUTDOWN = 'rospy shutdown'\n ROS_STOP = 'stop_command_over_ROS'\n TIMEOUT = 'timed out'\n RESET_TIMING = 'reset timing'\n SUCCESSFUL = 'epc motion successful'\n COLLISION = 'collision detected'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L49_C4", "label": "CONTINUE =", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L48_C0", "vector": [14, 1, 0.3525, 0.0072, 1, 0.56, 0.0, 650, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "CONTINUE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " CONTINUE = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L50_C4", "label": "ROSPY_SHUTDOWN =", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L48_C0", "vector": [14, 1, 0.3597, 0.0072, 1, 0.56, 0.1667, 144, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROSPY_SHUTDOWN", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROSPY_SHUTDOWN = 'rospy shutdown'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L51_C4", "label": "ROS_STOP =", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L48_C0", "vector": [14, 1, 0.3669, 0.0072, 1, 0.56, 0.3333, 93, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROS_STOP", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROS_STOP = 'stop_command_over_ROS'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L52_C4", "label": "TIMEOUT =", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L48_C0", "vector": [14, 1, 0.3741, 0.0072, 1, 0.56, 0.5, 824, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIMEOUT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " TIMEOUT = 'timed out'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L53_C4", "label": "RESET_TIMING =", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L48_C0", "vector": [14, 1, 0.3813, 0.0072, 1, 0.56, 0.6667, 290, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "RESET_TIMING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " RESET_TIMING = 'reset timing'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L54_C4", "label": "SUCCESSFUL =", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L48_C0", "vector": [14, 1, 0.3885, 0.0072, 1, 0.56, 0.8333, 887, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SUCCESSFUL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " SUCCESSFUL = 'epc motion successful'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L55_C4", "label": "COLLISION =", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L48_C0", "vector": [14, 1, 0.3957, 0.0072, 1, 0.56, 1.0, 31, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "COLLISION", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " COLLISION = 'collision detected'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L59_C0", "label": "EPC", "type": "class", "loc": [59, 137], "level": 0, "parent": null, "vector": [3, 0, 0.705, 0.5683, 0, 0.66, 1.0, 417, 0, 4, 0, 0, 186, 0, 13], "semantic": {"name": "EPC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class EPC(object):\n\n ##\n # Initializes variables and subscribers\n def __init__(self, epc_name = 'epc'):\n self.epc_name = epc_name\n self.stop_epc = False\n self.pause_epc = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L63_C4", "label": "__init__", "type": "function", "loc": [63, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L59_C0", "vector": [2, 1, 0.4712, 0.0432, 1, 0.36, 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.epc_name = epc_name\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_99330:Assign_L64_C8", "label": "self.epc_name =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L63_C4", "vector": [14, 2, 0.4604, 0.0072, 2, 0.77, 0.0, 24, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.epc_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.epc_name = epc_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L65_C8", "label": "self.stop_epc =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L63_C4", "vector": [14, 2, 0.4676, 0.0072, 2, 0.77, 0.25, 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_99330:Assign_L66_C8", "label": "self.pause_epc =", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L63_C4", "vector": [14, 2, 0.4748, 0.0072, 2, 0.77, 0.5, 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_99330:Expr_L67_C8", "label": "Subscriber()", "type": "expression", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L63_C4", "vector": [8, 2, 0.482, 0.0072, 2, 0.77, 0.75, 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_99330:Expr_L68_C8", "label": "Subscriber()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L63_C4", "vector": [8, 2, 0.4892, 0.0072, 2, 0.77, 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_99330:FunctionDef_L72_C4", "label": "_stop_cb", "type": "function", "loc": [72, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L59_C0", "vector": [2, 1, 0.5252, 0.0216, 1, 0.36, 0.3333, 390, 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_99330:Assign_L73_C8", "label": "self.stop_epc =", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L72_C4", "vector": [14, 2, 0.5252, 0.0072, 2, 0.56, 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_99330:Assign_L74_C8", "label": "self.pause_epc =", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L72_C4", "vector": [14, 2, 0.5324, 0.0072, 2, 0.56, 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_99330:FunctionDef_L78_C4", "label": "_pause_cb", "type": "function", "loc": [78, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L59_C0", "vector": [2, 1, 0.5647, 0.0144, 1, 0.36, 0.6667, 432, 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_99330:Assign_L79_C8", "label": "self.pause_epc =", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L78_C4", "vector": [14, 2, 0.5683, 0.0072, 2, 0.27, 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_99330:FunctionDef_L91_C4", "label": "epc_motion", "type": "function", "loc": [91, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L59_C0", "vector": [2, 1, 0.8201, 0.3381, 1, 0.36, 1.0, 938, 0, 4, 1, 0, 0, 0, 11], "semantic": {"name": "epc_motion", "arg_names": ["self", "ep_gen", "time_step", "timeout"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def epc_motion(self, ep_gen, time_step, timeout=np.inf):\n rospy.loginfo(\"[epc] epc_motion started\")\n timeout_at = rospy.get_time() + timeout\n stop = EPStopConditions.CONTINUE\n ea = None\n while True:\n # basic rospy shutdown termination\n if rospy.is_shutdown():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Expr_L92_C8", "label": "loginfo()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L91_C4", "vector": [8, 2, 0.6619, 0.0072, 2, 0.52, 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(\"[epc] epc_motion started\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L93_C8", "label": "timeout_at =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L91_C4", "vector": [14, 2, 0.6691, 0.0072, 2, 0.52, 0.1667, 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_99330:Assign_L94_C8", "label": "stop =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L91_C4", "vector": [14, 2, 0.6763, 0.0072, 2, 0.52, 0.3333, 343, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = EPStopConditions.CONTINUE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L95_C8", "label": "ea =", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L91_C4", "vector": [14, 2, 0.6835, 0.0072, 2, 0.52, 0.5, 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_99330:While_L96_C8", "label": "while", "type": "while", "loc": [96, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L91_C4", "vector": [5, 2, 0.8273, 0.2806, 2, 0.52, 0.6667, 0, 1, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while True:\n # basic rospy shutdown termination\n if rospy.is_shutdown():\n stop = EPStopConditions.ROSPY_SHUTDOWN\n break\n\n # check to see if we should stop (stop_epc changed from another thread)\n if self.stop_epc:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:If_L98_C12", "label": "if", "type": "if", "loc": [98, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:While_L96_C8", "vector": [4, 3, 0.7122, 0.0216, 3, 0.88, 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 = EPStopConditions.ROSPY_SHUTDOWN\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L99_C16", "label": "stop =", "type": "assigned_variable", "loc": [99, 99], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:If_L98_C12", "vector": [14, 4, 0.7122, 0.0072, 4, 0.75, 0.0, 343, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = EPStopConditions.ROSPY_SHUTDOWN"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:If_L103_C12", "label": "if", "type": "if", "loc": [103, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:While_L96_C8", "vector": [4, 3, 0.7482, 0.0216, 3, 0.88, 0.1, 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 = EPStopConditions.ROS_STOP\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L104_C16", "label": "stop =", "type": "assigned_variable", "loc": [104, 104], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:If_L103_C12", "vector": [14, 4, 0.7482, 0.0072, 4, 0.37, 0.0, 343, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = EPStopConditions.ROS_STOP"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L108_C12", "label": "stop = terminate_check()", "type": "assigned_variable", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:While_L96_C8", "vector": [14, 3, 0.777, 0.0072, 3, 0.88, 0.2, 343, 3, 0, 0, 0, 980, 10, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "terminate_check", "annotation": ""}, "snippet": " stop = ep_gen.terminate_check()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:If_L109_C12", "label": "if", "type": "if", "loc": [109, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:While_L96_C8", "vector": [4, 3, 0.7878, 0.0144, 3, 0.88, 0.3, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stop != EPStopConditions.CONTINUE:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:If_L113_C12", "label": "if", "type": "if", "loc": [113, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:While_L96_C8", "vector": [4, 3, 0.8237, 0.0288, 3, 0.88, 0.4, 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_99330:Expr_L114_C16", "label": "sleep()", "type": "expression", "loc": [114, 114], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:If_L113_C12", "vector": [8, 4, 0.8201, 0.0072, 4, 0.05, 0.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:If_L119_C12", "label": "if", "type": "if", "loc": [119, 121], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:While_L96_C8", "vector": [4, 3, 0.8633, 0.0216, 3, 0.88, 0.5, 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 = EPStopConditions.TIMEOUT\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L120_C16", "label": "stop =", "type": "assigned_variable", "loc": [120, 120], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:If_L119_C12", "vector": [14, 4, 0.8633, 0.0072, 4, 0.12, 0.0, 343, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = EPStopConditions.TIMEOUT"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L124_C12", "label": "stop, ep = generate_ep()", "type": "assigned_variable", "loc": [124, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:While_L96_C8", "vector": [14, 3, 0.8921, 0.0072, 3, 0.88, 0.6, 803, 3, 0, 0, 0, 218, 10, 1], "semantic": {"name": "stop, ep", "arg_names": [], "import_names": [], "rhs_call_name": "generate_ep", "annotation": ""}, "snippet": " stop, ep = ep_gen.generate_ep() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:If_L125_C12", "label": "if", "type": "if", "loc": [125, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:While_L96_C8", "vector": [4, 3, 0.9029, 0.0144, 3, 0.88, 0.7, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stop != EPStopConditions.CONTINUE:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L129_C12", "label": "ep = clamp_ep()", "type": "assigned_variable", "loc": [129, 129], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:While_L96_C8", "vector": [14, 3, 0.9281, 0.0072, 3, 0.88, 0.8, 787, 3, 1, 0, 0, 692, 10, 1], "semantic": {"name": "ep", "arg_names": [], "import_names": [], "rhs_call_name": "clamp_ep", "annotation": ""}, "snippet": " ep = ep_gen.clamp_ep(ep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Expr_L132_C12", "label": "control_ep()", "type": "expression", "loc": [132, 132], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:While_L96_C8", "vector": [8, 3, 0.9496, 0.0072, 3, 0.88, 0.9, 752, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "control_ep", "arg_names": [], "import_names": [], "rhs_call_name": "control_ep", "annotation": ""}, "snippet": " ep_gen.control_ep(ep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Expr_L134_C12", "label": "sleep()", "type": "expression", "loc": [134, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:While_L96_C8", "vector": [8, 3, 0.964, 0.0072, 3, 0.88, 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(time_step)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Expr_L136_C8", "label": "loginfo()", "type": "expression", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L91_C4", "vector": [8, 2, 0.9784, 0.0072, 2, 0.52, 0.8333, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"[epc] epc_motion stopped with termination condition: %s\" % stop)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99330:Return_L137_C8", "label": "return", "type": "return", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L91_C4", "vector": [13, 2, 0.9856, 0.0072, 2, 0.52, 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_99330:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Return_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Return_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Expr_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:ClassDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:While_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:While_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:If_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:If_L98_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L99_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:While_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:If_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:If_L103_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L104_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:While_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:While_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:If_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:While_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:If_L113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:If_L113_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Expr_L114_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:While_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:If_L119_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:If_L119_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L120_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:While_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L124_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:While_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:If_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:While_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Assign_L129_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:While_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Expr_L132_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:While_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Expr_L134_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Expr_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99330:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99330:Return_L137_C8"}]
#!/usr/bin/python import roslib roslib.load_manifest('room_explore') import rospy from geometry_msgs.msg import PoseWithCovarianceStamped # header: # seq: 7 # stamp: # secs: 0 # nsecs: 0 # frame_id: /map # pose: # pose: # position: # x: -0.324687451124 # y: 0.183924600482 # z: 0.0 # orientation: # x: 0.0 # y: 0.0 # z: -0.054315002133 # w: 0.998523850763 # covariance: [0.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.06853891945200942, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] if __name__ == '__main__': rospy.init_node( 'pose_setter' ) pub = rospy.Publisher( '/initialpose', PoseWithCovarianceStamped ) rospy.sleep( 1.0 ) ps = PoseWithCovarianceStamped() ps.header.stamp = rospy.Time(0) ps.header.frame_id = '/base_link' ps.pose.pose.orientation.w = 1.0 ps.pose.covariance = [0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.005, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] print ps pub.publish( ps )
ajibawa-2023/Python-Code-Large/train/row_99332
15
49
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99332:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0612, 0.0204, 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_99332:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0816, 0.0204, 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('room_explore')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99332:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.102, 0.0204, 0, 0.66, 0.5, 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_99332:ImportFrom_L7_C0", "label": "from geometry_msgs.msg import PoseWithCovarianceStamped", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0204, 0, 0.66, 0.75, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["PoseWithCovarianceStamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import PoseWithCovarianceStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99332:If_L28_C0", "label": "if", "type": "if", "loc": [28, 46], "level": 0, "parent": null, "vector": [4, 0, 0.7551, 0.3878, 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 rospy.init_node( 'pose_setter' )\n\n pub = rospy.Publisher( '/initialpose', PoseWithCovarianceStamped )\n rospy.sleep( 1.0 )\n\n ps = PoseWithCovarianceStamped()\n ps.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99332:Expr_L29_C4", "label": "init_node()", "type": "expression", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99332:If_L28_C0", "vector": [8, 1, 0.5918, 0.0204, 1, 0.13, 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( 'pose_setter' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99332:Assign_L31_C4", "label": "pub = Publisher()", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99332:If_L28_C0", "vector": [14, 1, 0.6327, 0.0204, 1, 0.13, 0.1111, 41, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " pub = rospy.Publisher( '/initialpose', PoseWithCovarianceStamped )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99332:Expr_L32_C4", "label": "sleep()", "type": "expression", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99332:If_L28_C0", "vector": [8, 1, 0.6531, 0.0204, 1, 0.13, 0.2222, 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_99332:Assign_L34_C4", "label": "ps = PoseWithCovarianceStamped()", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99332:If_L28_C0", "vector": [14, 1, 0.6939, 0.0204, 1, 0.13, 0.3333, 232, 3, 0, 0, 0, 146, 10, 1], "semantic": {"name": "ps", "arg_names": [], "import_names": [], "rhs_call_name": "PoseWithCovarianceStamped", "annotation": ""}, "snippet": " ps = PoseWithCovarianceStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99332:Assign_L35_C4", "label": "ps.header.stamp = Time()", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99332:If_L28_C0", "vector": [14, 1, 0.7143, 0.0204, 1, 0.13, 0.4444, 161, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " ps.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99332:Assign_L36_C4", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99332:If_L28_C0", "vector": [14, 1, 0.7347, 0.0204, 1, 0.13, 0.5556, 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_99332:Assign_L37_C4", "label": "ps.pose.pose.orientation.w =", "type": "assigned_variable", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99332:If_L28_C0", "vector": [14, 1, 0.7551, 0.0204, 1, 0.13, 0.6667, 578, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "ps.pose.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.pose.orientation.w = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99332:Assign_L38_C4", "label": "ps.pose.covariance =", "type": "assigned_variable", "loc": [38, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99332:If_L28_C0", "vector": [14, 1, 0.8367, 0.1429, 1, 0.13, 0.7778, 251, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ps.pose.covariance", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.covariance = [0.01, 0.0, 0.0, 0.0, 0.0,\n 0.0, 0.0, 0.01, 0.0, 0.0,\n 0.0, 0.0, 0.0, 0.0, 0.0,\n 0.0, 0.0, 0.0, 0.0, 0.0,\n 0.0, 0.005, 0.0, 0.0, 0.0, 0.0, 0.0,\n 0.0, 0.0, 0.0, 0.0, 0.0,\n 0.0, 0.0, 0.0, 0.0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99332:Expr_L45_C4", "label": "print()", "type": "expression", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99332:If_L28_C0", "vector": [8, 1, 0.9184, 0.0204, 1, 0.13, 0.8889, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(ps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99332:Expr_L46_C4", "label": "publish()", "type": "expression", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99332:If_L28_C0", "vector": [8, 1, 0.9388, 0.0204, 1, 0.13, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " pub.publish( ps )"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99332:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99332:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99332:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99332:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99332:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99332:Expr_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99332:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99332:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99332:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99332:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99332:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99332:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99332:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99332:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99332:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99332:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99332:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99332:Expr_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99332:If_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99332:Expr_L46_C4"}]
__all__ = [ 'room_explore' ]
ajibawa-2023/Python-Code-Large/train/row_99333
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_99333: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 'room_explore'\n ]"}]
[]
#!/usr/bin/python import roslib roslib.load_manifest('room_explore') import rospy import tf from threading import Thread import actionlib from move_base_msgs.msg import MoveBaseGoal, MoveBaseAction from visualization_msgs.msg import MarkerArray from visualization_msgs.msg import Marker from geometry_msgs.msg import Vector3, PoseStamped, Quaternion from std_msgs.msg import ColorRGBA from explore_hrl.msg import ExploreAction, ExploreResult, ExploreGoal import yaml import numpy as np, math room = '/home/travis/svn/gt-ros-pkg/hrl/room_explore/rooms/rooms.yaml' def retfalse(): return False class TFthread( Thread ): def __init__( self, df ): Thread.__init__( self ) try: rospy.init_node( 'TFthread' ) except: pass # parent probably already initialized node. self.df = df # yaml dictionary of rooms self.bc = tf.TransformBroadcaster() self.should_run = True self.start() def publish_transform( self ): for room in self.df.keys(): self.bc.sendTransform( ( self.df[room]['position']['x'], self.df[room]['position']['y'], self.df[room]['position']['z'] ), ( self.df[room]['orientation']['x'], self.df[room]['orientation']['y'], self.df[room]['orientation']['z'], self.df[room]['orientation']['w'] ), rospy.Time.now(), room, 'map' ) def run( self ): rospy.logout( 'TFthread: Starting ' ) r = rospy.Rate( 10 ) while self.should_run and not rospy.is_shutdown(): self.publish_transform() try: r.sleep() except: pass # ROS exception. rospy.logout( 'TFthread: Starting ') def stop( self ): # Kill off the poller thread. self.should_run = False self.join(5) if (self.isAlive()): raise RuntimeError('TFthread: Unable to stop thread ' ) # if __name__ == '__main__': # f = open( room ) # dat = yaml.load( f ) # f.close() # TFthread( dat ) # rospy.spin() def standard_rad(t): if t > 0: return ((t + np.pi) % (np.pi * 2)) - np.pi else: return ((t - np.pi) % (np.pi * -2)) + np.pi class RoomExplore( Thread ): def __init__( self, df, room, start_rad = 1.5 ): Thread.__init__( self ) try: rospy.init_node( 'RoomExplore' ) except: pass self.should_run = True self.frame = '/' + room self.height = df[room]['height'] self.width = df[room]['width'] self.listener = tf.TransformListener() self.listener.waitForTransform( '/base_link', '/map', rospy.Time(0), timeout = rospy.Duration(100)) self.setup_poses( radius = start_rad ) # also initializes radius self.pub = rospy.Publisher( 'visarr', Marker ) self._as = actionlib.SimpleActionServer( '/explore', ExploreAction, execute_cb = self.action_request ) self._as.start() rospy.logout('Action should be started.') self.start() def action_request( self, goal ): rospy.logout( 'room_explore: action_request received for radius: \'%2.2f\'' % goal.radius ) def preempt_func(): # self._as should be in scope and bound @ function def. (I think for python...) check = self._as.is_preempt_requested() if check: rospy.logout( 'room_explore: action_request preempted!' ) return check rv = self.begin_explore( goal.radius, preempt_func = preempt_func ) rospy.logout( 'room_explore: action_request received result %d' % int(rv) ) if rv == True: self._as.set_succeeded( ExploreResult() ) def begin_explore( self, radius, preempt_func = retfalse ): client = actionlib.SimpleActionClient( 'move_base', MoveBaseAction ) rospy.logout( 'Waiting for move_base server' ) client.wait_for_server() rospy.logout( 'room_explore: setting radius' ) all_goals = self.setup_poses( radius ) for goal in all_goals: #print 'room_explore: sending goal ', goal goal.target_pose.header.stamp = rospy.Time.now() client.send_goal( goal ) time_last_moving = rospy.Time.now() goal_time = rospy.Time.now() new_pose = self.current_robot_position() ref_pose = self.current_robot_position() r = rospy.Rate( 5 ) while not rospy.is_shutdown(): state = client.get_state() states = { 0: 'WAITING FOR GOAL ACK', 1: 'PENDING', 2: 'ACTIVE', 3: 'WAITING FOR RESULT', 4: 'WAITING FOR CANCEL ACK', 5: 'RECALLING', 6: 'PREEMPTING', 7: 'DONE' } #print 'State: ', state, ' ', states[state] #print 'Result: ', client.get_result() #rospy.logout( 'room_explore: loop' ) if state == 7 or state == 3: rospy.logout( 'room_explore: client no longer active' ) print 'State: ', state, ' ', states[state] time_last_moving = rospy.Time.now() break if preempt_func(): rospy.logout( 'room_explore: preempted at a higher level.' ) time_last_moving = rospy.Time.now() break new_pose = self.current_robot_position() dx = new_pose[0] - ref_pose[0] dy = new_pose[1] - ref_pose[1] da = new_pose[-1] - ref_pose[-1] # yaw if dx*dx + dy*dy > 0.02 or da*da > math.radians( 5 ): time_last_moving = rospy.Time.now() ref_pose = self.current_robot_position() rospy.logout('WE ARE MOVING') if rospy.Time.now() - time_last_moving > rospy.Duration( 8 ): rospy.logout( 'We do not appear to have moved. Aborting current goal.' ) client.cancel_all_goals() # Should force a break on GoalState time_last_moving = rospy.Time.now() break if rospy.Time.now() - goal_time > rospy.Duration( 30 ): rospy.logout( 'Goal not achieved after 30 seconds. Aborting.' ) client.cancel_all_goals() # Should force a break on GoalState time_last_moving = rospy.Time.now() break r.sleep() client.cancel_all_goals() # Just in case if preempt_func(): # immediately exit if overall action preempted break return True def current_robot_position( self ): ps = PoseStamped() ps.header.stamp = rospy.Time(0) ps.header.frame_id = '/base_link' ps.pose.orientation.w = 1.0 try: ps_map = self.listener.transformPose( '/map', ps ) except: rospy.logout( 'room_explore: Transform failed' ) ps_map = PoseStamped() ps_map.header.stamp = rospy.Time.now() ps_map.header.frame_id = '/map' ps_map.pose.orientation = new_quat roll, pitch, yaw = tf.transformations.euler_from_quaternion(( ps_map.pose.orientation.x, ps_map.pose.orientation.y, ps_map.pose.orientation.z, ps_map.pose.orientation.w )) rv = [ ps_map.pose.position.x, ps_map.pose.position.y, ps_map.pose.position.z, roll, pitch, yaw ] #print 'RV: ', rv return rv def setup_poses( self, radius ): self.radius = radius xdir = np.arange( self.radius / 2.0, self.height + self.radius / 2.0, self.radius ) ydir = np.arange( self.radius / 2.0, self.width + self.radius / 2.0, self.radius ) move_dir = 0.0 self.poses = [] mod = 0 for y in ydir: if mod == 0: xord = xdir else: xord = xdir[::-1] for x in xord: goal = MoveBaseGoal() goal.target_pose.header.frame_id = self.frame goal.target_pose.header.stamp = rospy.Time.now() goal.target_pose.pose.position.x = x goal.target_pose.pose.position.y = y quat = tf.transformations.quaternion_from_euler( 0.0, 0.0, move_dir ) goal.target_pose.pose.orientation.x = quat[0] goal.target_pose.pose.orientation.y = quat[1] goal.target_pose.pose.orientation.z = quat[2] goal.target_pose.pose.orientation.w = quat[3] self.poses.append( goal ) move_dir = standard_rad( move_dir + np.pi ) mod = ( mod + 1 ) % 2 return self.poses def run( self ): rospy.logout( 'RoomExplore: Starting ' ) r = rospy.Rate( 2 ) while self.should_run and not rospy.is_shutdown(): self.publish_markers() try: r.sleep() except: pass # ROS exception. rospy.logout( 'RoomExplore: Starting ' ) def stop( self ): # Kill off the poller thread. self.should_run = False self.join(5) if (self.isAlive()): raise RuntimeError('RoomExplore: Unable to stop thread ' ) def publish_markers( self ): for i,g in enumerate(self.poses): m = Marker() m.ns = 'sample_positions' m.id = i m.action = m.ADD m.type = m.ARROW m.header.frame_id = self.frame m.header.stamp = rospy.Time.now() m.scale = Vector3( 0.15, 1.0, 1.0 ) m.color = ColorRGBA( 0.2, 1.0, 0.2, 0.7 ) m.pose = g.target_pose.pose self.pub.publish( m ) def goals( self ): return self.poses #self.explore_act = actionlib.SimpleActionClient('explore', explore_hrl.msg.ExploreAction) if __name__ == '__main__': f = open( room ) dat = yaml.load( f ) f.close() TFthread( dat ) re = RoomExplore( dat, 'hrl', 0.8 ) #re.begin_explore( 0.8 ) # rosservice call /explore 0.8 # explore_act = actionlib.SimpleActionClient('explore', ExploreAction) # rospy.logout( 'Waiting for explore.' ) # explore_act.wait_for_server() # rospy.logout( 'Done waiting.' ) # goal = ExploreGoal( radius = 0.8 ) # explore_act.send_goal(goal) # rospy.sleep( 0.5 ) # explore_act.wait_for_result() rospy.spin()
ajibawa-2023/Python-Code-Large/train/row_99334
192
335
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.009, 0.003, 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_99334:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0119, 0.003, 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": "roslib.load_manifest('room_explore')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0149, 0.003, 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_99334:Import_L7_C0", "label": "tf import tf", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0209, 0.003, 0, 0.66, 0.1579, 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_99334:ImportFrom_L8_C0", "label": "from threading import Thread", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0239, 0.003, 0, 0.66, 0.2105, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["Thread"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import Thread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Import_L9_C0", "label": "actionlib import actionlib", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0269, 0.003, 0, 0.66, 0.2632, 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_99334:ImportFrom_L11_C0", "label": "from move_base_msgs.msg import MoveBaseGoal, MoveBaseAction", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0328, 0.003, 0, 0.66, 0.3158, 440, 0, 2, 0, 0, 440, 0, 0], "semantic": {"name": "move_base_msgs.msg", "arg_names": [], "import_names": ["MoveBaseGoal", "MoveBaseAction"], "rhs_call_name": "", "annotation": ""}, "snippet": "from move_base_msgs.msg import MoveBaseGoal, MoveBaseAction"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:ImportFrom_L12_C0", "label": "from visualization_msgs.msg import MarkerArray", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0358, 0.003, 0, 0.66, 0.3684, 124, 0, 1, 0, 0, 124, 0, 0], "semantic": {"name": "visualization_msgs.msg", "arg_names": [], "import_names": ["MarkerArray"], "rhs_call_name": "", "annotation": ""}, "snippet": "from visualization_msgs.msg import MarkerArray"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:ImportFrom_L13_C0", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0388, 0.003, 0, 0.66, 0.4211, 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_99334:ImportFrom_L14_C0", "label": "from geometry_msgs.msg import Vector3, PoseStamped, Quaternion", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0418, 0.003, 0, 0.66, 0.4737, 951, 0, 3, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Vector3", "PoseStamped", "Quaternion"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Vector3, PoseStamped, Quaternion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:ImportFrom_L15_C0", "label": "from std_msgs.msg import ColorRGBA", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0448, 0.003, 0, 0.66, 0.5263, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["ColorRGBA"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import ColorRGBA"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:ImportFrom_L17_C0", "label": "from explore_hrl.msg import ExploreAction, ExploreResult, ExploreGoal", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0507, 0.003, 0, 0.66, 0.5789, 232, 0, 3, 0, 0, 232, 0, 0], "semantic": {"name": "explore_hrl.msg", "arg_names": [], "import_names": ["ExploreAction", "ExploreResult", "ExploreGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from explore_hrl.msg import ExploreAction, ExploreResult, ExploreGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Import_L19_C0", "label": "yaml import yaml", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0567, 0.003, 0, 0.66, 0.6316, 960, 0, 1, 0, 0, 960, 0, 0], "semantic": {"name": "yaml", "arg_names": [], "import_names": ["yaml"], "rhs_call_name": "", "annotation": ""}, "snippet": "import yaml"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Import_L20_C0", "label": "numpy import np, math", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0597, 0.003, 0, 0.66, 0.6842, 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_99334:Assign_L22_C0", "label": "room =", "type": "assigned_variable", "loc": [22, 22], "level": 0, "parent": null, "vector": [14, 0, 0.0657, 0.003, 0, 0.66, 0.7368, 846, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "room", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "room = '/home/travis/svn/gt-ros-pkg/hrl/room_explore/rooms/rooms.yaml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L24_C0", "label": "retfalse", "type": "function", "loc": [24, 25], "level": 0, "parent": null, "vector": [2, 0, 0.0731, 0.006, 0, 0.66, 0.7895, 71, 0, 0, 1, 0, 0, 0, 0], "semantic": {"name": "retfalse", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def retfalse():\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Return_L25_C4", "label": "return", "type": "return", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L24_C0", "vector": [13, 1, 0.0746, 0.003, 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_99334:ClassDef_L27_C0", "label": "TFthread", "type": "class", "loc": [27, 68], "level": 0, "parent": null, "vector": [3, 0, 0.1418, 0.1254, 0, 0.66, 0.8421, 93, 0, 4, 0, 0, 134, 0, 16], "semantic": {"name": "TFthread", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TFthread( Thread ):\n def __init__( self, df ):\n Thread.__init__( self )\n try:\n rospy.init_node( 'TFthread' )\n except:\n pass # parent probably already initialized node.\n self.df = df # yaml dictionary of rooms"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L28_C4", "label": "__init__", "type": "function", "loc": [28, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L27_C0", "vector": [2, 1, 0.097, 0.0299, 1, 0.07, 0.0, 555, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "df"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, df ):\n Thread.__init__( self )\n try:\n rospy.init_node( 'TFthread' )\n except:\n pass # parent probably already initialized node.\n self.df = df # yaml dictionary of rooms\n self.bc = tf.TransformBroadcaster()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L29_C8", "label": "__init__()", "type": "expression", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L28_C4", "vector": [8, 2, 0.0866, 0.003, 2, 0.17, 0.0, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Thread.__init__( self )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L30_C8", "label": "try", "type": "try", "loc": [30, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L28_C4", "vector": [7, 2, 0.094, 0.0119, 2, 0.17, 0.2, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node( 'TFthread' )\n except:\n pass # parent probably already initialized node."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L31_C12", "label": "init_node()", "type": "expression", "loc": [31, 31], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L30_C8", "vector": [8, 3, 0.0925, 0.003, 3, 0.69, 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( 'TFthread' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L34_C8", "label": "self.df =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L28_C4", "vector": [14, 2, 0.1015, 0.003, 2, 0.17, 0.4, 14, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.df", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.df = df # yaml dictionary of rooms"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L35_C8", "label": "self.bc = TransformBroadcaster()", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L28_C4", "vector": [14, 2, 0.1045, 0.003, 2, 0.17, 0.6, 0, 3, 0, 0, 0, 986, 10, 1], "semantic": {"name": "self.bc", "arg_names": [], "import_names": [], "rhs_call_name": "TransformBroadcaster", "annotation": ""}, "snippet": " self.bc = tf.TransformBroadcaster()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L36_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L28_C4", "vector": [14, 2, 0.1075, 0.003, 2, 0.17, 0.8, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L37_C8", "label": "start()", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L28_C4", "vector": [8, 2, 0.1104, 0.003, 2, 0.17, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L39_C4", "label": "publish_transform", "type": "function", "loc": [39, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L27_C0", "vector": [2, 1, 0.1328, 0.0358, 1, 0.07, 0.3333, 288, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "publish_transform", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def publish_transform( self ):\n for room in self.df.keys():\n self.bc.sendTransform( ( self.df[room]['position']['x'],\n self.df[room]['position']['y'],\n self.df[room]['position']['z'] ),\n ( self.df[room]['orientation']['x'],\n self.df[room]['orientation']['y'],\n self.df[room]['orientation']['z'],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L40_C8", "label": "for room", "type": "for", "loc": [40, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L39_C4", "vector": [6, 2, 0.1343, 0.0328, 2, 0.02, 0.0, 846, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "room", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for room in self.df.keys():\n self.bc.sendTransform( ( self.df[room]['position']['x'],\n self.df[room]['position']['y'],\n self.df[room]['position']['z'] ),\n ( self.df[room]['orientation']['x'],\n self.df[room]['orientation']['y'],\n self.df[room]['orientation']['z'],\n self.df[room]['orientation']['w'] ),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L41_C12", "label": "sendTransform()", "type": "expression", "loc": [41, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L40_C8", "vector": [8, 3, 0.1358, 0.0299, 3, 0.22, 0.0, 373, 3, 5, 0, 0, 0, 0, 2], "semantic": {"name": "sendTransform", "arg_names": [], "import_names": [], "rhs_call_name": "sendTransform", "annotation": ""}, "snippet": " self.bc.sendTransform( ( self.df[room]['position']['x'],\n self.df[room]['position']['y'],\n self.df[room]['position']['z'] ),\n ( self.df[room]['orientation']['x'],\n self.df[room]['orientation']['y'],\n self.df[room]['orientation']['z'],\n self.df[room]['orientation']['w'] ),\n rospy.Time.now(),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L52_C4", "label": "run", "type": "function", "loc": [52, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L27_C0", "vector": [2, 1, 0.1687, 0.0299, 1, 0.07, 0.6667, 679, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run( self ):\n rospy.logout( 'TFthread: Starting ' )\n r = rospy.Rate( 10 )\n while self.should_run and not rospy.is_shutdown():\n self.publish_transform()\n try:\n r.sleep()\n except:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L53_C8", "label": "logout()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L52_C4", "vector": [8, 2, 0.1582, 0.003, 2, 0.43, 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( 'TFthread: Starting ' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L54_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L52_C4", "vector": [14, 2, 0.1612, 0.003, 2, 0.43, 0.3333, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " r = rospy.Rate( 10 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L55_C8", "label": "while", "type": "while", "loc": [55, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L52_C4", "vector": [5, 2, 0.1716, 0.0179, 2, 0.43, 0.6667, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.should_run and not rospy.is_shutdown():\n self.publish_transform()\n try:\n r.sleep()\n except:\n pass # ROS exception."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L56_C12", "label": "publish_transform()", "type": "expression", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L55_C8", "vector": [8, 3, 0.1672, 0.003, 3, 0.06, 0.0, 288, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "publish_transform", "arg_names": [], "import_names": [], "rhs_call_name": "publish_transform", "annotation": ""}, "snippet": " self.publish_transform()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L57_C12", "label": "try", "type": "try", "loc": [57, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L55_C8", "vector": [7, 3, 0.1746, 0.0119, 3, 0.06, 1.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n r.sleep()\n except:\n pass # ROS exception."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L58_C16", "label": "sleep()", "type": "expression", "loc": [58, 58], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L57_C12", "vector": [8, 4, 0.1731, 0.003, 4, 0.49, 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_99334:Expr_L61_C8", "label": "logout()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L52_C4", "vector": [8, 2, 0.1821, 0.003, 2, 0.43, 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( 'TFthread: Starting ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L63_C4", "label": "stop", "type": "function", "loc": [63, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L27_C0", "vector": [2, 1, 0.1955, 0.0179, 1, 0.07, 1.0, 343, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "stop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop( self ):\n # Kill off the poller thread.\n self.should_run = False\n self.join(5)\n if (self.isAlive()):\n raise RuntimeError('TFthread: Unable to stop thread ' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L65_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L63_C4", "vector": [14, 2, 0.194, 0.003, 2, 0.22, 0.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L66_C8", "label": "join()", "type": "expression", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L63_C4", "vector": [8, 2, 0.197, 0.003, 2, 0.22, 0.5, 933, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.join(5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L67_C8", "label": "if", "type": "if", "loc": [67, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L63_C4", "vector": [4, 2, 0.2015, 0.006, 2, 0.22, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.isAlive()):\n raise RuntimeError('TFthread: Unable to stop thread ' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L79_C0", "label": "standard_rad", "type": "function", "loc": [79, 83], "level": 0, "parent": null, "vector": [2, 0, 0.2418, 0.0149, 0, 0.66, 0.8947, 54, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "standard_rad", "arg_names": ["t"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def standard_rad(t):\n if t > 0:\n return ((t + np.pi) % (np.pi * 2)) - np.pi\n else:\n return ((t - np.pi) % (np.pi * -2)) + np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L80_C4", "label": "if", "type": "if", "loc": [80, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L79_C0", "vector": [4, 1, 0.2433, 0.0119, 1, 0.46, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if t > 0:\n return ((t + np.pi) % (np.pi * 2)) - np.pi\n else:\n return ((t - np.pi) % (np.pi * -2)) + np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Return_L81_C8", "label": "return", "type": "return", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L80_C4", "vector": [13, 2, 0.2418, 0.003, 2, 0.44, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ((t + np.pi) % (np.pi * 2)) - np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Return_L83_C8", "label": "return", "type": "return", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L80_C4", "vector": [13, 2, 0.2478, 0.003, 2, 0.44, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ((t - np.pi) % (np.pi * -2)) + np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L86_C0", "label": "RoomExplore", "type": "class", "loc": [86, 303], "level": 0, "parent": null, "vector": [3, 0, 0.5806, 0.6507, 0, 0.66, 0.9474, 610, 0, 10, 0, 0, 134, 0, 87], "semantic": {"name": "RoomExplore", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RoomExplore( Thread ):\n def __init__( self, df, room, start_rad = 1.5 ):\n Thread.__init__( self )\n try:\n rospy.init_node( 'RoomExplore' )\n except:\n pass\n self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "label": "__init__", "type": "function", "loc": [87, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L86_C0", "vector": [2, 1, 0.2925, 0.0687, 1, 0.3, 0.0, 555, 0, 4, 0, 0, 0, 0, 12], "semantic": {"name": "__init__", "arg_names": ["self", "df", "room", "start_rad"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, df, room, start_rad = 1.5 ):\n Thread.__init__( self )\n try:\n rospy.init_node( 'RoomExplore' )\n except:\n pass\n self.should_run = True\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L88_C8", "label": "__init__()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "vector": [8, 2, 0.2627, 0.003, 2, 0.93, 0.0, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Thread.__init__( self )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L89_C8", "label": "try", "type": "try", "loc": [89, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "vector": [7, 2, 0.2701, 0.0119, 2, 0.93, 0.0769, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node( 'RoomExplore' )\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L90_C12", "label": "init_node()", "type": "expression", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L89_C8", "vector": [8, 3, 0.2687, 0.003, 3, 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( 'RoomExplore' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L93_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "vector": [14, 2, 0.2776, 0.003, 2, 0.93, 0.1538, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L95_C8", "label": "self.frame =", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "vector": [14, 2, 0.2836, 0.003, 2, 0.93, 0.2308, 409, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.frame = '/' + room"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L97_C8", "label": "self.height =", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "vector": [14, 2, 0.2896, 0.003, 2, 0.93, 0.3077, 466, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.height", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.height = df[room]['height']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L98_C8", "label": "self.width =", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "vector": [14, 2, 0.2925, 0.003, 2, 0.93, 0.3846, 901, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.width = df[room]['width']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L100_C8", "label": "self.listener = TransformListener()", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "vector": [14, 2, 0.2985, 0.003, 2, 0.93, 0.4615, 686, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.listener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L101_C8", "label": "waitForTransform()", "type": "expression", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "vector": [8, 2, 0.3015, 0.003, 2, 0.93, 0.5385, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.listener.waitForTransform( '/base_link', '/map', rospy.Time(0), timeout = rospy.Duration(100))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L103_C8", "label": "setup_poses()", "type": "expression", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "vector": [8, 2, 0.3075, 0.003, 2, 0.93, 0.6154, 64, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setup_poses", "arg_names": [], "import_names": [], "rhs_call_name": "setup_poses", "annotation": ""}, "snippet": " self.setup_poses( radius = start_rad ) # also initializes radius"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L105_C8", "label": "self.pub = Publisher()", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "vector": [14, 2, 0.3134, 0.003, 2, 0.93, 0.6923, 86, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.pub = rospy.Publisher( 'visarr', Marker )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L106_C8", "label": "self._as = SimpleActionServer()", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "vector": [14, 2, 0.3164, 0.003, 2, 0.93, 0.7692, 777, 3, 3, 0, 0, 975, 10, 1], "semantic": {"name": "self._as", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionServer", "annotation": ""}, "snippet": " self._as = actionlib.SimpleActionServer( '/explore', ExploreAction, execute_cb = self.action_request )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L107_C8", "label": "start()", "type": "expression", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "vector": [8, 2, 0.3194, 0.003, 2, 0.93, 0.8462, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self._as.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L108_C8", "label": "logout()", "type": "expression", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "vector": [8, 2, 0.3224, 0.003, 2, 0.93, 0.9231, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('Action should be started.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L109_C8", "label": "start()", "type": "expression", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "vector": [8, 2, 0.3254, 0.003, 2, 0.93, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L111_C4", "label": "action_request", "type": "function", "loc": [111, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L86_C0", "vector": [2, 1, 0.3522, 0.0448, 1, 0.3, 0.125, 616, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "action_request", "arg_names": ["self", "goal"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def action_request( self, goal ):\n rospy.logout( 'room_explore: action_request received for radius: \\'%2.2f\\'' % goal.radius )\n \n def preempt_func():\n # self._as should be in scope and bound @ function def. (I think for python...)\n check = self._as.is_preempt_requested()\n if check:\n rospy.logout( 'room_explore: action_request preempted!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L112_C8", "label": "logout()", "type": "expression", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L111_C4", "vector": [8, 2, 0.3343, 0.003, 2, 0.75, 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( 'room_explore: action_request received for radius: \\'%2.2f\\'' % goal.radius )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L114_C8", "label": "preempt_func", "type": "function", "loc": [114, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L111_C4", "vector": [2, 2, 0.3478, 0.0179, 2, 0.75, 0.25, 314, 0, 0, 1, 0, 0, 0, 2], "semantic": {"name": "preempt_func", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def preempt_func():\n # self._as should be in scope and bound @ function def. (I think for python...)\n check = self._as.is_preempt_requested()\n if check:\n rospy.logout( 'room_explore: action_request preempted!' )\n return check"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L116_C12", "label": "check = is_preempt_requested()", "type": "assigned_variable", "loc": [116, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L114_C8", "vector": [14, 3, 0.3463, 0.003, 3, 0.56, 0.0, 803, 3, 0, 0, 0, 468, 10, 1], "semantic": {"name": "check", "arg_names": [], "import_names": [], "rhs_call_name": "is_preempt_requested", "annotation": ""}, "snippet": " check = self._as.is_preempt_requested()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L117_C12", "label": "if", "type": "if", "loc": [117, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L114_C8", "vector": [4, 3, 0.3507, 0.006, 3, 0.56, 0.5, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if check:\n rospy.logout( 'room_explore: action_request preempted!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L118_C16", "label": "logout()", "type": "expression", "loc": [118, 118], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L117_C12", "vector": [8, 4, 0.3522, 0.003, 4, 0.71, 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( 'room_explore: action_request preempted!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Return_L119_C12", "label": "return", "type": "return", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L114_C8", "vector": [13, 3, 0.3552, 0.003, 3, 0.56, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return check"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L121_C8", "label": "rv = begin_explore()", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L111_C4", "vector": [14, 2, 0.3612, 0.003, 2, 0.75, 0.5, 222, 3, 2, 0, 0, 417, 10, 1], "semantic": {"name": "rv", "arg_names": [], "import_names": [], "rhs_call_name": "begin_explore", "annotation": ""}, "snippet": " rv = self.begin_explore( goal.radius, preempt_func = preempt_func )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L122_C8", "label": "logout()", "type": "expression", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L111_C4", "vector": [8, 2, 0.3642, 0.003, 2, 0.75, 0.75, 525, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'room_explore: action_request received result %d' % int(rv) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L124_C8", "label": "if", "type": "if", "loc": [124, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L111_C4", "vector": [4, 2, 0.3716, 0.006, 2, 0.75, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rv == True:\n self._as.set_succeeded( ExploreResult() )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L125_C12", "label": "set_succeeded()", "type": "expression", "loc": [125, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L124_C8", "vector": [8, 3, 0.3731, 0.003, 3, 0.42, 0.0, 825, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_succeeded", "arg_names": [], "import_names": [], "rhs_call_name": "set_succeeded", "annotation": ""}, "snippet": " self._as.set_succeeded( ExploreResult() )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L128_C4", "label": "begin_explore", "type": "function", "loc": [128, 202], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L86_C0", "vector": [2, 1, 0.4925, 0.2239, 1, 0.3, 0.25, 417, 0, 3, 1, 0, 0, 0, 38], "semantic": {"name": "begin_explore", "arg_names": ["self", "radius", "preempt_func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def begin_explore( self, radius, preempt_func = retfalse ):\n client = actionlib.SimpleActionClient( 'move_base', MoveBaseAction )\n rospy.logout( 'Waiting for move_base server' )\n client.wait_for_server()\n\n rospy.logout( 'room_explore: setting radius' )\n all_goals = self.setup_poses( radius )\n for goal in all_goals:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L129_C8", "label": "client = SimpleActionClient()", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L128_C4", "vector": [14, 2, 0.3851, 0.003, 2, 0.82, 0.0, 608, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " client = actionlib.SimpleActionClient( 'move_base', MoveBaseAction )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L130_C8", "label": "logout()", "type": "expression", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L128_C4", "vector": [8, 2, 0.3881, 0.003, 2, 0.82, 0.1667, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'Waiting for move_base server' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L131_C8", "label": "wait_for_server()", "type": "expression", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L128_C4", "vector": [8, 2, 0.391, 0.003, 2, 0.82, 0.3333, 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_99334:Expr_L133_C8", "label": "logout()", "type": "expression", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L128_C4", "vector": [8, 2, 0.397, 0.003, 2, 0.82, 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( 'room_explore: setting radius' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L134_C8", "label": "all_goals = setup_poses()", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L128_C4", "vector": [14, 2, 0.4, 0.003, 2, 0.82, 0.6667, 768, 3, 1, 0, 0, 64, 10, 1], "semantic": {"name": "all_goals", "arg_names": [], "import_names": [], "rhs_call_name": "setup_poses", "annotation": ""}, "snippet": " all_goals = self.setup_poses( radius )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L135_C8", "label": "for goal", "type": "for", "loc": [135, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L128_C4", "vector": [6, 2, 0.5, 0.197, 2, 0.82, 0.8333, 914, 2, 0, 0, 0, 0, 0, 33], "semantic": {"name": "goal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for goal in all_goals:\n #print 'room_explore: sending goal ', goal\n goal.target_pose.header.stamp = rospy.Time.now()\n\n client.send_goal( goal )\n\n time_last_moving = rospy.Time.now()\n goal_time = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L137_C12", "label": "goal.target_pose.header.stamp = now()", "type": "assigned_variable", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L135_C8", "vector": [14, 3, 0.409, 0.003, 3, 0.55, 0.0, 212, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "goal.target_pose.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " goal.target_pose.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L139_C12", "label": "send_goal()", "type": "expression", "loc": [139, 139], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L135_C8", "vector": [8, 3, 0.4149, 0.003, 3, 0.55, 0.1111, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " client.send_goal( goal )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L141_C12", "label": "time_last_moving = now()", "type": "assigned_variable", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L135_C8", "vector": [14, 3, 0.4209, 0.003, 3, 0.55, 0.2222, 83, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "time_last_moving", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " time_last_moving = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L142_C12", "label": "goal_time = now()", "type": "assigned_variable", "loc": [142, 142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L135_C8", "vector": [14, 3, 0.4239, 0.003, 3, 0.55, 0.3333, 297, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "goal_time", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " goal_time = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L144_C12", "label": "new_pose = current_robot_position()", "type": "assigned_variable", "loc": [144, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L135_C8", "vector": [14, 3, 0.4299, 0.003, 3, 0.55, 0.4444, 216, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "new_pose", "arg_names": [], "import_names": [], "rhs_call_name": "current_robot_position", "annotation": ""}, "snippet": " new_pose = self.current_robot_position()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L145_C12", "label": "ref_pose = current_robot_position()", "type": "assigned_variable", "loc": [145, 145], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L135_C8", "vector": [14, 3, 0.4328, 0.003, 3, 0.55, 0.5556, 213, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "ref_pose", "arg_names": [], "import_names": [], "rhs_call_name": "current_robot_position", "annotation": ""}, "snippet": " ref_pose = self.current_robot_position()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L147_C12", "label": "r = Rate()", "type": "assigned_variable", "loc": [147, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L135_C8", "vector": [14, 3, 0.4388, 0.003, 3, 0.55, 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( 5 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "label": "while", "type": "while", "loc": [148, 195], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L135_C8", "vector": [5, 3, 0.5119, 0.1433, 3, 0.55, 0.7778, 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 state = client.get_state()\n states = { 0: 'WAITING FOR GOAL ACK',\n 1: 'PENDING',\n 2: 'ACTIVE',\n 3: 'WAITING FOR RESULT',\n 4: 'WAITING FOR CANCEL ACK',\n 5: 'RECALLING',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L149_C16", "label": "state = get_state()", "type": "assigned_variable", "loc": [149, 149], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "vector": [14, 4, 0.4448, 0.003, 4, 0.96, 0.0, 688, 3, 0, 0, 0, 650, 10, 1], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "get_state", "annotation": ""}, "snippet": " state = client.get_state()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L150_C16", "label": "states =", "type": "assigned_variable", "loc": [150, 157], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "vector": [14, 4, 0.4582, 0.0239, 4, 0.96, 0.0909, 728, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "states", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " states = { 0: 'WAITING FOR GOAL ACK',\n 1: 'PENDING',\n 2: 'ACTIVE',\n 3: 'WAITING FOR RESULT',\n 4: 'WAITING FOR CANCEL ACK',\n 5: 'RECALLING',\n 6: 'PREEMPTING',\n 7: 'DONE' }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L162_C16", "label": "if", "type": "if", "loc": [162, 166], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "vector": [4, 4, 0.4896, 0.0149, 4, 0.96, 0.1818, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if state == 7 or state == 3:\n rospy.logout( 'room_explore: client no longer active' )\n print('State: ', state, ' ', states[state])\n time_last_moving = rospy.Time.now()\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L163_C20", "label": "logout()", "type": "expression", "loc": [163, 163], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L162_C16", "vector": [8, 5, 0.4866, 0.003, 5, 0.1, 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( 'room_explore: client no longer active' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L164_C20", "label": "print()", "type": "expression", "loc": [164, 164], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L162_C16", "vector": [8, 5, 0.4896, 0.003, 5, 0.1, 0.5, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('State: ', state, ' ', states[state])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L165_C20", "label": "time_last_moving = now()", "type": "assigned_variable", "loc": [165, 165], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L162_C16", "vector": [14, 5, 0.4925, 0.003, 5, 0.1, 1.0, 83, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "time_last_moving", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " time_last_moving = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L168_C16", "label": "if", "type": "if", "loc": [168, 171], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "vector": [4, 4, 0.506, 0.0119, 4, 0.96, 0.2727, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if preempt_func():\n rospy.logout( 'room_explore: preempted at a higher level.' )\n time_last_moving = rospy.Time.now()\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L169_C20", "label": "logout()", "type": "expression", "loc": [169, 169], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L168_C16", "vector": [8, 5, 0.5045, 0.003, 5, 0.15, 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( 'room_explore: preempted at a higher level.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L170_C20", "label": "time_last_moving = now()", "type": "assigned_variable", "loc": [170, 170], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L168_C16", "vector": [14, 5, 0.5075, 0.003, 5, 0.15, 1.0, 83, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "time_last_moving", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " time_last_moving = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L173_C16", "label": "new_pose = current_robot_position()", "type": "assigned_variable", "loc": [173, 173], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "vector": [14, 4, 0.5164, 0.003, 4, 0.96, 0.3636, 216, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "new_pose", "arg_names": [], "import_names": [], "rhs_call_name": "current_robot_position", "annotation": ""}, "snippet": " new_pose = self.current_robot_position()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L174_C16", "label": "dx =", "type": "assigned_variable", "loc": [174, 174], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "vector": [14, 4, 0.5194, 0.003, 4, 0.96, 0.4545, 870, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dx = new_pose[0] - ref_pose[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L175_C16", "label": "dy =", "type": "assigned_variable", "loc": [175, 175], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "vector": [14, 4, 0.5224, 0.003, 4, 0.96, 0.5455, 477, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dy = new_pose[1] - ref_pose[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L176_C16", "label": "da =", "type": "assigned_variable", "loc": [176, 176], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "vector": [14, 4, 0.5254, 0.003, 4, 0.96, 0.6364, 444, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "da", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " da = new_pose[-1] - ref_pose[-1] # yaw"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L178_C16", "label": "if", "type": "if", "loc": [178, 181], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "vector": [4, 4, 0.5358, 0.0119, 4, 0.96, 0.7273, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dx*dx + dy*dy > 0.02 or da*da > math.radians( 5 ):\n time_last_moving = rospy.Time.now()\n ref_pose = self.current_robot_position()\n rospy.logout('WE ARE MOVING')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L179_C20", "label": "time_last_moving = now()", "type": "assigned_variable", "loc": [179, 179], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L178_C16", "vector": [14, 5, 0.5343, 0.003, 5, 0.62, 0.0, 83, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "time_last_moving", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " time_last_moving = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L180_C20", "label": "ref_pose = current_robot_position()", "type": "assigned_variable", "loc": [180, 180], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L178_C16", "vector": [14, 5, 0.5373, 0.003, 5, 0.62, 0.5, 213, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "ref_pose", "arg_names": [], "import_names": [], "rhs_call_name": "current_robot_position", "annotation": ""}, "snippet": " ref_pose = self.current_robot_position()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L181_C20", "label": "logout()", "type": "expression", "loc": [181, 181], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L178_C16", "vector": [8, 5, 0.5403, 0.003, 5, 0.62, 1.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('WE ARE MOVING')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L183_C16", "label": "if", "type": "if", "loc": [183, 187], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "vector": [4, 4, 0.5522, 0.0149, 4, 0.96, 0.8182, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rospy.Time.now() - time_last_moving > rospy.Duration( 8 ):\n rospy.logout( 'We do not appear to have moved. Aborting current goal.' )\n client.cancel_all_goals() # Should force a break on GoalState\n time_last_moving = rospy.Time.now()\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L184_C20", "label": "logout()", "type": "expression", "loc": [184, 184], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L183_C16", "vector": [8, 5, 0.5493, 0.003, 5, 0.15, 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( 'We do not appear to have moved. Aborting current goal.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L185_C20", "label": "cancel_all_goals()", "type": "expression", "loc": [185, 185], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L183_C16", "vector": [8, 5, 0.5522, 0.003, 5, 0.15, 0.5, 699, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel_all_goals", "arg_names": [], "import_names": [], "rhs_call_name": "cancel_all_goals", "annotation": ""}, "snippet": " client.cancel_all_goals() # Should force a break on GoalState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L186_C20", "label": "time_last_moving = now()", "type": "assigned_variable", "loc": [186, 186], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L183_C16", "vector": [14, 5, 0.5552, 0.003, 5, 0.15, 1.0, 83, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "time_last_moving", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " time_last_moving = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L189_C16", "label": "if", "type": "if", "loc": [189, 193], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "vector": [4, 4, 0.5701, 0.0149, 4, 0.96, 0.9091, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rospy.Time.now() - goal_time > rospy.Duration( 30 ):\n rospy.logout( 'Goal not achieved after 30 seconds. Aborting.' )\n client.cancel_all_goals() # Should force a break on GoalState\n time_last_moving = rospy.Time.now()\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L190_C20", "label": "logout()", "type": "expression", "loc": [190, 190], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L189_C16", "vector": [8, 5, 0.5672, 0.003, 5, 0.57, 0.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'Goal not achieved after 30 seconds. Aborting.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L191_C20", "label": "cancel_all_goals()", "type": "expression", "loc": [191, 191], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L189_C16", "vector": [8, 5, 0.5701, 0.003, 5, 0.57, 0.5, 699, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel_all_goals", "arg_names": [], "import_names": [], "rhs_call_name": "cancel_all_goals", "annotation": ""}, "snippet": " client.cancel_all_goals() # Should force a break on GoalState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L192_C20", "label": "time_last_moving = now()", "type": "assigned_variable", "loc": [192, 192], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L189_C16", "vector": [14, 5, 0.5731, 0.003, 5, 0.57, 1.0, 83, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "time_last_moving", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " time_last_moving = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L195_C16", "label": "sleep()", "type": "expression", "loc": [195, 195], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "vector": [8, 4, 0.5821, 0.003, 4, 0.96, 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_99334:Expr_L197_C12", "label": "cancel_all_goals()", "type": "expression", "loc": [197, 197], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L135_C8", "vector": [8, 3, 0.5881, 0.003, 3, 0.55, 0.8889, 699, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel_all_goals", "arg_names": [], "import_names": [], "rhs_call_name": "cancel_all_goals", "annotation": ""}, "snippet": " client.cancel_all_goals() # Just in case"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L199_C12", "label": "if", "type": "if", "loc": [199, 200], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L135_C8", "vector": [4, 3, 0.5955, 0.006, 3, 0.55, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if preempt_func(): # immediately exit if overall action preempted\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Return_L202_C8", "label": "return", "type": "return", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L128_C4", "vector": [13, 2, 0.603, 0.003, 2, 0.82, 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_99334:FunctionDef_L205_C4", "label": "current_robot_position", "type": "function", "loc": [205, 233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L86_C0", "vector": [2, 1, 0.6537, 0.0866, 1, 0.3, 0.375, 908, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "current_robot_position", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def current_robot_position( self ):\n ps = PoseStamped()\n ps.header.stamp = rospy.Time(0)\n ps.header.frame_id = '/base_link'\n ps.pose.orientation.w = 1.0\n\n try:\n ps_map = self.listener.transformPose( '/map', ps )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L206_C8", "label": "ps = PoseStamped()", "type": "assigned_variable", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L205_C4", "vector": [14, 2, 0.6149, 0.003, 2, 0.58, 0.0, 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_99334:Assign_L207_C8", "label": "ps.header.stamp = Time()", "type": "assigned_variable", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L205_C4", "vector": [14, 2, 0.6179, 0.003, 2, 0.58, 0.1429, 161, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " ps.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L208_C8", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L205_C4", "vector": [14, 2, 0.6209, 0.003, 2, 0.58, 0.2857, 293, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ps.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.header.frame_id = '/base_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L209_C8", "label": "ps.pose.orientation.w =", "type": "assigned_variable", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L205_C4", "vector": [14, 2, 0.6239, 0.003, 2, 0.58, 0.4286, 163, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "ps.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.w = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L211_C8", "label": "try", "type": "try", "loc": [211, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L205_C4", "vector": [7, 2, 0.6403, 0.0239, 2, 0.58, 0.5714, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n ps_map = self.listener.transformPose( '/map', ps )\n except:\n rospy.logout( 'room_explore: Transform failed' )\n ps_map = PoseStamped()\n ps_map.header.stamp = rospy.Time.now()\n ps_map.header.frame_id = '/map'\n ps_map.pose.orientation = new_quat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L212_C12", "label": "ps_map = transformPose()", "type": "assigned_variable", "loc": [212, 212], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L211_C8", "vector": [14, 3, 0.6328, 0.003, 3, 0.28, 0.0, 938, 3, 2, 0, 0, 654, 10, 1], "semantic": {"name": "ps_map", "arg_names": [], "import_names": [], "rhs_call_name": "transformPose", "annotation": ""}, "snippet": " ps_map = self.listener.transformPose( '/map', ps )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L214_C12", "label": "logout()", "type": "expression", "loc": [214, 214], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L211_C8", "vector": [8, 3, 0.6388, 0.003, 3, 0.28, 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( 'room_explore: Transform failed' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L215_C12", "label": "ps_map = PoseStamped()", "type": "assigned_variable", "loc": [215, 215], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L211_C8", "vector": [14, 3, 0.6418, 0.003, 3, 0.28, 0.25, 938, 3, 0, 0, 0, 226, 10, 1], "semantic": {"name": "ps_map", "arg_names": [], "import_names": [], "rhs_call_name": "PoseStamped", "annotation": ""}, "snippet": " ps_map = PoseStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L216_C12", "label": "ps_map.header.stamp = now()", "type": "assigned_variable", "loc": [216, 216], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L211_C8", "vector": [14, 3, 0.6448, 0.003, 3, 0.28, 0.5, 322, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "ps_map.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " ps_map.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L217_C12", "label": "ps_map.header.frame_id =", "type": "assigned_variable", "loc": [217, 217], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L211_C8", "vector": [14, 3, 0.6478, 0.003, 3, 0.28, 0.75, 933, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ps_map.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps_map.header.frame_id = '/map'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L218_C12", "label": "ps_map.pose.orientation =", "type": "assigned_variable", "loc": [218, 218], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L211_C8", "vector": [14, 3, 0.6507, 0.003, 3, 0.28, 1.0, 49, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps_map.pose.orientation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps_map.pose.orientation = new_quat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L220_C8", "label": "roll, pitch, yaw = euler_from_quaternion()", "type": "assigned_variable", "loc": [220, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L205_C4", "vector": [14, 2, 0.6612, 0.0119, 2, 0.58, 0.7143, 633, 3, 1, 0, 0, 409, 10, 1], "semantic": {"name": "roll, pitch, yaw", "arg_names": [], "import_names": [], "rhs_call_name": "euler_from_quaternion", "annotation": ""}, "snippet": " roll, pitch, yaw = tf.transformations.euler_from_quaternion(( ps_map.pose.orientation.x,\n ps_map.pose.orientation.y,\n ps_map.pose.orientation.z,\n ps_map.pose.orientation.w ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L225_C8", "label": "rv =", "type": "assigned_variable", "loc": [225, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L205_C4", "vector": [14, 2, 0.6791, 0.0179, 2, 0.58, 0.8571, 222, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "rv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rv = [ ps_map.pose.position.x,\n ps_map.pose.position.y,\n ps_map.pose.position.z,\n roll,\n pitch,\n yaw ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Return_L233_C8", "label": "return", "type": "return", "loc": [233, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L205_C4", "vector": [13, 2, 0.6955, 0.003, 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 rv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L236_C4", "label": "setup_poses", "type": "function", "loc": [236, 265], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L86_C0", "vector": [2, 1, 0.7478, 0.0896, 1, 0.3, 0.5, 64, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "setup_poses", "arg_names": ["self", "radius"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setup_poses( self, radius ):\n self.radius = radius\n xdir = np.arange( self.radius / 2.0, self.height + self.radius / 2.0, self.radius )\n ydir = np.arange( self.radius / 2.0, self.width + self.radius / 2.0, self.radius )\n\n move_dir = 0.0\n self.poses = []\n mod = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L237_C8", "label": "self.radius =", "type": "assigned_variable", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L236_C4", "vector": [14, 2, 0.7075, 0.003, 2, 0.48, 0.0, 390, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.radius", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.radius = radius"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L238_C8", "label": "xdir = arange()", "type": "assigned_variable", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L236_C4", "vector": [14, 2, 0.7104, 0.003, 2, 0.48, 0.1429, 622, 3, 3, 0, 0, 489, 10, 1], "semantic": {"name": "xdir", "arg_names": [], "import_names": [], "rhs_call_name": "arange", "annotation": ""}, "snippet": " xdir = np.arange( self.radius / 2.0, self.height + self.radius / 2.0, self.radius )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L239_C8", "label": "ydir = arange()", "type": "assigned_variable", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L236_C4", "vector": [14, 2, 0.7134, 0.003, 2, 0.48, 0.2857, 232, 3, 3, 0, 0, 489, 10, 1], "semantic": {"name": "ydir", "arg_names": [], "import_names": [], "rhs_call_name": "arange", "annotation": ""}, "snippet": " ydir = np.arange( self.radius / 2.0, self.width + self.radius / 2.0, self.radius )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L241_C8", "label": "move_dir =", "type": "assigned_variable", "loc": [241, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L236_C4", "vector": [14, 2, 0.7194, 0.003, 2, 0.48, 0.4286, 21, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "move_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " move_dir = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L242_C8", "label": "self.poses =", "type": "assigned_variable", "loc": [242, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L236_C4", "vector": [14, 2, 0.7224, 0.003, 2, 0.48, 0.5714, 872, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.poses", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.poses = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L243_C8", "label": "mod =", "type": "assigned_variable", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L236_C4", "vector": [14, 2, 0.7254, 0.003, 2, 0.48, 0.7143, 25, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "mod", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mod = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L244_C8", "label": "for y", "type": "for", "loc": [244, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L236_C4", "vector": [6, 2, 0.7582, 0.0627, 2, 0.48, 0.8571, 304, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for y in ydir:\n if mod == 0:\n xord = xdir\n else:\n xord = xdir[::-1]\n \n for x in xord:\n goal = MoveBaseGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L245_C12", "label": "if", "type": "if", "loc": [245, 248], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L244_C8", "vector": [4, 3, 0.7358, 0.0119, 3, 0.02, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mod == 0:\n xord = xdir\n else:\n xord = xdir[::-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L246_C16", "label": "xord =", "type": "assigned_variable", "loc": [246, 246], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L245_C12", "vector": [14, 4, 0.7343, 0.003, 4, 0.26, 0.0, 622, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xord", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xord = xdir"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L248_C16", "label": "xord =", "type": "assigned_variable", "loc": [248, 248], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L245_C12", "vector": [14, 4, 0.7403, 0.003, 4, 0.26, 1.0, 622, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xord", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xord = xdir[::-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L250_C12", "label": "for x", "type": "for", "loc": [250, 262], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L244_C8", "vector": [6, 3, 0.7642, 0.0388, 3, 0.02, 0.3333, 190, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x in xord:\n goal = MoveBaseGoal()\n goal.target_pose.header.frame_id = self.frame\n goal.target_pose.header.stamp = rospy.Time.now()\n goal.target_pose.pose.position.x = x\n goal.target_pose.pose.position.y = y\n quat = tf.transformations.quaternion_from_euler( 0.0, 0.0, move_dir )\n goal.target_pose.pose.orientation.x = quat[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L251_C16", "label": "goal = MoveBaseGoal()", "type": "assigned_variable", "loc": [251, 251], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L250_C12", "vector": [14, 4, 0.7493, 0.003, 4, 0.51, 0.0, 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_99334:Assign_L252_C16", "label": "goal.target_pose.header.frame_id =", "type": "assigned_variable", "loc": [252, 252], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L250_C12", "vector": [14, 4, 0.7522, 0.003, 4, 0.51, 0.1, 138, 7, 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 = self.frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L253_C16", "label": "goal.target_pose.header.stamp = now()", "type": "assigned_variable", "loc": [253, 253], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L250_C12", "vector": [14, 4, 0.7552, 0.003, 4, 0.51, 0.2, 212, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "goal.target_pose.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " goal.target_pose.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L254_C16", "label": "goal.target_pose.pose.position.x =", "type": "assigned_variable", "loc": [254, 254], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L250_C12", "vector": [14, 4, 0.7582, 0.003, 4, 0.51, 0.3, 47, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.target_pose.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.target_pose.pose.position.x = x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L255_C16", "label": "goal.target_pose.pose.position.y =", "type": "assigned_variable", "loc": [255, 255], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L250_C12", "vector": [14, 4, 0.7612, 0.003, 4, 0.51, 0.4, 87, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.target_pose.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.target_pose.pose.position.y = y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L256_C16", "label": "quat = quaternion_from_euler()", "type": "assigned_variable", "loc": [256, 256], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L250_C12", "vector": [14, 4, 0.7642, 0.003, 4, 0.51, 0.5, 367, 3, 3, 0, 0, 561, 10, 1], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_from_euler", "annotation": ""}, "snippet": " quat = tf.transformations.quaternion_from_euler( 0.0, 0.0, move_dir )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L257_C16", "label": "goal.target_pose.pose.orientation.x =", "type": "assigned_variable", "loc": [257, 257], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L250_C12", "vector": [14, 4, 0.7672, 0.003, 4, 0.51, 0.6, 171, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.target_pose.pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.target_pose.pose.orientation.x = quat[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L258_C16", "label": "goal.target_pose.pose.orientation.y =", "type": "assigned_variable", "loc": [258, 258], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L250_C12", "vector": [14, 4, 0.7701, 0.003, 4, 0.51, 0.7, 381, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.target_pose.pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.target_pose.pose.orientation.y = quat[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L259_C16", "label": "goal.target_pose.pose.orientation.z =", "type": "assigned_variable", "loc": [259, 259], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L250_C12", "vector": [14, 4, 0.7731, 0.003, 4, 0.51, 0.8, 258, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.target_pose.pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.target_pose.pose.orientation.z = quat[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L260_C16", "label": "goal.target_pose.pose.orientation.w =", "type": "assigned_variable", "loc": [260, 260], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L250_C12", "vector": [14, 4, 0.7761, 0.003, 4, 0.51, 0.9, 361, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.target_pose.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.target_pose.pose.orientation.w = quat[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L262_C16", "label": "append()", "type": "expression", "loc": [262, 262], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L250_C12", "vector": [8, 4, 0.7821, 0.003, 4, 0.51, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.poses.append( goal )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L263_C12", "label": "move_dir = standard_rad()", "type": "assigned_variable", "loc": [263, 263], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L244_C8", "vector": [14, 3, 0.7851, 0.003, 3, 0.02, 0.6667, 21, 3, 1, 0, 0, 54, 10, 1], "semantic": {"name": "move_dir", "arg_names": [], "import_names": [], "rhs_call_name": "standard_rad", "annotation": ""}, "snippet": " move_dir = standard_rad( move_dir + np.pi )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L264_C12", "label": "mod =", "type": "assigned_variable", "loc": [264, 264], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L244_C8", "vector": [14, 3, 0.7881, 0.003, 3, 0.02, 1.0, 25, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mod", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mod = ( mod + 1 ) % 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Return_L265_C8", "label": "return", "type": "return", "loc": [265, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L236_C4", "vector": [13, 2, 0.791, 0.003, 2, 0.48, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.poses"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L268_C4", "label": "run", "type": "function", "loc": [268, 277], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L86_C0", "vector": [2, 1, 0.8134, 0.0299, 1, 0.3, 0.625, 679, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run( self ):\n rospy.logout( 'RoomExplore: Starting ' )\n r = rospy.Rate( 2 )\n while self.should_run and not rospy.is_shutdown():\n self.publish_markers()\n try:\n r.sleep()\n except:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L269_C8", "label": "logout()", "type": "expression", "loc": [269, 269], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L268_C4", "vector": [8, 2, 0.803, 0.003, 2, 0.16, 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( 'RoomExplore: Starting ' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L270_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [270, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L268_C4", "vector": [14, 2, 0.806, 0.003, 2, 0.16, 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( 2 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L271_C8", "label": "while", "type": "while", "loc": [271, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L268_C4", "vector": [5, 2, 0.8164, 0.0179, 2, 0.16, 0.6667, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.should_run and not rospy.is_shutdown():\n self.publish_markers()\n try:\n r.sleep()\n except:\n pass # ROS exception."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L272_C12", "label": "publish_markers()", "type": "expression", "loc": [272, 272], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L271_C8", "vector": [8, 3, 0.8119, 0.003, 3, 0.6, 0.0, 116, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "publish_markers", "arg_names": [], "import_names": [], "rhs_call_name": "publish_markers", "annotation": ""}, "snippet": " self.publish_markers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L273_C12", "label": "try", "type": "try", "loc": [273, 276], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L271_C8", "vector": [7, 3, 0.8194, 0.0119, 3, 0.6, 1.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n r.sleep()\n except:\n pass # ROS exception."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L274_C16", "label": "sleep()", "type": "expression", "loc": [274, 274], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L273_C12", "vector": [8, 4, 0.8179, 0.003, 4, 0.03, 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_99334:Expr_L277_C8", "label": "logout()", "type": "expression", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L268_C4", "vector": [8, 2, 0.8269, 0.003, 2, 0.16, 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( 'RoomExplore: Starting ' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L279_C4", "label": "stop", "type": "function", "loc": [279, 284], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L86_C0", "vector": [2, 1, 0.8403, 0.0179, 1, 0.3, 0.75, 343, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "stop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop( self ):\n # Kill off the poller thread.\n self.should_run = False\n self.join(5)\n if (self.isAlive()):\n raise RuntimeError('RoomExplore: Unable to stop thread ' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L281_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [281, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L279_C4", "vector": [14, 2, 0.8388, 0.003, 2, 0.68, 0.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L282_C8", "label": "join()", "type": "expression", "loc": [282, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L279_C4", "vector": [8, 2, 0.8418, 0.003, 2, 0.68, 0.5, 933, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.join(5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L283_C8", "label": "if", "type": "if", "loc": [283, 284], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L279_C4", "vector": [4, 2, 0.8463, 0.006, 2, 0.68, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.isAlive()):\n raise RuntimeError('RoomExplore: Unable to stop thread ' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L287_C4", "label": "publish_markers", "type": "function", "loc": [287, 300], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L86_C0", "vector": [2, 1, 0.8761, 0.0418, 1, 0.3, 0.875, 116, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "publish_markers", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def publish_markers( self ):\n for i,g in enumerate(self.poses):\n m = Marker()\n m.ns = 'sample_positions'\n m.id = i\n m.action = m.ADD\n m.type = m.ARROW\n m.header.frame_id = self.frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L288_C8", "label": "for i, g", "type": "for", "loc": [288, 300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L287_C4", "vector": [6, 2, 0.8776, 0.0388, 2, 0.85, 0.0, 674, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "i, g", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,g in enumerate(self.poses):\n m = Marker()\n m.ns = 'sample_positions'\n m.id = i\n m.action = m.ADD\n m.type = m.ARROW\n m.header.frame_id = self.frame\n m.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L289_C12", "label": "m = Marker()", "type": "assigned_variable", "loc": [289, 289], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L288_C8", "vector": [14, 3, 0.8627, 0.003, 3, 0.9, 0.0, 711, 3, 0, 0, 0, 923, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "Marker", "annotation": ""}, "snippet": " m = Marker()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L290_C12", "label": "m.ns =", "type": "assigned_variable", "loc": [290, 290], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L288_C8", "vector": [14, 3, 0.8657, 0.003, 3, 0.9, 0.1, 889, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "m.ns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.ns = 'sample_positions'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L291_C12", "label": "m.id =", "type": "assigned_variable", "loc": [291, 291], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L288_C8", "vector": [14, 3, 0.8687, 0.003, 3, 0.9, 0.2, 46, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.id = i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L292_C12", "label": "m.action =", "type": "assigned_variable", "loc": [292, 292], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L288_C8", "vector": [14, 3, 0.8716, 0.003, 3, 0.9, 0.3, 654, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.action = m.ADD"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L293_C12", "label": "m.type =", "type": "assigned_variable", "loc": [293, 293], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L288_C8", "vector": [14, 3, 0.8746, 0.003, 3, 0.9, 0.4, 148, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.type = m.ARROW"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L294_C12", "label": "m.header.frame_id =", "type": "assigned_variable", "loc": [294, 294], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L288_C8", "vector": [14, 3, 0.8776, 0.003, 3, 0.9, 0.5, 636, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.header.frame_id = self.frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L295_C12", "label": "m.header.stamp = now()", "type": "assigned_variable", "loc": [295, 295], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L288_C8", "vector": [14, 3, 0.8806, 0.003, 3, 0.9, 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_99334:Assign_L296_C12", "label": "m.scale = Vector3()", "type": "assigned_variable", "loc": [296, 296], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L288_C8", "vector": [14, 3, 0.8836, 0.003, 3, 0.9, 0.7, 508, 3, 3, 0, 0, 759, 10, 1], "semantic": {"name": "m.scale", "arg_names": [], "import_names": [], "rhs_call_name": "Vector3", "annotation": ""}, "snippet": " m.scale = Vector3( 0.15, 1.0, 1.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L297_C12", "label": "m.color = ColorRGBA()", "type": "assigned_variable", "loc": [297, 297], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L288_C8", "vector": [14, 3, 0.8866, 0.003, 3, 0.9, 0.8, 882, 3, 4, 0, 0, 927, 10, 1], "semantic": {"name": "m.color", "arg_names": [], "import_names": [], "rhs_call_name": "ColorRGBA", "annotation": ""}, "snippet": " m.color = ColorRGBA( 0.2, 1.0, 0.2, 0.7 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L298_C12", "label": "m.pose =", "type": "assigned_variable", "loc": [298, 298], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L288_C8", "vector": [14, 3, 0.8896, 0.003, 3, 0.9, 0.9, 927, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.pose = g.target_pose.pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L300_C12", "label": "publish()", "type": "expression", "loc": [300, 300], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L288_C8", "vector": [8, 3, 0.8955, 0.003, 3, 0.9, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.pub.publish( m )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L302_C4", "label": "goals", "type": "function", "loc": [302, 303], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L86_C0", "vector": [2, 1, 0.903, 0.006, 1, 0.3, 1.0, 747, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "goals", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def goals( self ):\n return self.poses"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Return_L303_C8", "label": "return", "type": "return", "loc": [303, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L302_C4", "vector": [13, 2, 0.9045, 0.003, 2, 0.48, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.poses"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L311_C0", "label": "if", "type": "if", "loc": [311, 333], "level": 0, "parent": null, "vector": [4, 0, 0.9612, 0.0687, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n f = open( room )\n dat = yaml.load( f )\n f.close()\n\n TFthread( dat ) \n \n re = RoomExplore( dat, 'hrl', 0.8 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L312_C4", "label": "f = open()", "type": "assigned_variable", "loc": [312, 312], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L311_C0", "vector": [14, 1, 0.9313, 0.003, 1, 0.13, 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( room )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L313_C4", "label": "dat = load()", "type": "assigned_variable", "loc": [313, 313], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L311_C0", "vector": [14, 1, 0.9343, 0.003, 1, 0.13, 0.2, 934, 3, 1, 0, 0, 37, 10, 1], "semantic": {"name": "dat", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": " dat = yaml.load( f )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L314_C4", "label": "close()", "type": "expression", "loc": [314, 314], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L311_C0", "vector": [8, 1, 0.9373, 0.003, 1, 0.13, 0.4, 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_99334:Expr_L316_C4", "label": "TFthread()", "type": "expression", "loc": [316, 316], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L311_C0", "vector": [8, 1, 0.9433, 0.003, 1, 0.13, 0.6, 93, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "TFthread", "arg_names": [], "import_names": [], "rhs_call_name": "TFthread", "annotation": ""}, "snippet": " TFthread( dat ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L318_C4", "label": "re = RoomExplore()", "type": "assigned_variable", "loc": [318, 318], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L311_C0", "vector": [14, 1, 0.9493, 0.003, 1, 0.13, 0.8, 540, 3, 3, 0, 0, 610, 10, 1], "semantic": {"name": "re", "arg_names": [], "import_names": [], "rhs_call_name": "RoomExplore", "annotation": ""}, "snippet": " re = RoomExplore( dat, 'hrl', 0.8 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L333_C4", "label": "spin()", "type": "expression", "loc": [333, 333], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L311_C0", "vector": [8, 1, 0.994, 0.003, 1, 0.13, 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_99334:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Return_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L30_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L31_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L57_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L58_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Return_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Return_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L114_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L114_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L117_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L118_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L114_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Return_L119_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L139_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L141_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L142_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L144_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L145_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L149_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L150_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L162_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L162_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L163_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L162_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L164_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L162_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L165_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L168_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L168_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L169_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L168_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L170_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L173_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L174_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L175_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L176_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L178_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L178_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L179_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L178_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L180_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L178_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L181_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L183_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L183_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L184_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L183_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L185_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L183_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L186_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L189_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L189_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L190_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L189_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L191_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L189_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L192_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L148_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L195_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L197_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L199_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Return_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L211_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L212_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L211_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L214_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L211_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L215_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L211_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L216_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L211_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L217_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L211_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L218_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Return_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L236_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L236_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L236_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L236_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L236_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L236_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L236_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L236_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L244_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L245_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L245_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L246_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L245_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L248_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L244_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L250_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L250_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L251_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L250_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L252_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L250_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L253_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L250_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L254_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L250_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L255_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L250_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L256_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L250_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L257_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L250_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L258_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L250_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L259_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L250_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L260_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L250_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L262_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L244_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L263_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L244_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L264_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L236_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Return_L265_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L268_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L268_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L268_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L270_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L268_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L271_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L272_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:While_L271_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L273_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:Try_L273_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L274_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L268_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L279_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L279_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L281_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L279_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L282_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L279_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L287_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L288_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L288_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L289_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L288_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L290_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L288_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L291_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L288_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L292_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L288_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L293_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L288_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L294_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L288_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L295_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L288_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L296_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L288_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L297_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L288_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L298_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:For_L288_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L300_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L302_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:FunctionDef_L302_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Return_L303_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L312_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L313_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L314_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L316_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Assign_L318_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99334:If_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99334:Expr_L333_C4"}]
#! /usr/bin/python import roslib; roslib.load_manifest('pr2_omni_teleop') import rospy import hrl_camera.ros_camera as rc import cv import hrl_lib.rutils as ru import hrl_lib.util as ut import math #TF import tf import hrl_lib.tf_utils as tfu import tf.transformations as tr 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_99336
37
56
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99336:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0357, 0.0179, 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('pr2_omni_teleop')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99336:Expr_L2_C15", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0357, 0.0179, 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('pr2_omni_teleop')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99336:Import_L3_C0", "label": "rospy import rospy", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0536, 0.0179, 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_99336:Import_L4_C0", "label": "hrl_camera.ros_camera import rc", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0714, 0.0179, 0, 0.66, 0.2727, 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_99336:Import_L5_C0", "label": "cv import cv", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0893, 0.0179, 0, 0.66, 0.3636, 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_99336:Import_L6_C0", "label": "hrl_lib.rutils import ru", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1071, 0.0179, 0, 0.66, 0.4545, 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_99336:Import_L7_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.0179, 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_99336:Import_L8_C0", "label": "math import math", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0179, 0, 0.66, 0.6364, 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_99336:Import_L11_C0", "label": "tf import tf", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1964, 0.0179, 0, 0.66, 0.7273, 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_99336:Import_L12_C0", "label": "hrl_lib.tf_utils import tfu", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.2143, 0.0179, 0, 0.66, 0.8182, 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_99336:Import_L13_C0", "label": "tf.transformations import tr", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.2321, 0.0179, 0, 0.66, 0.9091, 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_99336:If_L16_C0", "label": "if", "type": "if", "loc": [16, 54], "level": 0, "parent": null, "vector": [4, 0, 0.625, 0.6964, 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_99336:Import_L17_C4", "label": "sys import sys", "type": "import", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "vector": [1, 1, 0.3036, 0.0179, 1, 0.87, 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_99336:Assign_L19_C4", "label": "base_name =", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "vector": [14, 1, 0.3393, 0.0179, 1, 0.87, 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_99336:Assign_L20_C4", "label": "test =", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "vector": [14, 1, 0.3571, 0.0179, 1, 0.87, 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_99336:Assign_L21_C4", "label": "ls = LaserScanner()", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "vector": [14, 1, 0.375, 0.0179, 1, 0.87, 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_99336:Assign_L22_C4", "label": "prosilica = Prosilica()", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "vector": [14, 1, 0.3929, 0.0179, 1, 0.87, 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_99336:Assign_L23_C4", "label": "tf_listener = TransformListener()", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "vector": [14, 1, 0.4107, 0.0179, 1, 0.87, 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_99336:Expr_L25_C4", "label": "loginfo()", "type": "expression", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "vector": [8, 1, 0.4464, 0.0179, 1, 0.87, 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_99336:Assign_L26_C4", "label": "points = scan()", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "vector": [14, 1, 0.4643, 0.0179, 1, 0.87, 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_99336:Expr_L27_C4", "label": "loginfo()", "type": "expression", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "vector": [8, 1, 0.4821, 0.0179, 1, 0.87, 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_99336:Expr_L28_C4", "label": "loginfo()", "type": "expression", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "vector": [8, 1, 0.5, 0.0179, 1, 0.87, 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_99336:Assign_L29_C4", "label": "image = get_frame()", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "vector": [14, 1, 0.5179, 0.0179, 1, 0.87, 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_99336:Expr_L30_C4", "label": "loginfo()", "type": "expression", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "vector": [8, 1, 0.5357, 0.0179, 1, 0.87, 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_99336:Assign_L34_C4", "label": "pro_T_bf = transform()", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "vector": [14, 1, 0.6071, 0.0179, 1, 0.87, 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_99336:Assign_L37_C4", "label": "map_T_bf = transform()", "type": "assigned_variable", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "vector": [14, 1, 0.6607, 0.0179, 1, 0.87, 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_99336:Expr_L40_C4", "label": "loginfo()", "type": "expression", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "vector": [8, 1, 0.7143, 0.0179, 1, 0.87, 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_99336:Assign_L41_C4", "label": "calibration = ROSCameraCalibration()", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "vector": [14, 1, 0.7321, 0.0179, 1, 0.87, 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_99336:Assign_L42_C4", "label": "r = Rate()", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "vector": [14, 1, 0.75, 0.0179, 1, 0.87, 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_99336:While_L43_C4", "label": "while", "type": "while", "loc": [43, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "vector": [5, 1, 0.7768, 0.0357, 1, 0.87, 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_99336:Expr_L44_C8", "label": "sleep()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:While_L43_C4", "vector": [8, 2, 0.7857, 0.0179, 2, 0.84, 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_99336:Expr_L46_C4", "label": "loginfo()", "type": "expression", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "vector": [8, 1, 0.8214, 0.0179, 1, 0.87, 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_99336:Assign_L47_C4", "label": "pkl_name =", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "vector": [14, 1, 0.8393, 0.0179, 1, 0.87, 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_99336:Assign_L48_C4", "label": "img_name =", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "vector": [14, 1, 0.8571, 0.0179, 1, 0.87, 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_99336:Expr_L49_C4", "label": "save_pickle()", "type": "expression", "loc": [49, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "vector": [8, 1, 0.9018, 0.0714, 1, 0.87, 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_99336:Expr_L53_C4", "label": "SaveImage()", "type": "expression", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "vector": [8, 1, 0.9464, 0.0179, 1, 0.87, 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_99336:Expr_L54_C4", "label": "loginfo()", "type": "expression", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "vector": [8, 1, 0.9643, 0.0179, 1, 0.87, 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_99336:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:Import_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:Expr_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:Expr_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:While_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99336:While_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:Expr_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:Expr_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:Expr_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99336:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99336:Expr_L54_C4"}]
import numpy as np coefficients = np.matrix([0.00957324711798050, -0.00204106308185305, -0.0217944712296340, -0.0386045234368094, -0.0240699173047884, 0.0411301337058247, 0.144943252298100, 0.242605833505432, 0.282695778236683, 0.242605833505432, 0.144943252298100, 0.0411301337058247, -0.0240699173047884, -0.0386045234368094, -0.0217944712296340, -0.00204106308185305, 0.00957324711798050]).reshape((17,1)) num = np.matrix([5.9476, 29.7379, 59.4758, 59.4758, 29.7379, 5.9476]).reshape((6,1))/1000.0 den = np.matrix([100.0000, -208.6232, 217.3800, -121.8451, 36.7561, -4.6356]).reshape((6,1))/100.0
ajibawa-2023/Python-Code-Large/train/row_99338
4
6
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99338:Import_L1_C0", "label": "numpy import np", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.1667, 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_99338:Assign_L2_C0", "label": "coefficients = reshape()", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.1667, 0, 0.66, 0.3333, 519, 3, 1, 0, 0, 276, 10, 2], "semantic": {"name": "coefficients", "arg_names": [], "import_names": [], "rhs_call_name": "reshape", "annotation": ""}, "snippet": "coefficients = np.matrix([0.00957324711798050, -0.00204106308185305, -0.0217944712296340, -0.0386045234368094, -0.0240699173047884, 0.0411301337058247, 0.144943252298100, 0.242605833505432, 0.282695778236683, 0.242605833505432, 0.144943252298100, 0.0411301337058247, -0.0240699173047884, -0.0386045234368094, -0.0217944712296340, -0.00204106308185305, 0.00957324711798050]).reshape((17,1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99338:Assign_L4_C0", "label": "num =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.6667, 0.1667, 0, 0.66, 0.6667, 328, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "num", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "num = np.matrix([5.9476, 29.7379, 59.4758, 59.4758, 29.7379, 5.9476]).reshape((6,1))/1000.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99338:Assign_L5_C0", "label": "den =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.8333, 0.1667, 0, 0.66, 1.0, 744, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "den", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "den = np.matrix([100.0000, -208.6232, 217.3800, -121.8451, 36.7561, -4.6356]).reshape((6,1))/100.0"}]
[]
#! /usr/bin/python import numpy as np import roslib; roslib.load_manifest('hrl_clickable_world') import rospy import std_msgs.msg from hrl_clickable_world.srv import PerceiveButtons, ButtonAction, DisplayButtons from hrl_clickable_world.srv import ButtonActionRequest from hrl_clickable_world.srv import PerceiveButtonsResponse, ButtonActionResponse from pixel_2_3d.srv import Pixel23d NS_PREFIX = "/clickable_world/" class BehaviorManager: def __init__(self): self.behavior_names = rospy.get_param(NS_PREFIX + "behavior_names") self.robot_state = rospy.get_param(NS_PREFIX + "init_conditions") self.srv_prefix = rospy.get_param(NS_PREFIX + "behavior_namespace") self.percieve_buttons_sub = rospy.Subscriber(NS_PREFIX + "perceive_buttons", std_msgs.msg.Bool, self.perceive_buttons) self.display_buttons_srv = rospy.ServiceProxy(NS_PREFIX + "display_buttons", DisplayButtons) self.button_action_srv = rospy.Service(NS_PREFIX + "button_action", ButtonAction, self.on_button_press) self.pixel_2_3d_srv = rospy.ServiceProxy("/pixel_2_3d/pixel_2_3d", Pixel23d) self.behaviors = {} self.perception_srvs = {} self.action_srvs = {} self.button_types = [] for name in self.behavior_names: behavior = rospy.get_param(NS_PREFIX + name) if behavior["perception_srv"] not in self.perception_srvs: self.perception_srvs[behavior["perception_srv"]] = rospy.ServiceProxy( self.srv_prefix + behavior["perception_srv"], PerceiveButtons) if behavior["action_srv"] not in self.action_srvs: self.action_srvs[behavior["action_srv"]] = rospy.ServiceProxy( self.srv_prefix + behavior["action_srv"], ButtonAction) self.behaviors[name] = behavior def perceive_buttons(self, msg): rospy.loginfo("Perceiving buttons") self.button_types = [] cur_button_id = 1 displayed_buttons = [] for name in self.behavior_names: # check to see if preconditions satisfied preconds_satisfied = True if "preconditions" in self.behaviors[name]: for condition in self.behaviors[name]["preconditions"]: if (self.behaviors[name]["preconditions"][condition] != self.robot_state[condition]): preconds_satisfied = False if preconds_satisfied: # get the buttons for this perception rospy.loginfo("Perceiving buttons for %s" % self.behaviors[name]["perception_srv"]) try: resp = self.perception_srvs[self.behaviors[name]["perception_srv"]]() except: continue cur_buttons = resp.buttons for i, button in enumerate(cur_buttons): self.button_types.append(name) cur_buttons[i].id = cur_button_id cur_buttons[i].ns = name cur_button_id += 1 displayed_buttons.extend(cur_buttons) # tell display to show buttons self.display_buttons_srv(displayed_buttons) def on_button_press(self, req): if req.button_id == 0: return do_behav = self.behaviors[self.button_types[req.button_id-1]] self.action_srvs[do_behav["action_srv"]](req) action_success = True # TODO use result from action srv if action_success: # update robot state if "postconditions" in do_behav: for condition in do_behav["postconditions"]: self.robot_state[condition] = do_behav["postconditions"][condition] rospy.loginfo("Current State: " + str(self.robot_state)) def main(): rospy.init_node('behavior_manager') bm = BehaviorManager() rospy.spin() if __name__ == "__main__": main()
ajibawa-2023/Python-Code-Large/train/row_99341
69
98
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0306, 0.0102, 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_99341:Import_L5_C0", "label": "roslib import roslib", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.051, 0.0102, 0, 0.66, 0.0833, 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_clickable_world')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Expr_L5_C15", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.051, 0.0102, 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": "import roslib; roslib.load_manifest('hrl_clickable_world')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Import_L6_C0", "label": "rospy import rospy", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0612, 0.0102, 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_99341:Import_L7_C0", "label": "std_msgs.msg import std_msgs.msg", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0714, 0.0102, 0, 0.66, 0.3333, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["std_msgs.msg"], "rhs_call_name": "", "annotation": ""}, "snippet": "import std_msgs.msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:ImportFrom_L9_C0", "label": "from hrl_clickable_world.srv import PerceiveButtons, ButtonAction, DisplayButtons", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0918, 0.0102, 0, 0.66, 0.4167, 612, 0, 3, 0, 0, 612, 0, 0], "semantic": {"name": "hrl_clickable_world.srv", "arg_names": [], "import_names": ["PerceiveButtons", "ButtonAction", "DisplayButtons"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_clickable_world.srv import PerceiveButtons, ButtonAction, DisplayButtons"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:ImportFrom_L10_C0", "label": "from hrl_clickable_world.srv import ButtonActionRequest", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.102, 0.0102, 0, 0.66, 0.5, 612, 0, 1, 0, 0, 612, 0, 0], "semantic": {"name": "hrl_clickable_world.srv", "arg_names": [], "import_names": ["ButtonActionRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_clickable_world.srv import ButtonActionRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:ImportFrom_L11_C0", "label": "from hrl_clickable_world.srv import PerceiveButtonsResponse, ButtonActionResponse", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1122, 0.0102, 0, 0.66, 0.5833, 612, 0, 2, 0, 0, 612, 0, 0], "semantic": {"name": "hrl_clickable_world.srv", "arg_names": [], "import_names": ["PerceiveButtonsResponse", "ButtonActionResponse"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_clickable_world.srv import PerceiveButtonsResponse, ButtonActionResponse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:ImportFrom_L12_C0", "label": "from pixel_2_3d.srv import Pixel23d", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1224, 0.0102, 0, 0.66, 0.6667, 851, 0, 1, 0, 0, 851, 0, 0], "semantic": {"name": "pixel_2_3d.srv", "arg_names": [], "import_names": ["Pixel23d"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pixel_2_3d.srv import Pixel23d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L14_C0", "label": "NS_PREFIX =", "type": "assigned_variable", "loc": [14, 14], "level": 0, "parent": null, "vector": [14, 0, 0.1429, 0.0102, 0, 0.66, 0.75, 567, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "NS_PREFIX", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NS_PREFIX = \"/clickable_world/\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:ClassDef_L16_C0", "label": "BehaviorManager", "type": "class", "loc": [16, 90], "level": 0, "parent": null, "vector": [3, 0, 0.5408, 0.7653, 0, 0.66, 0.8333, 345, 0, 3, 0, 0, 0, 0, 20], "semantic": {"name": "BehaviorManager", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class BehaviorManager:\n def __init__(self):\n self.behavior_names = rospy.get_param(NS_PREFIX + \"behavior_names\")\n self.robot_state = rospy.get_param(NS_PREFIX + \"init_conditions\")\n self.srv_prefix = rospy.get_param(NS_PREFIX + \"behavior_namespace\")\n self.percieve_buttons_sub = rospy.Subscriber(NS_PREFIX + \"perceive_buttons\",\n std_msgs.msg.Bool,\n self.perceive_buttons)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "label": "__init__", "type": "function", "loc": [17, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:ClassDef_L16_C0", "vector": [2, 1, 0.3163, 0.2959, 1, 0.67, 0.0, 555, 0, 1, 0, 0, 0, 0, 10], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.behavior_names = rospy.get_param(NS_PREFIX + \"behavior_names\")\n self.robot_state = rospy.get_param(NS_PREFIX + \"init_conditions\")\n self.srv_prefix = rospy.get_param(NS_PREFIX + \"behavior_namespace\")\n self.percieve_buttons_sub = rospy.Subscriber(NS_PREFIX + \"perceive_buttons\",\n std_msgs.msg.Bool,\n self.perceive_buttons)\n self.display_buttons_srv = rospy.ServiceProxy(NS_PREFIX + \"display_buttons\","}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L18_C8", "label": "self.behavior_names = get_param()", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "vector": [14, 2, 0.1837, 0.0102, 2, 0.29, 0.0, 26, 3, 1, 0, 0, 427, 10, 1], "semantic": {"name": "self.behavior_names", "arg_names": [], "import_names": [], "rhs_call_name": "get_param", "annotation": ""}, "snippet": " self.behavior_names = rospy.get_param(NS_PREFIX + \"behavior_names\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L19_C8", "label": "self.robot_state = get_param()", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "vector": [14, 2, 0.1939, 0.0102, 2, 0.29, 0.0909, 140, 3, 1, 0, 0, 427, 10, 1], "semantic": {"name": "self.robot_state", "arg_names": [], "import_names": [], "rhs_call_name": "get_param", "annotation": ""}, "snippet": " self.robot_state = rospy.get_param(NS_PREFIX + \"init_conditions\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L20_C8", "label": "self.srv_prefix = get_param()", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "vector": [14, 2, 0.2041, 0.0102, 2, 0.29, 0.1818, 544, 3, 1, 0, 0, 427, 10, 1], "semantic": {"name": "self.srv_prefix", "arg_names": [], "import_names": [], "rhs_call_name": "get_param", "annotation": ""}, "snippet": " self.srv_prefix = rospy.get_param(NS_PREFIX + \"behavior_namespace\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L21_C8", "label": "self.percieve_buttons_sub = Subscriber()", "type": "assigned_variable", "loc": [21, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "vector": [14, 2, 0.2245, 0.0306, 2, 0.29, 0.2727, 11, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "self.percieve_buttons_sub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " self.percieve_buttons_sub = rospy.Subscriber(NS_PREFIX + \"perceive_buttons\",\n std_msgs.msg.Bool,\n self.perceive_buttons)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L24_C8", "label": "self.display_buttons_srv = ServiceProxy()", "type": "assigned_variable", "loc": [24, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "vector": [14, 2, 0.25, 0.0204, 2, 0.29, 0.3636, 973, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.display_buttons_srv", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.display_buttons_srv = rospy.ServiceProxy(NS_PREFIX + \"display_buttons\",\n DisplayButtons)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L26_C8", "label": "self.button_action_srv = Service()", "type": "assigned_variable", "loc": [26, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "vector": [14, 2, 0.2755, 0.0306, 2, 0.29, 0.4545, 948, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self.button_action_srv", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self.button_action_srv = rospy.Service(NS_PREFIX + \"button_action\",\n ButtonAction,\n self.on_button_press)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L29_C8", "label": "self.pixel_2_3d_srv = ServiceProxy()", "type": "assigned_variable", "loc": [29, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "vector": [14, 2, 0.301, 0.0204, 2, 0.29, 0.5455, 222, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.pixel_2_3d_srv", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.pixel_2_3d_srv = rospy.ServiceProxy(\"/pixel_2_3d/pixel_2_3d\",\n Pixel23d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L31_C8", "label": "self.behaviors =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "vector": [14, 2, 0.3163, 0.0102, 2, 0.29, 0.6364, 105, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.behaviors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.behaviors = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L32_C8", "label": "self.perception_srvs =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "vector": [14, 2, 0.3265, 0.0102, 2, 0.29, 0.7273, 408, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.perception_srvs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.perception_srvs = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L33_C8", "label": "self.action_srvs =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "vector": [14, 2, 0.3367, 0.0102, 2, 0.29, 0.8182, 550, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.action_srvs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.action_srvs = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L34_C8", "label": "self.button_types =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "vector": [14, 2, 0.3469, 0.0102, 2, 0.29, 0.9091, 168, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.button_types", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.button_types = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L35_C8", "label": "for name", "type": "for", "loc": [35, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "vector": [6, 2, 0.4082, 0.1122, 2, 0.29, 1.0, 57, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in self.behavior_names:\n behavior = rospy.get_param(NS_PREFIX + name)\n if behavior[\"perception_srv\"] not in self.perception_srvs:\n self.perception_srvs[behavior[\"perception_srv\"]] = rospy.ServiceProxy(\n self.srv_prefix + behavior[\"perception_srv\"], \n PerceiveButtons)\n if behavior[\"action_srv\"] not in self.action_srvs:\n self.action_srvs[behavior[\"action_srv\"]] = rospy.ServiceProxy("}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L36_C12", "label": "behavior = get_param()", "type": "assigned_variable", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L35_C8", "vector": [14, 3, 0.3673, 0.0102, 3, 0.1, 0.0, 122, 3, 1, 0, 0, 427, 10, 1], "semantic": {"name": "behavior", "arg_names": [], "import_names": [], "rhs_call_name": "get_param", "annotation": ""}, "snippet": " behavior = rospy.get_param(NS_PREFIX + name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L37_C12", "label": "if", "type": "if", "loc": [37, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L35_C8", "vector": [4, 3, 0.3929, 0.0408, 3, 0.1, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if behavior[\"perception_srv\"] not in self.perception_srvs:\n self.perception_srvs[behavior[\"perception_srv\"]] = rospy.ServiceProxy(\n self.srv_prefix + behavior[\"perception_srv\"], \n PerceiveButtons)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L38_C16", "label": " = ServiceProxy()", "type": "assigned_variable", "loc": [38, 40], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L37_C12", "vector": [14, 4, 0.398, 0.0306, 4, 0.64, 0.0, 0, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.perception_srvs[behavior[\"perception_srv\"]] = rospy.ServiceProxy(\n self.srv_prefix + behavior[\"perception_srv\"], \n PerceiveButtons)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L41_C12", "label": "if", "type": "if", "loc": [41, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L35_C8", "vector": [4, 3, 0.4337, 0.0408, 3, 0.1, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if behavior[\"action_srv\"] not in self.action_srvs:\n self.action_srvs[behavior[\"action_srv\"]] = rospy.ServiceProxy(\n self.srv_prefix + behavior[\"action_srv\"], \n ButtonAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L42_C16", "label": " = ServiceProxy()", "type": "assigned_variable", "loc": [42, 44], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L41_C12", "vector": [14, 4, 0.4388, 0.0306, 4, 0.02, 0.0, 0, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.action_srvs[behavior[\"action_srv\"]] = rospy.ServiceProxy(\n self.srv_prefix + behavior[\"action_srv\"], \n ButtonAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L45_C12", "label": "assign", "type": "assigned_variable", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L35_C8", "vector": [14, 3, 0.4592, 0.0102, 3, 0.1, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.behaviors[name] = behavior"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L47_C4", "label": "perceive_buttons", "type": "function", "loc": [47, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:ClassDef_L16_C0", "vector": [2, 1, 0.6276, 0.3061, 1, 0.67, 0.5, 181, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "perceive_buttons", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def perceive_buttons(self, msg):\n rospy.loginfo(\"Perceiving buttons\")\n self.button_types = []\n cur_button_id = 1\n displayed_buttons = []\n for name in self.behavior_names:\n # check to see if preconditions satisfied\n preconds_satisfied = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Expr_L48_C8", "label": "loginfo()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L47_C4", "vector": [8, 2, 0.4898, 0.0102, 2, 0.53, 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(\"Perceiving buttons\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L49_C8", "label": "self.button_types =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L47_C4", "vector": [14, 2, 0.5, 0.0102, 2, 0.53, 0.2, 168, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.button_types", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.button_types = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L50_C8", "label": "cur_button_id =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L47_C4", "vector": [14, 2, 0.5102, 0.0102, 2, 0.53, 0.4, 179, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "cur_button_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cur_button_id = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L51_C8", "label": "displayed_buttons =", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L47_C4", "vector": [14, 2, 0.5204, 0.0102, 2, 0.53, 0.6, 173, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "displayed_buttons", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " displayed_buttons = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L52_C8", "label": "for name", "type": "for", "loc": [52, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L47_C4", "vector": [6, 2, 0.6429, 0.2347, 2, 0.53, 0.8, 57, 7, 0, 0, 0, 0, 0, 5], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in self.behavior_names:\n # check to see if preconditions satisfied\n preconds_satisfied = True\n if \"preconditions\" in self.behaviors[name]:\n for condition in self.behaviors[name][\"preconditions\"]:\n if (self.behaviors[name][\"preconditions\"][condition] != \n self.robot_state[condition]):\n preconds_satisfied = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L54_C12", "label": "preconds_satisfied =", "type": "assigned_variable", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L52_C8", "vector": [14, 3, 0.551, 0.0102, 3, 0.57, 0.0, 583, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "preconds_satisfied", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " preconds_satisfied = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L55_C12", "label": "if", "type": "if", "loc": [55, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L52_C8", "vector": [4, 3, 0.5816, 0.051, 3, 0.57, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if \"preconditions\" in self.behaviors[name]:\n for condition in self.behaviors[name][\"preconditions\"]:\n if (self.behaviors[name][\"preconditions\"][condition] != \n self.robot_state[condition]):\n preconds_satisfied = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L56_C16", "label": "for condition", "type": "for", "loc": [56, 59], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L55_C12", "vector": [6, 4, 0.5867, 0.0408, 4, 0.53, 0.0, 803, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "condition", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for condition in self.behaviors[name][\"preconditions\"]:\n if (self.behaviors[name][\"preconditions\"][condition] != \n self.robot_state[condition]):\n preconds_satisfied = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L57_C20", "label": "if", "type": "if", "loc": [57, 59], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L56_C16", "vector": [4, 5, 0.5918, 0.0306, 5, 0.55, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.behaviors[name][\"preconditions\"][condition] != \n self.robot_state[condition]):\n preconds_satisfied = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L59_C24", "label": "preconds_satisfied =", "type": "assigned_variable", "loc": [59, 59], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L57_C20", "vector": [14, 6, 0.602, 0.0102, 6, 0.31, 0.0, 583, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "preconds_satisfied", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " preconds_satisfied = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L61_C12", "label": "if", "type": "if", "loc": [61, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L52_C8", "vector": [4, 3, 0.6888, 0.1429, 3, 0.57, 1.0, 0, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if preconds_satisfied:\n # get the buttons for this perception\n rospy.loginfo(\"Perceiving buttons for %s\" % self.behaviors[name][\"perception_srv\"])\n try:\n resp = self.perception_srvs[self.behaviors[name][\"perception_srv\"]]()\n except:\n continue\n cur_buttons = resp.buttons"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Expr_L63_C16", "label": "loginfo()", "type": "expression", "loc": [63, 63], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L61_C12", "vector": [8, 4, 0.6429, 0.0102, 4, 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(\"Perceiving buttons for %s\" % self.behaviors[name][\"perception_srv\"])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Try_L64_C16", "label": "try", "type": "try", "loc": [64, 67], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L61_C12", "vector": [7, 4, 0.6684, 0.0408, 4, 0.24, 0.25, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n resp = self.perception_srvs[self.behaviors[name][\"perception_srv\"]]()\n except:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L65_C20", "label": "resp =", "type": "assigned_variable", "loc": [65, 65], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:Try_L64_C16", "vector": [14, 5, 0.6633, 0.0102, 5, 0.68, 0.0, 48, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resp = self.perception_srvs[self.behaviors[name][\"perception_srv\"]]()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L68_C16", "label": "cur_buttons =", "type": "assigned_variable", "loc": [68, 68], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L61_C12", "vector": [14, 4, 0.6939, 0.0102, 4, 0.24, 0.5, 202, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cur_buttons", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cur_buttons = resp.buttons"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L69_C16", "label": "for i, button", "type": "for", "loc": [69, 73], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L61_C12", "vector": [6, 4, 0.7245, 0.051, 4, 0.24, 0.75, 722, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i, button", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, button in enumerate(cur_buttons):\n self.button_types.append(name)\n cur_buttons[i].id = cur_button_id\n cur_buttons[i].ns = name\n cur_button_id += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Expr_L70_C20", "label": "append()", "type": "expression", "loc": [70, 70], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L69_C16", "vector": [8, 5, 0.7143, 0.0102, 5, 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": " self.button_types.append(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L71_C20", "label": "cur_buttons[i].id =", "type": "assigned_variable", "loc": [71, 71], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L69_C16", "vector": [14, 5, 0.7245, 0.0102, 5, 0.11, 0.5, 942, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cur_buttons[i].id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cur_buttons[i].id = cur_button_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L72_C20", "label": "cur_buttons[i].ns =", "type": "assigned_variable", "loc": [72, 72], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L69_C16", "vector": [14, 5, 0.7347, 0.0102, 5, 0.11, 1.0, 200, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cur_buttons[i].ns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cur_buttons[i].ns = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Expr_L74_C16", "label": "extend()", "type": "expression", "loc": [74, 74], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L61_C12", "vector": [8, 4, 0.7551, 0.0102, 4, 0.24, 1.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " displayed_buttons.extend(cur_buttons)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Expr_L76_C8", "label": "display_buttons_srv()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L47_C4", "vector": [8, 2, 0.7755, 0.0102, 2, 0.53, 1.0, 654, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "display_buttons_srv", "arg_names": [], "import_names": [], "rhs_call_name": "display_buttons_srv", "annotation": ""}, "snippet": " self.display_buttons_srv(displayed_buttons)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L78_C4", "label": "on_button_press", "type": "function", "loc": [78, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:ClassDef_L16_C0", "vector": [2, 1, 0.8571, 0.1327, 1, 0.67, 1.0, 716, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "on_button_press", "arg_names": ["self", "req"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def on_button_press(self, req):\n if req.button_id == 0:\n return\n do_behav = self.behaviors[self.button_types[req.button_id-1]]\n self.action_srvs[do_behav[\"action_srv\"]](req)\n action_success = True\n # TODO use result from action srv\n if action_success:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L79_C8", "label": "if", "type": "if", "loc": [79, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L78_C4", "vector": [4, 2, 0.8112, 0.0204, 2, 0.02, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if req.button_id == 0:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Return_L80_C12", "label": "return", "type": "return", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L79_C8", "vector": [13, 3, 0.8163, 0.0102, 3, 0.69, 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_99341:Assign_L81_C8", "label": "do_behav =", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L78_C4", "vector": [14, 2, 0.8265, 0.0102, 2, 0.02, 0.2, 293, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "do_behav", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " do_behav = self.behaviors[self.button_types[req.button_id-1]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Expr_L82_C8", "label": "expression", "type": "expression", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L78_C4", "vector": [8, 2, 0.8367, 0.0102, 2, 0.02, 0.4, 0, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.action_srvs[do_behav[\"action_srv\"]](req)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L83_C8", "label": "action_success =", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L78_C4", "vector": [14, 2, 0.8469, 0.0102, 2, 0.02, 0.6, 245, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "action_success", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " action_success = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L85_C8", "label": "if", "type": "if", "loc": [85, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L78_C4", "vector": [4, 2, 0.8878, 0.051, 2, 0.02, 0.8, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if action_success:\n # update robot state\n if \"postconditions\" in do_behav:\n for condition in do_behav[\"postconditions\"]:\n self.robot_state[condition] = do_behav[\"postconditions\"][condition]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L87_C12", "label": "if", "type": "if", "loc": [87, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L85_C8", "vector": [4, 3, 0.898, 0.0306, 3, 0.69, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if \"postconditions\" in do_behav:\n for condition in do_behav[\"postconditions\"]:\n self.robot_state[condition] = do_behav[\"postconditions\"][condition]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L88_C16", "label": "for condition", "type": "for", "loc": [88, 89], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L87_C12", "vector": [6, 4, 0.9031, 0.0204, 4, 0.28, 0.0, 803, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "condition", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for condition in do_behav[\"postconditions\"]:\n self.robot_state[condition] = do_behav[\"postconditions\"][condition]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L89_C20", "label": "assign", "type": "assigned_variable", "loc": [89, 89], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L88_C16", "vector": [14, 5, 0.9082, 0.0102, 5, 0.92, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.robot_state[condition] = do_behav[\"postconditions\"][condition]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Expr_L90_C8", "label": "loginfo()", "type": "expression", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L78_C4", "vector": [8, 2, 0.9184, 0.0102, 2, 0.02, 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(\"Current State: \" + str(self.robot_state))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L92_C0", "label": "main", "type": "function", "loc": [92, 95], "level": 0, "parent": null, "vector": [2, 0, 0.9541, 0.0408, 0, 0.66, 0.9167, 624, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n rospy.init_node('behavior_manager')\n bm = BehaviorManager()\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Expr_L93_C4", "label": "init_node()", "type": "expression", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L92_C0", "vector": [8, 1, 0.949, 0.0102, 1, 0.05, 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('behavior_manager')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L94_C4", "label": "bm = BehaviorManager()", "type": "assigned_variable", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L92_C0", "vector": [14, 1, 0.9592, 0.0102, 1, 0.05, 0.5, 881, 3, 0, 0, 0, 345, 10, 1], "semantic": {"name": "bm", "arg_names": [], "import_names": [], "rhs_call_name": "BehaviorManager", "annotation": ""}, "snippet": " bm = BehaviorManager()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Expr_L95_C4", "label": "spin()", "type": "expression", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L92_C0", "vector": [8, 1, 0.9694, 0.0102, 1, 0.05, 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_99341:If_L97_C0", "label": "if", "type": "if", "loc": [97, 98], "level": 0, "parent": null, "vector": [4, 0, 0.9949, 0.0204, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99341:Expr_L98_C4", "label": "main()", "type": "expression", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L97_C0", "vector": [8, 1, 1.0, 0.0102, 1, 0.91, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99341:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L35_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L35_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L37_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L38_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L35_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L41_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L42_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L35_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L55_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L56_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L56_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L57_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L57_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L59_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L61_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Expr_L63_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L61_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Try_L64_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:Try_L64_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L65_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L61_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L68_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L61_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L69_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L69_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Expr_L70_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L69_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L71_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L69_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L72_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L61_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Expr_L74_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Return_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Expr_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L85_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L87_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L88_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:For_L88_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L89_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Expr_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Expr_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Assign_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Expr_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99341:If_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99341:Expr_L98_C4"}]
import numpy as np import roslib; roslib.load_manifest('pr2_grasp_behaviors') import rospy from std_msgs.msg import String, Bool import std_srvs.srv from tf.transformations import * import object_manipulator.convert_functions as cf from hrl_pr2_lib.hrl_controller_manager import HRLControllerManager as ControllerManager from pr2_collision_monitor.srv import JointDetectionStart, ArmMovingWait from pr2_grasp_behaviors.grasp_behavior_server import GraspStates ## # Abstract class for a grasping behavior. Implements much of the framework for # a generic behavior-based grasp and provides virtual template functions for specific # behaviors to override. class GraspBehavior(object): def __init__(self, arm, use_coll_detection=False): self.arm = arm self.use_coll_detection = use_coll_detection self.GRIPPER_POINT = np.array([0.23, 0.0, 0.0]) self.cm = ControllerManager(self.arm) class CollisionState: def __init__(self): self.collided = False def callback(self, msg): if msg.data: self.collided = True self.coll_state = CollisionState() if self.use_coll_detection: rospy.loginfo("Waiting for start_detection") rospy.wait_for_service(self.arm + '_joint_coll_detect/start_detection') self.start_detection = rospy.ServiceProxy(self.arm + '_joint_coll_detect/start_detection', JointDetectionStart, persistent=True) rospy.loginfo("Waiting for stop_detection") rospy.wait_for_service(self.arm + '_joint_coll_detect/stop_detection') self.stop_detection = rospy.ServiceProxy(self.arm + '_joint_coll_detect/stop_detection', std_srvs.srv.Empty, persistent=True) self.stop_detection() rospy.Subscriber(self.arm + "_joint_coll_detect/arm_collision_detected", Bool, self.coll_state.callback) rospy.loginfo("Waiting for arm_moving_wait") rospy.wait_for_service(self.arm + '_arm_moving_server/arm_moving_wait') self.arm_moving_wait = rospy.ServiceProxy(self.arm + '_arm_moving_server/arm_moving_wait', ArmMovingWait, persistent=True) rospy.loginfo("[grasp_manager] GraspBehavior loaded.") ################################################################################ # virtual functions to be implemented by specific grasp ## # Move arm to preparatory pose def grasp_preparation_move(self): rospy.logerr("UNIMPLEMENTED!") ## # Move arm to grasp setup, just before approach. def grasp_setup_move(self, params): rospy.logerr("UNIMPLEMENTED!") ## # Execute the grasping arm motion def execute_approach(self, block): rospy.logerr("UNIMPLEMENTED!") ## # Generate a random behavior parameterization for sampling # the workspace of possible grasps def random_generator(self): rospy.logerr("UNIMPLEMENTED!") ## # Attempt to slightly adjust grasp parameters to get a close configuration # which will hopefully find an IK solution. def jiggle_grasp_params(self, grasp_params): return grasp_params ################################################################################ ## # Transforms the given position by the offset position in the given quaternion # rotation frame def transform_in_frame(self, pos, quat, off_point): quatmat = np.mat(quaternion_matrix(quat)) quatmat[0:3,3] = np.mat(pos).T trans = np.matrix([off_point[0],off_point[1],off_point[2],1.]).T transpos = quatmat * trans return transpos.T.A[0,0:3] ## # Returns same gripper rotation normalized to [0, pi) range. def normalize_rot(self, gripper_rot): while gripper_rot >= np.pi: gripper_rot -= np.pi while gripper_rot < 0.: gripper_rot += np.pi return gripper_rot ## # Creates a PoseStamped in the torso_lift_link frame def create_goal_pose(self, x, y, z, gripper_pose): point = [x, y, z] point = self.transform_in_frame(point, gripper_pose, -self.GRIPPER_POINT).tolist() pose = point + gripper_pose.tolist() goal_pose = cf.create_pose_stamped(pose, "torso_lift_link") goal_pose.header.stamp = rospy.Time.now() return goal_pose ## # Returns the position of the end effector def get_end_effector_pos(self): wrist_pose = self.cm.get_current_wrist_pose_stamped("torso_lift_link") p = wrist_pose.pose.position o = wrist_pose.pose.orientation affector_pos = self.transform_in_frame([p.x, p.y, p.z], [o.x, o.y, o.z, o.w], self.GRIPPER_POINT) return affector_pos ## # Takes special care to kill the arm's movement by canceling # the action client and accounting for some edge cases. def kill_arm_movement(self): rospy.loginfo("Killing arm movement") self.cm.joint_action_client.cancel_all_goals() rospy.sleep(0.01) # Needed for lag time in the case that the collision occurs # before the action is dispatched and due to the fact that # the arm doesn't necessarily respond the first time while not self.cm.check_joint_trajectory_done(): self.cm.joint_action_client.cancel_all_goals() rospy.sleep(0.01) if rospy.is_shutdown(): self.cm.joint_action_client.cancel_all_goals() ## # Readys arm for grasp motion. def stage_grasp(self, grasp_params, open_gripper=True): rospy.loginfo("Staging grasp motion") self.grasp_setup_move(grasp_params) if open_gripper: # open gripper rospy.loginfo("Opening gripper") self.cm.command_gripper(1.00, -1.0, False) self.cm.gripper_action_client.wait_for_result(rospy.Duration(2.0)) self.cm.wait_joint_trajectory_done() ## # Performs motion where arm approaches object def grasp_approach_motion(self, coll_detect=False, behavior_name="", sig_level=0.99): # move arm down rospy.loginfo("Moving arm down") startt = rospy.Time.now().to_sec() if coll_detect: self.start_detection(behavior_name, sig_level) result = self.execute_approach(False) if result == "no solution": # break without completing the grasp #self.apm.end_collision_detection() if coll_detect: self.stop_detection() return "no solution" # grasp motion should be successful and moving now # wait until the trajectory is complete. # this loop will not exit until the arm has stopped moving while not self.cm.check_joint_trajectory_done(): if rospy.is_shutdown(): self.kill_arm_movement() return "shutdown" if self.coll_state.collided: self.kill_arm_movement() break rospy.sleep(0.005) if coll_detect: self.stop_detection() if self.coll_state.collided and coll_detect: grasp_result = "Collision" else: grasp_result = "No collision" self.coll_state.collided = False endt = rospy.Time.now().to_sec() rospy.loginfo("Grasp duration: %f", endt - startt) rospy.loginfo("Finished moving arm") return grasp_result ## # Gripper graping action def grasping_action(self): rospy.loginfo("Closing gripper") self.cm.command_gripper(0.0, 30.0, True) rospy.loginfo("Gripper closed") ## # Gripper placing action def placing_action(self): rospy.loginfo("Opening gripper") self.cm.command_gripper(1.00, -1.0, False) rospy.sleep(0.5) rospy.loginfo("Gripper opened") ## # Performs full grasping behavior. # # @param grasp_params A tuple containing the parameters for the behavior. # @param is_place If False, perform a grasp. If True, perform a place. # @param collide Whether or not we should detect for collisions. # @param data_collecting If True, only perform the approach motion and return after that. # @param num_jiggle How many times the parameters should be jiggled before giving up # @param publish_state Callback function which takes a string and publishes the current state # @return grasp_result Result of grasp. def perform_grasp(self, grasp_params, is_place=False, collide=True, behavior_name="", sig_level=0.99, data_collecting=False, num_jiggle=2, publish_state=lambda x: x): self.collide = collide rospy.loginfo("Performing grasp with parameters: " + str(grasp_params)) iters = 0 while not rospy.is_shutdown(): # Move to grasp position publish_state(GraspStates.GRASP_SETUP_MOVE) self.stage_grasp(grasp_params, not is_place) self.arm_moving_wait(True, 3.0) # Wait for the arm to stop moving publish_state(GraspStates.EXECUTE_APPROACH) approach_result = self.grasp_approach_motion(self.use_coll_detection and self.collide, behavior_name=behavior_name, sig_level=sig_level) rospy.sleep(0.1) if approach_result != "no solution": break else: if num_jiggle == 0: rospy.loginfo("Interpolated IK failed, cannot perform grasp for x = %1.2f, y = %1.2f, rot = %1.2f" % (x, y, gripper_rot)) return "IK failure" rospy.loginfo("Interpolated IK failed, jiggling configuration for nearby trajectory") # Jiggle it to see if it works grasp_params = self.jiggle_grasp_params(grasp_params) iters += 1 # Tried too many times if iters >= num_jiggle: rospy.loginfo("Cannot find IK solution") return "IK failure" else: continue if data_collecting: return "Grasp motion success" if approach_result == "Collision": if not is_place: publish_state(GraspStates.GRASP_OBJECT) self.grasping_action() else: self.placing_action() if not is_place: rospy.loginfo("Picking object up") else: rospy.loginfo("Pulling arm away") publish_state(GraspStates.EXECUTE_RETREAT) self.execute_retreat() ################################################################################ # determine return result self.arm_moving_wait(True, 3.0) # Wait for the arm to stop moving if approach_result == "Collision": if not is_place: if self.is_obj_in_gripper(): grasp_result = "Object grasped" else: grasp_result = "Object missed" else: grasp_result = "Object placed" else: if not is_place: grasp_result = "No collision for grasp" else: if self.is_obj_in_gripper(): grasp_result = "No collision for place" else: grasp_result = "Object dropped before place" ################################################################################ rospy.loginfo("Grasp result: %s" % grasp_result) rospy.loginfo("Grasp complete!") return grasp_result ## # Checks to see if anything is in the gripper currently (gripper is not fully closed). def is_obj_in_gripper(self): last_opening = self.cm.get_current_gripper_opening() while not rospy.is_shutdown(): rospy.sleep(0.2) next_opening = self.cm.get_current_gripper_opening() print next_opening if abs(last_opening - next_opening) < 0.001: break last_opening = next_opening return self.cm.get_current_gripper_opening() > 0.01
ajibawa-2023/Python-Code-Large/train/row_99342
179
298
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Import_L1_C0", "label": "numpy import np", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0034, 0.0034, 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_99342:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0101, 0.0034, 0, 0.66, 0.0909, 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('pr2_grasp_behaviors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L3_C15", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0101, 0.0034, 0, 0.66, 0.1818, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('pr2_grasp_behaviors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0134, 0.0034, 0, 0.66, 0.2727, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:ImportFrom_L5_C0", "label": "from std_msgs.msg import String, Bool", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0168, 0.0034, 0, 0.66, 0.3636, 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_99342:Import_L6_C0", "label": "std_srvs.srv import std_srvs.srv", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0201, 0.0034, 0, 0.66, 0.4545, 261, 0, 1, 0, 0, 261, 0, 0], "semantic": {"name": "std_srvs.srv", "arg_names": [], "import_names": ["std_srvs.srv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import std_srvs.srv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:ImportFrom_L7_C0", "label": "from tf.transformations import *", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0235, 0.0034, 0, 0.66, 0.5455, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from tf.transformations import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Import_L8_C0", "label": "object_manipulator.convert_functions import cf", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0268, 0.0034, 0, 0.66, 0.6364, 7, 0, 1, 0, 0, 7, 0, 0], "semantic": {"name": "object_manipulator.convert_functions", "arg_names": [], "import_names": ["cf"], "rhs_call_name": "", "annotation": ""}, "snippet": "import object_manipulator.convert_functions as cf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:ImportFrom_L10_C0", "label": "from hrl_pr2_lib.hrl_controller_manager import ControllerManager", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0336, 0.0034, 0, 0.66, 0.7273, 22, 0, 1, 0, 0, 22, 0, 0], "semantic": {"name": "hrl_pr2_lib.hrl_controller_manager", "arg_names": [], "import_names": ["ControllerManager"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_pr2_lib.hrl_controller_manager import HRLControllerManager as ControllerManager"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:ImportFrom_L11_C0", "label": "from pr2_collision_monitor.srv import JointDetectionStart, ArmMovingWait", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0369, 0.0034, 0, 0.66, 0.8182, 128, 0, 2, 0, 0, 128, 0, 0], "semantic": {"name": "pr2_collision_monitor.srv", "arg_names": [], "import_names": ["JointDetectionStart", "ArmMovingWait"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_collision_monitor.srv import JointDetectionStart, ArmMovingWait"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:ImportFrom_L12_C0", "label": "from pr2_grasp_behaviors.grasp_behavior_server import GraspStates", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0403, 0.0034, 0, 0.66, 0.9091, 655, 0, 1, 0, 0, 655, 0, 0], "semantic": {"name": "pr2_grasp_behaviors.grasp_behavior_server", "arg_names": [], "import_names": ["GraspStates"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_grasp_behaviors.grasp_behavior_server import GraspStates"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "label": "GraspBehavior", "type": "class", "loc": [18, 297], "level": 0, "parent": null, "vector": [3, 0, 0.5285, 0.9396, 0, 0.66, 1.0, 198, 0, 19, 0, 0, 186, 0, 99], "semantic": {"name": "GraspBehavior", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class GraspBehavior(object):\n def __init__(self, arm, use_coll_detection=False):\n self.arm = arm\n self.use_coll_detection = use_coll_detection\n self.GRIPPER_POINT = np.array([0.23, 0.0, 0.0])\n\n self.cm = ControllerManager(self.arm)\n class CollisionState:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L19_C4", "label": "__init__", "type": "function", "loc": [19, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "vector": [2, 1, 0.1091, 0.094, 1, 0.6, 0.0, 555, 0, 3, 0, 0, 0, 0, 15], "semantic": {"name": "__init__", "arg_names": ["self", "arm", "use_coll_detection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arm, use_coll_detection=False):\n self.arm = arm\n self.use_coll_detection = use_coll_detection\n self.GRIPPER_POINT = np.array([0.23, 0.0, 0.0])\n\n self.cm = ControllerManager(self.arm)\n class CollisionState:\n def __init__(self):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L20_C8", "label": "self.arm =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L19_C4", "vector": [14, 2, 0.0671, 0.0034, 2, 0.98, 0.0, 720, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm = arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L21_C8", "label": "self.use_coll_detection =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L19_C4", "vector": [14, 2, 0.0705, 0.0034, 2, 0.98, 0.1, 652, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.use_coll_detection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.use_coll_detection = use_coll_detection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L22_C8", "label": "self.GRIPPER_POINT = array()", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L19_C4", "vector": [14, 2, 0.0738, 0.0034, 2, 0.98, 0.2, 406, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "self.GRIPPER_POINT", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " self.GRIPPER_POINT = np.array([0.23, 0.0, 0.0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L24_C8", "label": "self.cm = ControllerManager()", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L19_C4", "vector": [14, 2, 0.0805, 0.0034, 2, 0.98, 0.3, 436, 3, 1, 0, 0, 16, 10, 1], "semantic": {"name": "self.cm", "arg_names": [], "import_names": [], "rhs_call_name": "ControllerManager", "annotation": ""}, "snippet": " self.cm = ControllerManager(self.arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L25_C8", "label": "CollisionState", "type": "class", "loc": [25, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L19_C4", "vector": [3, 2, 0.0923, 0.0201, 2, 0.98, 0.4, 623, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "CollisionState", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class CollisionState:\n def __init__(self):\n self.collided = False\n def callback(self, msg):\n if msg.data:\n self.collided = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L26_C12", "label": "__init__", "type": "function", "loc": [26, 27], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L25_C8", "vector": [2, 3, 0.0889, 0.0067, 3, 0.96, 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.collided = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L27_C16", "label": "self.collided =", "type": "assigned_variable", "loc": [27, 27], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L26_C12", "vector": [14, 4, 0.0906, 0.0034, 4, 0.24, 0.0, 80, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.collided", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.collided = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L28_C12", "label": "callback", "type": "function", "loc": [28, 30], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L25_C8", "vector": [2, 3, 0.0973, 0.0101, 3, 0.96, 1.0, 342, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "callback", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def callback(self, msg):\n if msg.data:\n self.collided = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L29_C16", "label": "if", "type": "if", "loc": [29, 30], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L28_C12", "vector": [4, 4, 0.099, 0.0067, 4, 0.86, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg.data:\n self.collided = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L30_C20", "label": "self.collided =", "type": "assigned_variable", "loc": [30, 30], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L29_C16", "vector": [14, 5, 0.1007, 0.0034, 5, 0.86, 0.0, 80, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.collided", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.collided = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L31_C8", "label": "self.coll_state = CollisionState()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L19_C4", "vector": [14, 2, 0.104, 0.0034, 2, 0.98, 0.5, 923, 3, 0, 0, 0, 623, 10, 1], "semantic": {"name": "self.coll_state", "arg_names": [], "import_names": [], "rhs_call_name": "CollisionState", "annotation": ""}, "snippet": " self.coll_state = CollisionState()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L32_C8", "label": "if", "type": "if", "loc": [32, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L19_C4", "vector": [4, 2, 0.1208, 0.0302, 2, 0.98, 0.6, 0, 7, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.use_coll_detection:\n rospy.loginfo(\"Waiting for start_detection\")\n rospy.wait_for_service(self.arm + '_joint_coll_detect/start_detection')\n self.start_detection = rospy.ServiceProxy(self.arm + '_joint_coll_detect/start_detection', JointDetectionStart, persistent=True)\n rospy.loginfo(\"Waiting for stop_detection\")\n rospy.wait_for_service(self.arm + '_joint_coll_detect/stop_detection')\n self.stop_detection = rospy.ServiceProxy(self.arm + '_joint_coll_detect/stop_detection', std_srvs.srv.Empty, persistent=True)\n self.stop_detection()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L33_C12", "label": "loginfo()", "type": "expression", "loc": [33, 33], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L32_C8", "vector": [8, 3, 0.1107, 0.0034, 3, 0.56, 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(\"Waiting for start_detection\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L34_C12", "label": "wait_for_service()", "type": "expression", "loc": [34, 34], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L32_C8", "vector": [8, 3, 0.1141, 0.0034, 3, 0.56, 0.1429, 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(self.arm + '_joint_coll_detect/start_detection')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L35_C12", "label": "self.start_detection = ServiceProxy()", "type": "assigned_variable", "loc": [35, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L32_C8", "vector": [14, 3, 0.1174, 0.0034, 3, 0.56, 0.2857, 889, 3, 3, 0, 0, 915, 10, 1], "semantic": {"name": "self.start_detection", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.start_detection = rospy.ServiceProxy(self.arm + '_joint_coll_detect/start_detection', JointDetectionStart, persistent=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L36_C12", "label": "loginfo()", "type": "expression", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L32_C8", "vector": [8, 3, 0.1208, 0.0034, 3, 0.56, 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(\"Waiting for stop_detection\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L37_C12", "label": "wait_for_service()", "type": "expression", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L32_C8", "vector": [8, 3, 0.1242, 0.0034, 3, 0.56, 0.5714, 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(self.arm + '_joint_coll_detect/stop_detection')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L38_C12", "label": "self.stop_detection = ServiceProxy()", "type": "assigned_variable", "loc": [38, 38], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L32_C8", "vector": [14, 3, 0.1275, 0.0034, 3, 0.56, 0.7143, 196, 3, 3, 0, 0, 915, 10, 1], "semantic": {"name": "self.stop_detection", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.stop_detection = rospy.ServiceProxy(self.arm + '_joint_coll_detect/stop_detection', std_srvs.srv.Empty, persistent=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L39_C12", "label": "stop_detection()", "type": "expression", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L32_C8", "vector": [8, 3, 0.1309, 0.0034, 3, 0.56, 0.8571, 642, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop_detection", "arg_names": [], "import_names": [], "rhs_call_name": "stop_detection", "annotation": ""}, "snippet": " self.stop_detection()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L40_C12", "label": "Subscriber()", "type": "expression", "loc": [40, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L32_C8", "vector": [8, 3, 0.1342, 0.0034, 3, 0.56, 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(self.arm + \"_joint_coll_detect/arm_collision_detected\", Bool, self.coll_state.callback)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L42_C8", "label": "loginfo()", "type": "expression", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L19_C4", "vector": [8, 2, 0.1409, 0.0034, 2, 0.98, 0.7, 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 arm_moving_wait\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L43_C8", "label": "wait_for_service()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L19_C4", "vector": [8, 2, 0.1443, 0.0034, 2, 0.98, 0.8, 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(self.arm + '_arm_moving_server/arm_moving_wait')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L44_C8", "label": "self.arm_moving_wait = ServiceProxy()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L19_C4", "vector": [14, 2, 0.1477, 0.0034, 2, 0.98, 0.9, 790, 3, 3, 0, 0, 915, 10, 1], "semantic": {"name": "self.arm_moving_wait", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.arm_moving_wait = rospy.ServiceProxy(self.arm + '_arm_moving_server/arm_moving_wait', ArmMovingWait, persistent=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L46_C8", "label": "loginfo()", "type": "expression", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L19_C4", "vector": [8, 2, 0.1544, 0.0034, 2, 0.98, 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(\"[grasp_manager] GraspBehavior loaded.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L53_C4", "label": "grasp_preparation_move", "type": "function", "loc": [53, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "vector": [2, 1, 0.1795, 0.0067, 1, 0.6, 0.0625, 292, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "grasp_preparation_move", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def grasp_preparation_move(self):\n rospy.logerr(\"UNIMPLEMENTED!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L54_C8", "label": "logerr()", "type": "expression", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L53_C4", "vector": [8, 2, 0.1812, 0.0034, 2, 0.16, 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(\"UNIMPLEMENTED!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L57_C4", "label": "grasp_setup_move", "type": "function", "loc": [57, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "vector": [2, 1, 0.193, 0.0067, 1, 0.6, 0.125, 993, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "grasp_setup_move", "arg_names": ["self", "params"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def grasp_setup_move(self, params):\n rospy.logerr(\"UNIMPLEMENTED!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L58_C8", "label": "logerr()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L57_C4", "vector": [8, 2, 0.1946, 0.0034, 2, 0.1, 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(\"UNIMPLEMENTED!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L61_C4", "label": "execute_approach", "type": "function", "loc": [61, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "vector": [2, 1, 0.2064, 0.0067, 1, 0.6, 0.1875, 414, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "execute_approach", "arg_names": ["self", "block"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute_approach(self, block):\n rospy.logerr(\"UNIMPLEMENTED!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L62_C8", "label": "logerr()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L61_C4", "vector": [8, 2, 0.2081, 0.0034, 2, 0.75, 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(\"UNIMPLEMENTED!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L66_C4", "label": "random_generator", "type": "function", "loc": [66, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "vector": [2, 1, 0.2232, 0.0067, 1, 0.6, 0.25, 425, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "random_generator", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def random_generator(self):\n rospy.logerr(\"UNIMPLEMENTED!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L67_C8", "label": "logerr()", "type": "expression", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L66_C4", "vector": [8, 2, 0.2248, 0.0034, 2, 0.57, 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(\"UNIMPLEMENTED!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L71_C4", "label": "jiggle_grasp_params", "type": "function", "loc": [71, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "vector": [2, 1, 0.2399, 0.0067, 1, 0.6, 0.3125, 601, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "jiggle_grasp_params", "arg_names": ["self", "grasp_params"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def jiggle_grasp_params(self, grasp_params):\n return grasp_params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L72_C8", "label": "return", "type": "return", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L71_C4", "vector": [13, 2, 0.2416, 0.0034, 2, 0.81, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return grasp_params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L79_C4", "label": "transform_in_frame", "type": "function", "loc": [79, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "vector": [2, 1, 0.2735, 0.0201, 1, 0.6, 0.375, 114, 0, 4, 1, 0, 0, 0, 4], "semantic": {"name": "transform_in_frame", "arg_names": ["self", "pos", "quat", "off_point"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def transform_in_frame(self, pos, quat, off_point):\n quatmat = np.mat(quaternion_matrix(quat))\n quatmat[0:3,3] = np.mat(pos).T\n trans = np.matrix([off_point[0],off_point[1],off_point[2],1.]).T\n transpos = quatmat * trans\n return transpos.T.A[0,0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L80_C8", "label": "quatmat = mat()", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L79_C4", "vector": [14, 2, 0.2685, 0.0034, 2, 0.31, 0.0, 410, 3, 1, 0, 0, 882, 10, 2], "semantic": {"name": "quatmat", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " quatmat = np.mat(quaternion_matrix(quat))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L81_C8", "label": "assign", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L79_C4", "vector": [14, 2, 0.2718, 0.0034, 2, 0.31, 0.25, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " quatmat[0:3,3] = np.mat(pos).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L82_C8", "label": "trans =", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L79_C4", "vector": [14, 2, 0.2752, 0.0034, 2, 0.31, 0.5, 786, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "trans", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trans = np.matrix([off_point[0],off_point[1],off_point[2],1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L83_C8", "label": "transpos =", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L79_C4", "vector": [14, 2, 0.2785, 0.0034, 2, 0.31, 0.75, 686, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "transpos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " transpos = quatmat * trans"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L84_C8", "label": "return", "type": "return", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L79_C4", "vector": [13, 2, 0.2819, 0.0034, 2, 0.31, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return transpos.T.A[0,0:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L88_C4", "label": "normalize_rot", "type": "function", "loc": [88, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "vector": [2, 1, 0.3037, 0.0201, 1, 0.6, 0.4375, 27, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "normalize_rot", "arg_names": ["self", "gripper_rot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def normalize_rot(self, gripper_rot):\n while gripper_rot >= np.pi:\n gripper_rot -= np.pi\n while gripper_rot < 0.:\n gripper_rot += np.pi\n return gripper_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L89_C8", "label": "while", "type": "while", "loc": [89, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L88_C4", "vector": [5, 2, 0.3003, 0.0067, 2, 0.46, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while gripper_rot >= np.pi:\n gripper_rot -= np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L91_C8", "label": "while", "type": "while", "loc": [91, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L88_C4", "vector": [5, 2, 0.307, 0.0067, 2, 0.46, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while gripper_rot < 0.:\n gripper_rot += np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L93_C8", "label": "return", "type": "return", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L88_C4", "vector": [13, 2, 0.3121, 0.0034, 2, 0.46, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return gripper_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L97_C4", "label": "create_goal_pose", "type": "function", "loc": [97, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "vector": [2, 1, 0.3356, 0.0235, 1, 0.6, 0.5, 758, 0, 5, 1, 0, 0, 0, 5], "semantic": {"name": "create_goal_pose", "arg_names": ["self", "x", "y", "z", "gripper_pose"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create_goal_pose(self, x, y, z, gripper_pose):\n point = [x, y, z]\n point = self.transform_in_frame(point, gripper_pose, -self.GRIPPER_POINT).tolist()\n pose = point + gripper_pose.tolist()\n goal_pose = cf.create_pose_stamped(pose, \"torso_lift_link\")\n goal_pose.header.stamp = rospy.Time.now()\n return goal_pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L98_C8", "label": "point =", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L97_C4", "vector": [14, 2, 0.3289, 0.0034, 2, 0.83, 0.0, 16, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " point = [x, y, z]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L99_C8", "label": "point = tolist()", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L97_C4", "vector": [14, 2, 0.3322, 0.0034, 2, 0.83, 0.2, 16, 3, 0, 0, 0, 185, 10, 2], "semantic": {"name": "point", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " point = self.transform_in_frame(point, gripper_pose, -self.GRIPPER_POINT).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L100_C8", "label": "pose =", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L97_C4", "vector": [14, 2, 0.3356, 0.0034, 2, 0.83, 0.4, 767, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose = point + gripper_pose.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L101_C8", "label": "goal_pose = create_pose_stamped()", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L97_C4", "vector": [14, 2, 0.3389, 0.0034, 2, 0.83, 0.6, 109, 3, 2, 0, 0, 262, 10, 1], "semantic": {"name": "goal_pose", "arg_names": [], "import_names": [], "rhs_call_name": "create_pose_stamped", "annotation": ""}, "snippet": " goal_pose = cf.create_pose_stamped(pose, \"torso_lift_link\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L102_C8", "label": "goal_pose.header.stamp = now()", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L97_C4", "vector": [14, 2, 0.3423, 0.0034, 2, 0.83, 0.8, 393, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "goal_pose.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " goal_pose.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L103_C8", "label": "return", "type": "return", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L97_C4", "vector": [13, 2, 0.3456, 0.0034, 2, 0.83, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return goal_pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L107_C4", "label": "get_end_effector_pos", "type": "function", "loc": [107, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "vector": [2, 1, 0.3691, 0.0235, 1, 0.6, 0.5625, 223, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "get_end_effector_pos", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_end_effector_pos(self):\n wrist_pose = self.cm.get_current_wrist_pose_stamped(\"torso_lift_link\")\n p = wrist_pose.pose.position\n o = wrist_pose.pose.orientation\n affector_pos = self.transform_in_frame([p.x, p.y, p.z],\n [o.x, o.y, o.z, o.w], self.GRIPPER_POINT)\n return affector_pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L108_C8", "label": "wrist_pose = get_current_wrist_pose_stamped()", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L107_C4", "vector": [14, 2, 0.3624, 0.0034, 2, 0.48, 0.0, 718, 3, 1, 0, 0, 662, 10, 1], "semantic": {"name": "wrist_pose", "arg_names": [], "import_names": [], "rhs_call_name": "get_current_wrist_pose_stamped", "annotation": ""}, "snippet": " wrist_pose = self.cm.get_current_wrist_pose_stamped(\"torso_lift_link\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L109_C8", "label": "p =", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L107_C4", "vector": [14, 2, 0.3658, 0.0034, 2, 0.48, 0.25, 491, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = wrist_pose.pose.position"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L110_C8", "label": "o =", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L107_C4", "vector": [14, 2, 0.3691, 0.0034, 2, 0.48, 0.5, 926, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "o", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " o = wrist_pose.pose.orientation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L111_C8", "label": "affector_pos = transform_in_frame()", "type": "assigned_variable", "loc": [111, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L107_C4", "vector": [14, 2, 0.3742, 0.0067, 2, 0.48, 0.75, 383, 3, 3, 0, 0, 114, 10, 1], "semantic": {"name": "affector_pos", "arg_names": [], "import_names": [], "rhs_call_name": "transform_in_frame", "annotation": ""}, "snippet": " affector_pos = self.transform_in_frame([p.x, p.y, p.z],\n [o.x, o.y, o.z, o.w], self.GRIPPER_POINT)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L113_C8", "label": "return", "type": "return", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L107_C4", "vector": [13, 2, 0.3792, 0.0034, 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 affector_pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L118_C4", "label": "kill_arm_movement", "type": "function", "loc": [118, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "vector": [2, 1, 0.4144, 0.0403, 1, 0.6, 0.625, 929, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "kill_arm_movement", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def kill_arm_movement(self):\n rospy.loginfo(\"Killing arm movement\")\n self.cm.joint_action_client.cancel_all_goals()\n rospy.sleep(0.01) \n # Needed for lag time in the case that the collision occurs\n # before the action is dispatched and due to the fact that\n # the arm doesn't necessarily respond the first time\n while not self.cm.check_joint_trajectory_done():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L119_C8", "label": "loginfo()", "type": "expression", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L118_C4", "vector": [8, 2, 0.3993, 0.0034, 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(\"Killing arm movement\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L120_C8", "label": "cancel_all_goals()", "type": "expression", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L118_C4", "vector": [8, 2, 0.4027, 0.0034, 2, 0.95, 0.3333, 699, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel_all_goals", "arg_names": [], "import_names": [], "rhs_call_name": "cancel_all_goals", "annotation": ""}, "snippet": " self.cm.joint_action_client.cancel_all_goals()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L121_C8", "label": "sleep()", "type": "expression", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L118_C4", "vector": [8, 2, 0.406, 0.0034, 2, 0.95, 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(0.01) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L125_C8", "label": "while", "type": "while", "loc": [125, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L118_C4", "vector": [5, 2, 0.4262, 0.0168, 2, 0.95, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not self.cm.check_joint_trajectory_done():\n self.cm.joint_action_client.cancel_all_goals()\n rospy.sleep(0.01)\n if rospy.is_shutdown():\n self.cm.joint_action_client.cancel_all_goals()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L126_C12", "label": "cancel_all_goals()", "type": "expression", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L125_C8", "vector": [8, 3, 0.4228, 0.0034, 3, 0.77, 0.0, 699, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel_all_goals", "arg_names": [], "import_names": [], "rhs_call_name": "cancel_all_goals", "annotation": ""}, "snippet": " self.cm.joint_action_client.cancel_all_goals()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L127_C12", "label": "sleep()", "type": "expression", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L125_C8", "vector": [8, 3, 0.4262, 0.0034, 3, 0.77, 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.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L128_C12", "label": "if", "type": "if", "loc": [128, 129], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L125_C8", "vector": [4, 3, 0.4312, 0.0067, 3, 0.77, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rospy.is_shutdown():\n self.cm.joint_action_client.cancel_all_goals()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L129_C16", "label": "cancel_all_goals()", "type": "expression", "loc": [129, 129], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L128_C12", "vector": [8, 4, 0.4329, 0.0034, 4, 0.65, 0.0, 699, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel_all_goals", "arg_names": [], "import_names": [], "rhs_call_name": "cancel_all_goals", "annotation": ""}, "snippet": " self.cm.joint_action_client.cancel_all_goals()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L133_C4", "label": "stage_grasp", "type": "function", "loc": [133, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "vector": [2, 1, 0.4597, 0.0302, 1, 0.6, 0.6875, 473, 0, 3, 0, 0, 0, 0, 7], "semantic": {"name": "stage_grasp", "arg_names": ["self", "grasp_params", "open_gripper"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stage_grasp(self, grasp_params, open_gripper=True):\n rospy.loginfo(\"Staging grasp motion\")\n self.grasp_setup_move(grasp_params)\n if open_gripper:\n # open gripper\n rospy.loginfo(\"Opening gripper\")\n self.cm.command_gripper(1.00, -1.0, False)\n self.cm.gripper_action_client.wait_for_result(rospy.Duration(2.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L134_C8", "label": "loginfo()", "type": "expression", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L133_C4", "vector": [8, 2, 0.4497, 0.0034, 2, 0.42, 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(\"Staging grasp motion\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L135_C8", "label": "grasp_setup_move()", "type": "expression", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L133_C4", "vector": [8, 2, 0.453, 0.0034, 2, 0.42, 0.3333, 993, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "grasp_setup_move", "arg_names": [], "import_names": [], "rhs_call_name": "grasp_setup_move", "annotation": ""}, "snippet": " self.grasp_setup_move(grasp_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L136_C8", "label": "if", "type": "if", "loc": [136, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L133_C4", "vector": [4, 2, 0.4631, 0.0168, 2, 0.42, 0.6667, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if open_gripper:\n # open gripper\n rospy.loginfo(\"Opening gripper\")\n self.cm.command_gripper(1.00, -1.0, False)\n self.cm.gripper_action_client.wait_for_result(rospy.Duration(2.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L138_C12", "label": "loginfo()", "type": "expression", "loc": [138, 138], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L136_C8", "vector": [8, 3, 0.4631, 0.0034, 3, 0.58, 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(\"Opening gripper\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L139_C12", "label": "command_gripper()", "type": "expression", "loc": [139, 139], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L136_C8", "vector": [8, 3, 0.4664, 0.0034, 3, 0.58, 0.5, 250, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "command_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "command_gripper", "annotation": ""}, "snippet": " self.cm.command_gripper(1.00, -1.0, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L140_C12", "label": "wait_for_result()", "type": "expression", "loc": [140, 140], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L136_C8", "vector": [8, 3, 0.4698, 0.0034, 3, 0.58, 1.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.cm.gripper_action_client.wait_for_result(rospy.Duration(2.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L141_C8", "label": "wait_joint_trajectory_done()", "type": "expression", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L133_C4", "vector": [8, 2, 0.4732, 0.0034, 2, 0.42, 1.0, 722, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_joint_trajectory_done", "arg_names": [], "import_names": [], "rhs_call_name": "wait_joint_trajectory_done", "annotation": ""}, "snippet": " self.cm.wait_joint_trajectory_done()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "label": "grasp_approach_motion", "type": "function", "loc": [145, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "vector": [2, 1, 0.5503, 0.1309, 1, 0.6, 0.75, 284, 0, 4, 1, 0, 0, 0, 16], "semantic": {"name": "grasp_approach_motion", "arg_names": ["self", "coll_detect", "behavior_name", "sig_level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def grasp_approach_motion(self, coll_detect=False, behavior_name=\"\", sig_level=0.99):\n # move arm down\n rospy.loginfo(\"Moving arm down\")\n startt = rospy.Time.now().to_sec()\n if coll_detect:\n self.start_detection(behavior_name, sig_level)\n result = self.execute_approach(False)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L147_C8", "label": "loginfo()", "type": "expression", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "vector": [8, 2, 0.4933, 0.0034, 2, 0.03, 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(\"Moving arm down\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L148_C8", "label": "startt = to_sec()", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "vector": [14, 2, 0.4966, 0.0034, 2, 0.03, 0.0833, 312, 3, 0, 0, 0, 750, 10, 2], "semantic": {"name": "startt", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " startt = rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L149_C8", "label": "if", "type": "if", "loc": [149, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "vector": [4, 2, 0.5017, 0.0067, 2, 0.03, 0.1667, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if coll_detect:\n self.start_detection(behavior_name, sig_level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L150_C12", "label": "start_detection()", "type": "expression", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L149_C8", "vector": [8, 3, 0.5034, 0.0034, 3, 0.96, 0.0, 684, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start_detection", "arg_names": [], "import_names": [], "rhs_call_name": "start_detection", "annotation": ""}, "snippet": " self.start_detection(behavior_name, sig_level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L151_C8", "label": "result = execute_approach()", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "vector": [14, 2, 0.5067, 0.0034, 2, 0.03, 0.25, 51, 3, 1, 0, 0, 414, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "execute_approach", "annotation": ""}, "snippet": " result = self.execute_approach(False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L153_C8", "label": "if", "type": "if", "loc": [153, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "vector": [4, 2, 0.5218, 0.0201, 2, 0.03, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if result == \"no solution\":\n # break without completing the grasp\n #self.apm.end_collision_detection()\n if coll_detect:\n self.stop_detection()\n return \"no solution\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L156_C12", "label": "if", "type": "if", "loc": [156, 157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L153_C8", "vector": [4, 3, 0.5252, 0.0067, 3, 0.89, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if coll_detect:\n self.stop_detection()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L157_C16", "label": "stop_detection()", "type": "expression", "loc": [157, 157], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L156_C12", "vector": [8, 4, 0.5268, 0.0034, 4, 0.21, 0.0, 642, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop_detection", "arg_names": [], "import_names": [], "rhs_call_name": "stop_detection", "annotation": ""}, "snippet": " self.stop_detection()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L158_C12", "label": "return", "type": "return", "loc": [158, 158], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L153_C8", "vector": [13, 3, 0.5302, 0.0034, 3, 0.89, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"no solution\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L164_C8", "label": "while", "type": "while", "loc": [164, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "vector": [5, 2, 0.5621, 0.0268, 2, 0.03, 0.4167, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not self.cm.check_joint_trajectory_done():\n if rospy.is_shutdown():\n self.kill_arm_movement()\n return \"shutdown\"\n if self.coll_state.collided:\n self.kill_arm_movement()\n break\n rospy.sleep(0.005)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L165_C12", "label": "if", "type": "if", "loc": [165, 167], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L164_C8", "vector": [4, 3, 0.557, 0.0101, 3, 0.95, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rospy.is_shutdown():\n self.kill_arm_movement()\n return \"shutdown\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L166_C16", "label": "kill_arm_movement()", "type": "expression", "loc": [166, 166], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L165_C12", "vector": [8, 4, 0.557, 0.0034, 4, 0.68, 0.0, 929, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "kill_arm_movement", "arg_names": [], "import_names": [], "rhs_call_name": "kill_arm_movement", "annotation": ""}, "snippet": " self.kill_arm_movement()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L167_C16", "label": "return", "type": "return", "loc": [167, 167], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L165_C12", "vector": [13, 4, 0.5604, 0.0034, 4, 0.68, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"shutdown\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L168_C12", "label": "if", "type": "if", "loc": [168, 170], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L164_C8", "vector": [4, 3, 0.5671, 0.0101, 3, 0.95, 0.5, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.coll_state.collided:\n self.kill_arm_movement()\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L169_C16", "label": "kill_arm_movement()", "type": "expression", "loc": [169, 169], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L168_C12", "vector": [8, 4, 0.5671, 0.0034, 4, 0.96, 0.0, 929, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "kill_arm_movement", "arg_names": [], "import_names": [], "rhs_call_name": "kill_arm_movement", "annotation": ""}, "snippet": " self.kill_arm_movement()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L171_C12", "label": "sleep()", "type": "expression", "loc": [171, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L164_C8", "vector": [8, 3, 0.5738, 0.0034, 3, 0.95, 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_99342:If_L173_C8", "label": "if", "type": "if", "loc": [173, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "vector": [4, 2, 0.5822, 0.0067, 2, 0.03, 0.5, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if coll_detect:\n self.stop_detection()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L174_C12", "label": "stop_detection()", "type": "expression", "loc": [174, 174], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L173_C8", "vector": [8, 3, 0.5839, 0.0034, 3, 0.74, 0.0, 642, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop_detection", "arg_names": [], "import_names": [], "rhs_call_name": "stop_detection", "annotation": ""}, "snippet": " self.stop_detection()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L175_C8", "label": "if", "type": "if", "loc": [175, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "vector": [4, 2, 0.5923, 0.0134, 2, 0.03, 0.5833, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.coll_state.collided and coll_detect:\n grasp_result = \"Collision\"\n else:\n grasp_result = \"No collision\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L176_C12", "label": "grasp_result =", "type": "assigned_variable", "loc": [176, 176], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L175_C8", "vector": [14, 3, 0.5906, 0.0034, 3, 0.3, 0.0, 706, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "grasp_result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_result = \"Collision\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L178_C12", "label": "grasp_result =", "type": "assigned_variable", "loc": [178, 178], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L175_C8", "vector": [14, 3, 0.5973, 0.0034, 3, 0.3, 1.0, 706, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "grasp_result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_result = \"No collision\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L179_C8", "label": "self.coll_state.collided =", "type": "assigned_variable", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "vector": [14, 2, 0.6007, 0.0034, 2, 0.03, 0.6667, 588, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.coll_state.collided", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.coll_state.collided = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L180_C8", "label": "endt = to_sec()", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "vector": [14, 2, 0.604, 0.0034, 2, 0.03, 0.75, 857, 3, 0, 0, 0, 750, 10, 2], "semantic": {"name": "endt", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " endt = rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L181_C8", "label": "loginfo()", "type": "expression", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "vector": [8, 2, 0.6074, 0.0034, 2, 0.03, 0.8333, 607, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"Grasp duration: %f\", endt - startt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L182_C8", "label": "loginfo()", "type": "expression", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "vector": [8, 2, 0.6107, 0.0034, 2, 0.03, 0.9167, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"Finished moving arm\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L183_C8", "label": "return", "type": "return", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "vector": [13, 2, 0.6141, 0.0034, 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 grasp_result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L187_C4", "label": "grasping_action", "type": "function", "loc": [187, 190], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "vector": [2, 1, 0.6326, 0.0134, 1, 0.6, 0.8125, 214, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "grasping_action", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def grasping_action(self):\n rospy.loginfo(\"Closing gripper\")\n self.cm.command_gripper(0.0, 30.0, True)\n rospy.loginfo(\"Gripper closed\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L188_C8", "label": "loginfo()", "type": "expression", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L187_C4", "vector": [8, 2, 0.6309, 0.0034, 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(\"Closing gripper\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L189_C8", "label": "command_gripper()", "type": "expression", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L187_C4", "vector": [8, 2, 0.6342, 0.0034, 2, 0.41, 0.5, 250, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "command_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "command_gripper", "annotation": ""}, "snippet": " self.cm.command_gripper(0.0, 30.0, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L190_C8", "label": "loginfo()", "type": "expression", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L187_C4", "vector": [8, 2, 0.6376, 0.0034, 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(\"Gripper closed\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L194_C4", "label": "placing_action", "type": "function", "loc": [194, 198], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "vector": [2, 1, 0.6577, 0.0168, 1, 0.6, 0.875, 564, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "placing_action", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def placing_action(self):\n rospy.loginfo(\"Opening gripper\")\n self.cm.command_gripper(1.00, -1.0, False)\n rospy.sleep(0.5)\n rospy.loginfo(\"Gripper opened\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L195_C8", "label": "loginfo()", "type": "expression", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L194_C4", "vector": [8, 2, 0.6544, 0.0034, 2, 0.66, 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(\"Opening gripper\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L196_C8", "label": "command_gripper()", "type": "expression", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L194_C4", "vector": [8, 2, 0.6577, 0.0034, 2, 0.66, 0.3333, 250, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "command_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "command_gripper", "annotation": ""}, "snippet": " self.cm.command_gripper(1.00, -1.0, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L197_C8", "label": "sleep()", "type": "expression", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L194_C4", "vector": [8, 2, 0.6611, 0.0034, 2, 0.66, 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(0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L198_C8", "label": "loginfo()", "type": "expression", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L194_C4", "vector": [8, 2, 0.6644, 0.0034, 2, 0.66, 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(\"Gripper opened\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "label": "perform_grasp", "type": "function", "loc": [210, 284], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "vector": [2, 1, 0.8289, 0.2517, 1, 0.6, 0.9375, 121, 0, 9, 1, 0, 0, 0, 25], "semantic": {"name": "perform_grasp", "arg_names": ["self", "grasp_params", "is_place", "collide", "behavior_name", "sig_level", "data_collecting", "num_jiggle", "publish_state"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def perform_grasp(self, grasp_params, is_place=False, collide=True, \n behavior_name=\"\", sig_level=0.99, \n data_collecting=False, num_jiggle=2,\n publish_state=lambda x: x):\n self.collide = collide\n\n rospy.loginfo(\"Performing grasp with parameters: \" + str(grasp_params))\n iters = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L214_C8", "label": "self.collide =", "type": "assigned_variable", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "vector": [14, 2, 0.7181, 0.0034, 2, 0.05, 0.0, 122, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.collide", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.collide = collide"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L216_C8", "label": "loginfo()", "type": "expression", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "vector": [8, 2, 0.7248, 0.0034, 2, 0.05, 0.0769, 607, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"Performing grasp with parameters: \" + str(grasp_params))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L217_C8", "label": "iters =", "type": "assigned_variable", "loc": [217, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "vector": [14, 2, 0.7282, 0.0034, 2, 0.05, 0.1538, 290, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "iters", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " iters = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L218_C8", "label": "while", "type": "while", "loc": [218, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "vector": [5, 2, 0.7735, 0.0872, 2, 0.05, 0.2308, 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 # Move to grasp position\n publish_state(GraspStates.GRASP_SETUP_MOVE)\n self.stage_grasp(grasp_params, not is_place)\n self.arm_moving_wait(True, 3.0) # Wait for the arm to stop moving\n publish_state(GraspStates.EXECUTE_APPROACH)\n approach_result = self.grasp_approach_motion(self.use_coll_detection and self.collide,\n behavior_name=behavior_name, "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L220_C12", "label": "publish_state()", "type": "expression", "loc": [220, 220], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L218_C8", "vector": [8, 3, 0.7383, 0.0034, 3, 0.32, 0.0, 843, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish_state", "arg_names": [], "import_names": [], "rhs_call_name": "publish_state", "annotation": ""}, "snippet": " publish_state(GraspStates.GRASP_SETUP_MOVE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L221_C12", "label": "stage_grasp()", "type": "expression", "loc": [221, 221], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L218_C8", "vector": [8, 3, 0.7416, 0.0034, 3, 0.32, 0.1667, 473, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "stage_grasp", "arg_names": [], "import_names": [], "rhs_call_name": "stage_grasp", "annotation": ""}, "snippet": " self.stage_grasp(grasp_params, not is_place)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L222_C12", "label": "arm_moving_wait()", "type": "expression", "loc": [222, 222], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L218_C8", "vector": [8, 3, 0.745, 0.0034, 3, 0.32, 0.3333, 771, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "arm_moving_wait", "arg_names": [], "import_names": [], "rhs_call_name": "arm_moving_wait", "annotation": ""}, "snippet": " self.arm_moving_wait(True, 3.0) # Wait for the arm to stop moving"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L223_C12", "label": "publish_state()", "type": "expression", "loc": [223, 223], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L218_C8", "vector": [8, 3, 0.7483, 0.0034, 3, 0.32, 0.5, 843, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish_state", "arg_names": [], "import_names": [], "rhs_call_name": "publish_state", "annotation": ""}, "snippet": " publish_state(GraspStates.EXECUTE_APPROACH)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L224_C12", "label": "approach_result = grasp_approach_motion()", "type": "assigned_variable", "loc": [224, 226], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L218_C8", "vector": [14, 3, 0.755, 0.0101, 3, 0.32, 0.6667, 781, 3, 3, 0, 0, 284, 10, 1], "semantic": {"name": "approach_result", "arg_names": [], "import_names": [], "rhs_call_name": "grasp_approach_motion", "annotation": ""}, "snippet": " approach_result = self.grasp_approach_motion(self.use_coll_detection and self.collide,\n behavior_name=behavior_name, \n sig_level=sig_level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L227_C12", "label": "sleep()", "type": "expression", "loc": [227, 227], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L218_C8", "vector": [8, 3, 0.7617, 0.0034, 3, 0.32, 0.8333, 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_99342:If_L228_C12", "label": "if", "type": "if", "loc": [228, 243], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L218_C8", "vector": [4, 3, 0.7903, 0.0537, 3, 0.32, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if approach_result != \"no solution\":\n break\n else:\n if num_jiggle == 0:\n rospy.loginfo(\"Interpolated IK failed, cannot perform grasp for x = %1.2f, y = %1.2f, rot = %1.2f\" % (x, y, gripper_rot))\n return \"IK failure\"\n rospy.loginfo(\"Interpolated IK failed, jiggling configuration for nearby trajectory\")\n # Jiggle it to see if it works"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L231_C16", "label": "if", "type": "if", "loc": [231, 233], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L228_C12", "vector": [4, 4, 0.7785, 0.0101, 4, 0.1, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if num_jiggle == 0:\n rospy.loginfo(\"Interpolated IK failed, cannot perform grasp for x = %1.2f, y = %1.2f, rot = %1.2f\" % (x, y, gripper_rot))\n return \"IK failure\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L232_C20", "label": "loginfo()", "type": "expression", "loc": [232, 232], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L231_C16", "vector": [8, 5, 0.7785, 0.0034, 5, 0.4, 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(\"Interpolated IK failed, cannot perform grasp for x = %1.2f, y = %1.2f, rot = %1.2f\" % (x, y, gripper_rot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L233_C20", "label": "return", "type": "return", "loc": [233, 233], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L231_C16", "vector": [13, 5, 0.7819, 0.0034, 5, 0.4, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"IK failure\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L234_C16", "label": "loginfo()", "type": "expression", "loc": [234, 234], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L228_C12", "vector": [8, 4, 0.7852, 0.0034, 4, 0.1, 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(\"Interpolated IK failed, jiggling configuration for nearby trajectory\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L236_C16", "label": "grasp_params = jiggle_grasp_params()", "type": "assigned_variable", "loc": [236, 236], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L228_C12", "vector": [14, 4, 0.7919, 0.0034, 4, 0.1, 0.6667, 572, 3, 1, 0, 0, 601, 10, 1], "semantic": {"name": "grasp_params", "arg_names": [], "import_names": [], "rhs_call_name": "jiggle_grasp_params", "annotation": ""}, "snippet": " grasp_params = self.jiggle_grasp_params(grasp_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L239_C16", "label": "if", "type": "if", "loc": [239, 243], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L228_C12", "vector": [4, 4, 0.8087, 0.0168, 4, 0.1, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if iters >= num_jiggle:\n rospy.loginfo(\"Cannot find IK solution\")\n return \"IK failure\"\n else:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L240_C20", "label": "loginfo()", "type": "expression", "loc": [240, 240], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L239_C16", "vector": [8, 5, 0.8054, 0.0034, 5, 0.52, 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(\"Cannot find IK solution\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L241_C20", "label": "return", "type": "return", "loc": [241, 241], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L239_C16", "vector": [13, 5, 0.8087, 0.0034, 5, 0.52, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"IK failure\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L245_C8", "label": "if", "type": "if", "loc": [245, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "vector": [4, 2, 0.8238, 0.0067, 2, 0.05, 0.3077, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data_collecting:\n return \"Grasp motion success\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L246_C12", "label": "return", "type": "return", "loc": [246, 246], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L245_C8", "vector": [13, 3, 0.8255, 0.0034, 3, 0.7, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"Grasp motion success\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L248_C8", "label": "if", "type": "if", "loc": [248, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "vector": [4, 2, 0.8406, 0.0201, 2, 0.05, 0.3846, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if approach_result == \"Collision\":\n if not is_place:\n publish_state(GraspStates.GRASP_OBJECT)\n self.grasping_action()\n else:\n self.placing_action()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L249_C12", "label": "if", "type": "if", "loc": [249, 253], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L248_C8", "vector": [4, 3, 0.8423, 0.0168, 3, 0.04, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not is_place:\n publish_state(GraspStates.GRASP_OBJECT)\n self.grasping_action()\n else:\n self.placing_action()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L250_C16", "label": "publish_state()", "type": "expression", "loc": [250, 250], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L249_C12", "vector": [8, 4, 0.8389, 0.0034, 4, 0.5, 0.0, 843, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish_state", "arg_names": [], "import_names": [], "rhs_call_name": "publish_state", "annotation": ""}, "snippet": " publish_state(GraspStates.GRASP_OBJECT)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L251_C16", "label": "grasping_action()", "type": "expression", "loc": [251, 251], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L249_C12", "vector": [8, 4, 0.8423, 0.0034, 4, 0.5, 0.5, 214, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "grasping_action", "arg_names": [], "import_names": [], "rhs_call_name": "grasping_action", "annotation": ""}, "snippet": " self.grasping_action()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L253_C16", "label": "placing_action()", "type": "expression", "loc": [253, 253], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L249_C12", "vector": [8, 4, 0.849, 0.0034, 4, 0.5, 1.0, 564, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "placing_action", "arg_names": [], "import_names": [], "rhs_call_name": "placing_action", "annotation": ""}, "snippet": " self.placing_action()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L255_C8", "label": "if", "type": "if", "loc": [255, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "vector": [4, 2, 0.8607, 0.0134, 2, 0.05, 0.4615, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not is_place:\n rospy.loginfo(\"Picking object up\")\n else:\n rospy.loginfo(\"Pulling arm away\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L256_C12", "label": "loginfo()", "type": "expression", "loc": [256, 256], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L255_C8", "vector": [8, 3, 0.8591, 0.0034, 3, 0.04, 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(\"Picking object up\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L258_C12", "label": "loginfo()", "type": "expression", "loc": [258, 258], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L255_C8", "vector": [8, 3, 0.8658, 0.0034, 3, 0.04, 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(\"Pulling arm away\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L259_C8", "label": "publish_state()", "type": "expression", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "vector": [8, 2, 0.8691, 0.0034, 2, 0.05, 0.5385, 843, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish_state", "arg_names": [], "import_names": [], "rhs_call_name": "publish_state", "annotation": ""}, "snippet": " publish_state(GraspStates.EXECUTE_RETREAT)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L260_C8", "label": "execute_retreat()", "type": "expression", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "vector": [8, 2, 0.8725, 0.0034, 2, 0.05, 0.6154, 538, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "execute_retreat", "arg_names": [], "import_names": [], "rhs_call_name": "execute_retreat", "annotation": ""}, "snippet": " self.execute_retreat()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L264_C8", "label": "arm_moving_wait()", "type": "expression", "loc": [264, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "vector": [8, 2, 0.8859, 0.0034, 2, 0.05, 0.6923, 771, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "arm_moving_wait", "arg_names": [], "import_names": [], "rhs_call_name": "arm_moving_wait", "annotation": ""}, "snippet": " self.arm_moving_wait(True, 3.0) # Wait for the arm to stop moving"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L265_C8", "label": "if", "type": "if", "loc": [265, 280], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "vector": [4, 2, 0.9144, 0.0537, 2, 0.05, 0.7692, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if approach_result == \"Collision\":\n if not is_place:\n if self.is_obj_in_gripper():\n grasp_result = \"Object grasped\"\n else:\n grasp_result = \"Object missed\"\n else:\n grasp_result = \"Object placed\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L266_C12", "label": "if", "type": "if", "loc": [266, 272], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L265_C8", "vector": [4, 3, 0.9027, 0.0235, 3, 0.44, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not is_place:\n if self.is_obj_in_gripper():\n grasp_result = \"Object grasped\"\n else:\n grasp_result = \"Object missed\"\n else:\n grasp_result = \"Object placed\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L267_C16", "label": "if", "type": "if", "loc": [267, 270], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L266_C12", "vector": [4, 4, 0.901, 0.0134, 4, 0.3, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.is_obj_in_gripper():\n grasp_result = \"Object grasped\"\n else:\n grasp_result = \"Object missed\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L268_C20", "label": "grasp_result =", "type": "assigned_variable", "loc": [268, 268], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L267_C16", "vector": [14, 5, 0.8993, 0.0034, 5, 0.61, 0.0, 706, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "grasp_result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_result = \"Object grasped\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L270_C20", "label": "grasp_result =", "type": "assigned_variable", "loc": [270, 270], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L267_C16", "vector": [14, 5, 0.906, 0.0034, 5, 0.61, 1.0, 706, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "grasp_result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_result = \"Object missed\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L272_C16", "label": "grasp_result =", "type": "assigned_variable", "loc": [272, 272], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L266_C12", "vector": [14, 4, 0.9128, 0.0034, 4, 0.3, 1.0, 706, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "grasp_result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_result = \"Object placed\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L274_C12", "label": "if", "type": "if", "loc": [274, 280], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L265_C8", "vector": [4, 3, 0.9295, 0.0235, 3, 0.44, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not is_place: \n grasp_result = \"No collision for grasp\"\n else:\n if self.is_obj_in_gripper():\n grasp_result = \"No collision for place\"\n else:\n grasp_result = \"Object dropped before place\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L275_C16", "label": "grasp_result =", "type": "assigned_variable", "loc": [275, 275], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L274_C12", "vector": [14, 4, 0.9228, 0.0034, 4, 0.36, 0.0, 706, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "grasp_result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_result = \"No collision for grasp\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L277_C16", "label": "if", "type": "if", "loc": [277, 280], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L274_C12", "vector": [4, 4, 0.9346, 0.0134, 4, 0.36, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.is_obj_in_gripper():\n grasp_result = \"No collision for place\"\n else:\n grasp_result = \"Object dropped before place\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L278_C20", "label": "grasp_result =", "type": "assigned_variable", "loc": [278, 278], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L277_C16", "vector": [14, 5, 0.9329, 0.0034, 5, 0.35, 0.0, 706, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "grasp_result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_result = \"No collision for place\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L280_C20", "label": "grasp_result =", "type": "assigned_variable", "loc": [280, 280], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L277_C16", "vector": [14, 5, 0.9396, 0.0034, 5, 0.35, 1.0, 706, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "grasp_result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_result = \"Object dropped before place\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L282_C8", "label": "loginfo()", "type": "expression", "loc": [282, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "vector": [8, 2, 0.9463, 0.0034, 2, 0.05, 0.8462, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"Grasp result: %s\" % grasp_result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L283_C8", "label": "loginfo()", "type": "expression", "loc": [283, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "vector": [8, 2, 0.9497, 0.0034, 2, 0.05, 0.9231, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"Grasp complete!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L284_C8", "label": "return", "type": "return", "loc": [284, 284], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "vector": [13, 2, 0.953, 0.0034, 2, 0.05, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return grasp_result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L288_C4", "label": "is_obj_in_gripper", "type": "function", "loc": [288, 297], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "vector": [2, 1, 0.9815, 0.0336, 1, 0.6, 1.0, 969, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "is_obj_in_gripper", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_obj_in_gripper(self):\n last_opening = self.cm.get_current_gripper_opening()\n while not rospy.is_shutdown():\n rospy.sleep(0.2)\n next_opening = self.cm.get_current_gripper_opening()\n print(next_opening)\n if abs(last_opening - next_opening) < 0.001:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L289_C8", "label": "last_opening = get_current_gripper_opening()", "type": "assigned_variable", "loc": [289, 289], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L288_C4", "vector": [14, 2, 0.9698, 0.0034, 2, 0.5, 0.0, 409, 3, 0, 0, 0, 56, 10, 1], "semantic": {"name": "last_opening", "arg_names": [], "import_names": [], "rhs_call_name": "get_current_gripper_opening", "annotation": ""}, "snippet": " last_opening = self.cm.get_current_gripper_opening()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L290_C8", "label": "while", "type": "while", "loc": [290, 296], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L288_C4", "vector": [5, 2, 0.9832, 0.0235, 2, 0.5, 0.5, 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 rospy.sleep(0.2)\n next_opening = self.cm.get_current_gripper_opening()\n print(next_opening)\n if abs(last_opening - next_opening) < 0.001:\n break\n last_opening = next_opening"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L291_C12", "label": "sleep()", "type": "expression", "loc": [291, 291], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L290_C8", "vector": [8, 3, 0.9765, 0.0034, 3, 0.76, 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.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L292_C12", "label": "next_opening = get_current_gripper_opening()", "type": "assigned_variable", "loc": [292, 292], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L290_C8", "vector": [14, 3, 0.9799, 0.0034, 3, 0.76, 0.25, 591, 3, 0, 0, 0, 56, 10, 1], "semantic": {"name": "next_opening", "arg_names": [], "import_names": [], "rhs_call_name": "get_current_gripper_opening", "annotation": ""}, "snippet": " next_opening = self.cm.get_current_gripper_opening()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L293_C12", "label": "print()", "type": "expression", "loc": [293, 293], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L290_C8", "vector": [8, 3, 0.9832, 0.0034, 3, 0.76, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(next_opening)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L294_C12", "label": "if", "type": "if", "loc": [294, 295], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L290_C8", "vector": [4, 3, 0.9883, 0.0067, 3, 0.76, 0.75, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if abs(last_opening - next_opening) < 0.001:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L296_C12", "label": "last_opening =", "type": "assigned_variable", "loc": [296, 296], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L290_C8", "vector": [14, 3, 0.9933, 0.0034, 3, 0.76, 1.0, 409, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "last_opening", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " last_opening = next_opening"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L297_C8", "label": "return", "type": "return", "loc": [297, 297], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L288_C4", "vector": [13, 2, 0.9966, 0.0034, 2, 0.5, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.cm.get_current_gripper_opening() > 0.01"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L25_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L26_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L26_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L27_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L25_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L28_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L28_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L29_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L29_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L30_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L33_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L34_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L35_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L38_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L39_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L40_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L125_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L125_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L125_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L128_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L128_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L129_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L138_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L139_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L149_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L150_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L153_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L156_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L157_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L153_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L158_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L164_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L165_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L165_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L166_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L165_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L167_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L164_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L168_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L168_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L169_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L164_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L171_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L173_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L174_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L175_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L176_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L175_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L178_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L218_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L220_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L218_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L221_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L218_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L222_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L218_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L223_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L218_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L224_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L218_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L227_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L218_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L228_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L228_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L231_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L231_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L232_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L231_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L233_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L228_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L234_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L228_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L236_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L228_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L239_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L239_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L240_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L239_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L241_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L245_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L246_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L248_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L249_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L250_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L251_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L253_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L255_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L255_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L256_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L255_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L258_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L259_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L265_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L265_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L266_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L266_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L267_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L267_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L268_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L267_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L270_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L266_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L272_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L265_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L274_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L274_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L275_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L274_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L277_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L277_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L278_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L277_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L280_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L282_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L284_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L288_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L288_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L289_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L288_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L290_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L290_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L291_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L290_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L292_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L290_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Expr_L293_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L290_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:If_L294_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:While_L290_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Assign_L296_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99342:FunctionDef_L288_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99342:Return_L297_C8"}]
#! /usr/bin/python import numpy as np, math import sys import roslib; roslib.load_manifest('pr2_grasp_behaviors') import rospy import actionlib from tf.transformations import * from std_msgs.msg import String from geometry_msgs.msg import PointStamped import object_manipulator.convert_functions as cf from object_manipulator.cluster_bounding_box_finder import ClusterBoundingBoxFinder from tabletop_object_detector.srv import TabletopSegmentation from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal from pr2_grasp_behaviors.msg import OverheadGraspAction, OverheadGraspResult from pr2_grasp_behaviors.msg import OverheadGraspSetupAction, OverheadGraspSetupResult from pr2_grasp_behaviors.msg import OverheadGraspFeedback #from laser_interface.pkg import CURSOR_TOPIC, MOUSE_DOUBLE_CLICK_TOPIC, CURSOR_TOPIC, MOUSE_R_CLICK_TOPIC, MOUSE_R_DOUBLE_CLICK_TOPIC class GraspStates: ACTIONLIB_CALLED = 'Actionlib grasping goal called' PERCEIVING_OBJECTS = 'Perceiving table objects' GRASP_SETUP_MOVE = 'Moving to grasp setup' EXECUTE_APPROACH = 'Executing grasp motion' GRASP_OBJECT = 'Closing gripper on object' EXECUTE_RETREAT = 'Retreating grasp motion' ACTIONLIB_COMPLETE = 'Actionlib grasping goal completed' class GraspBehaviorServer(object): def __init__(self, arm, grasp_manager): self.arm = arm self.gman = grasp_manager ## # Open gripper fully. def open_gripper(self, blocking = False): self.gman.cm.command_gripper(1.0, -1.0, False) if blocking: self.gman.cm.gripper_action_client.wait_for_result(rospy.Duration(4.0)) ## # Uses the object_detection service detect objects on the table. Returns a list # of pairs [ [ x, y, z], rot ] which represent the centers and z orientation of # each object detected on the table. def detect_tabletop_objects(self): DETECT_ERROR = 0. cbbf = ClusterBoundingBoxFinder(tf_listener=self.gman.cm.tf_listener) object_detector = rospy.ServiceProxy("/object_detection", TabletopSegmentation) try: detects = object_detector() object_detector.close() except ServiceException as se: rospy.logerr("Tabletop segmentation crashed") return [] if detects.result != 4: rospy.logerr("Detection failed (err %d)" % (detects.result)) return [] table_z = detects.table.pose.pose.position.z objects = [] for cluster in detects.clusters: (object_points, object_bounding_box_dims, object_bounding_box, object_to_base_link_frame, object_to_cluster_frame) = cbbf.find_object_frame_and_bounding_box(cluster) # rospy.loginfo("bounding box:", object_bounding_box) (object_pos, object_quat) = cf.mat_to_pos_and_quat(object_to_cluster_frame) angs = euler_from_quaternion(object_quat) # position is half of height object_pos[2] = table_z + object_bounding_box[1][2] / 2. + DETECT_ERROR objects += [[object_pos, angs[2]]] return objects def get_grasp_loc(self, obj): return obj[0][0], obj[0][1], obj[1], obj[0][2] ## # Given an (x, y) location on a table, grasp the closest object detected. # If repeat is True, will keep trying if the grasp fails. def detect_closest_object(self, x, y, repeat=True, disable_head=False): def dist(o): return (o[0][0] - x) ** 2 + (o[0][1] - y) ** 2 grasped = False num_tries = 0 if not disable_head: self.point_head([x,y,-0.3]) while not grasped and num_tries < 4: rospy.loginfo("Detect in") rospy.sleep(0.6) detect_tries = 0 objects = None while (objects is None or len(objects) == 0): objects = self.detect_tabletop_objects() rospy.sleep(0.6) detect_tries += 1 if detect_tries == 3 and (objects is None or len(objects) == 0): rospy.logerr("Cannot detect any objects") return None rospy.loginfo("Detect out") if len(objects) > 0: try: obj = min(objects, key=dist) # Get better look if not disable_head: obj_pt = obj[0] obj_pt[2] = -0.4 self.point_head(obj_pt) rospy.sleep(0.2) rospy.loginfo("Detect2 in") objects = self.detect_tabletop_objects() rospy.loginfo("Detect2 out") obj = min(objects, key=dist) except: pass return obj else: rospy.loginfo("No objects near point") return None return None ## # Points head at given point in given frame. def point_head(self, point, velocity = 0.6, frame="/torso_lift_link", block = True): head_action_client = actionlib.SimpleActionClient("/head_traj_controller/point_head_action", PointHeadAction) head_action_client.wait_for_server() goal = PointHeadGoal() goal.target = cf.create_point_stamped(point, frame) goal.pointing_frame = "/openni_rgb_optical_frame" goal.max_velocity = velocity head_action_client.send_goal(goal) if not block: return 0 finished_within_time = head_action_client.wait_for_result(rospy.Duration(10)) if not finished_within_time: head_action_client.cancel_goal() rospy.logerr("timed out when asking the head to point to a new goal") return 0 return 1 ## # Move the arm to a suitable setup position for moving to a grasp position def setup_grasp(self, block = False, disable_head=False, open_gripper=False): if open_gripper: self.open_gripper(blocking=False) if not disable_head: self.point_head([0.3, 0.0, -0.3], block=False) self.gman.grasp_preparation_move() rospy.sleep(1.) if block: self.gman.arm_moving_wait(True, 8.0) ## # Launch actionlib srv calls. def start_grasping_server(self, grasp_server_name, setup_server_name): self.grasping_server = actionlib.SimpleActionServer(grasp_server_name, OverheadGraspAction, self.execute_grasping_goal, False) self.grasping_server.register_preempt_callback(self.gman.kill_arm_movement) self.grasping_server.start() self.setup_server = actionlib.SimpleActionServer(setup_server_name, OverheadGraspSetupAction, self.execute_grasping_setup, False) self.setup_server.register_preempt_callback(self.gman.kill_arm_movement) self.setup_server.start() rospy.loginfo("Grasping server launched on %s, setup at %s", grasp_server_name, setup_server_name) ## # Wraps setup_grasp def execute_grasping_setup(self, goal): result = OverheadGraspSetupResult() self.setup_grasp(block=True, disable_head=goal.disable_head, open_gripper=goal.open_gripper) rospy.loginfo("Finished setup") self.setup_server.set_succeeded(result) ## # Executes grasping goal requested on actionlib srvs. Actions differ based # on type of grasp requested. def execute_grasping_goal(self, goal): result = OverheadGraspResult() feedback = OverheadGraspFeedback() def publish_state(state): feedback.state = state self.grasping_server.publish_feedback(feedback) publish_state(GraspStates.ACTIONLIB_CALLED) # User specifies parameters if goal.grasp_type == goal.MANUAL_GRASP: grasp_params = (goal.x, goal.y, goal.roll, goal.pitch) # Robot finds parameters elif goal.grasp_type == goal.VISION_GRASP: obj = self.detect_closest_object(goal.x, goal.y, disable_head=goal.disable_head) publish_state(GraspStates.PERCEIVING_OBJECTS) if obj is None: rospy.loginfo("No objects detected") result.grasp_result = "No objects detected" self.grasping_server.set_aborted(result) return x, y, rot, z = self.get_grasp_loc(obj) grasp_params = (x, y, rot, goal.pitch) # execute a random grasp elif goal.grasp_type == goal.RANDOM_GRASP: grasp_params = self.random_generator() else: rospy.logerr("Bad grasp type") self.grasping_server.set_aborted(result) return feedback.x, feedback.y = grasp_params[0], grasp_params[1] feedback.roll, feedback.pitch = grasp_params[2], grasp_params[3] grasp_result = self.gman.perform_grasp(grasp_params, collide=not goal.disable_coll, behavior_name=goal.behavior_name, sig_level=goal.sig_level, is_place=not goal.is_grasp, publish_state=publish_state) result.grasp_result = grasp_result if goal.is_grasp: if grasp_result == "Object grasped": self.grasping_server.set_succeeded(result) else: self.grasping_server.set_aborted(result) else: if grasp_result == "Object placed": self.grasping_server.set_succeeded(result) else: self.grasping_server.set_aborted(result) publish_state(GraspStates.ACTIONLIB_COMPLETE)
ajibawa-2023/Python-Code-Large/train/row_99343
163
242
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Import_L3_C0", "label": "numpy import np, math", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0124, 0.0041, 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_99343:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0165, 0.0041, 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_99343:Import_L6_C0", "label": "roslib import roslib", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0248, 0.0041, 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('pr2_grasp_behaviors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L6_C15", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0248, 0.0041, 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('pr2_grasp_behaviors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Import_L7_C0", "label": "rospy import rospy", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0289, 0.0041, 0, 0.66, 0.2353, 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_99343:Import_L9_C0", "label": "actionlib import actionlib", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0372, 0.0041, 0, 0.66, 0.2941, 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_99343:ImportFrom_L10_C0", "label": "from tf.transformations import *", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0413, 0.0041, 0, 0.66, 0.3529, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from tf.transformations import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:ImportFrom_L11_C0", "label": "from std_msgs.msg import String", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0455, 0.0041, 0, 0.66, 0.4118, 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_99343:ImportFrom_L12_C0", "label": "from geometry_msgs.msg import PointStamped", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0496, 0.0041, 0, 0.66, 0.4706, 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_99343:Import_L13_C0", "label": "object_manipulator.convert_functions import cf", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0537, 0.0041, 0, 0.66, 0.5294, 7, 0, 1, 0, 0, 7, 0, 0], "semantic": {"name": "object_manipulator.convert_functions", "arg_names": [], "import_names": ["cf"], "rhs_call_name": "", "annotation": ""}, "snippet": "import object_manipulator.convert_functions as cf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:ImportFrom_L14_C0", "label": "from object_manipulator.cluster_bounding_box_finder import ClusterBoundingBoxFinder", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0579, 0.0041, 0, 0.66, 0.5882, 173, 0, 1, 0, 0, 173, 0, 0], "semantic": {"name": "object_manipulator.cluster_bounding_box_finder", "arg_names": [], "import_names": ["ClusterBoundingBoxFinder"], "rhs_call_name": "", "annotation": ""}, "snippet": "from object_manipulator.cluster_bounding_box_finder import ClusterBoundingBoxFinder"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:ImportFrom_L15_C0", "label": "from tabletop_object_detector.srv import TabletopSegmentation", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.062, 0.0041, 0, 0.66, 0.6471, 763, 0, 1, 0, 0, 763, 0, 0], "semantic": {"name": "tabletop_object_detector.srv", "arg_names": [], "import_names": ["TabletopSegmentation"], "rhs_call_name": "", "annotation": ""}, "snippet": "from tabletop_object_detector.srv import TabletopSegmentation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:ImportFrom_L16_C0", "label": "from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0661, 0.0041, 0, 0.66, 0.7059, 457, 0, 2, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["PointHeadAction", "PointHeadGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:ImportFrom_L18_C0", "label": "from pr2_grasp_behaviors.msg import OverheadGraspAction, OverheadGraspResult", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0744, 0.0041, 0, 0.66, 0.7647, 212, 0, 2, 0, 0, 212, 0, 0], "semantic": {"name": "pr2_grasp_behaviors.msg", "arg_names": [], "import_names": ["OverheadGraspAction", "OverheadGraspResult"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_grasp_behaviors.msg import OverheadGraspAction, OverheadGraspResult"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:ImportFrom_L19_C0", "label": "from pr2_grasp_behaviors.msg import OverheadGraspSetupAction, OverheadGraspSetupResult", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0785, 0.0041, 0, 0.66, 0.8235, 212, 0, 2, 0, 0, 212, 0, 0], "semantic": {"name": "pr2_grasp_behaviors.msg", "arg_names": [], "import_names": ["OverheadGraspSetupAction", "OverheadGraspSetupResult"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_grasp_behaviors.msg import OverheadGraspSetupAction, OverheadGraspSetupResult"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:ImportFrom_L20_C0", "label": "from pr2_grasp_behaviors.msg import OverheadGraspFeedback", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0826, 0.0041, 0, 0.66, 0.8824, 212, 0, 1, 0, 0, 212, 0, 0], "semantic": {"name": "pr2_grasp_behaviors.msg", "arg_names": [], "import_names": ["OverheadGraspFeedback"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_grasp_behaviors.msg import OverheadGraspFeedback "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L24_C0", "label": "GraspStates", "type": "class", "loc": [24, 31], "level": 0, "parent": null, "vector": [3, 0, 0.1136, 0.0331, 0, 0.66, 0.9412, 936, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "GraspStates", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class GraspStates:\n ACTIONLIB_CALLED = 'Actionlib grasping goal called'\n PERCEIVING_OBJECTS = 'Perceiving table objects'\n GRASP_SETUP_MOVE = 'Moving to grasp setup'\n EXECUTE_APPROACH = 'Executing grasp motion'\n GRASP_OBJECT = 'Closing gripper on object'\n EXECUTE_RETREAT = 'Retreating grasp motion'\n ACTIONLIB_COMPLETE = 'Actionlib grasping goal completed'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L25_C4", "label": "ACTIONLIB_CALLED =", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L24_C0", "vector": [14, 1, 0.1033, 0.0041, 1, 0.53, 0.0, 148, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ACTIONLIB_CALLED", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ACTIONLIB_CALLED = 'Actionlib grasping goal called'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L26_C4", "label": "PERCEIVING_OBJECTS =", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L24_C0", "vector": [14, 1, 0.1074, 0.0041, 1, 0.53, 0.1667, 126, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "PERCEIVING_OBJECTS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " PERCEIVING_OBJECTS = 'Perceiving table objects'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L27_C4", "label": "GRASP_SETUP_MOVE =", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L24_C0", "vector": [14, 1, 0.1116, 0.0041, 1, 0.53, 0.3333, 902, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "GRASP_SETUP_MOVE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " GRASP_SETUP_MOVE = 'Moving to grasp setup'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L28_C4", "label": "EXECUTE_APPROACH =", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L24_C0", "vector": [14, 1, 0.1157, 0.0041, 1, 0.53, 0.5, 196, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "EXECUTE_APPROACH", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " EXECUTE_APPROACH = 'Executing grasp motion'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L29_C4", "label": "GRASP_OBJECT =", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L24_C0", "vector": [14, 1, 0.1198, 0.0041, 1, 0.53, 0.6667, 133, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "GRASP_OBJECT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " GRASP_OBJECT = 'Closing gripper on object'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L30_C4", "label": "EXECUTE_RETREAT =", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L24_C0", "vector": [14, 1, 0.124, 0.0041, 1, 0.53, 0.8333, 954, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "EXECUTE_RETREAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " EXECUTE_RETREAT = 'Retreating grasp motion'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L31_C4", "label": "ACTIONLIB_COMPLETE =", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L24_C0", "vector": [14, 1, 0.1281, 0.0041, 1, 0.53, 1.0, 804, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ACTIONLIB_COMPLETE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ACTIONLIB_COMPLETE = 'Actionlib grasping goal completed'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L33_C0", "label": "GraspBehaviorServer", "type": "class", "loc": [33, 242], "level": 0, "parent": null, "vector": [3, 0, 0.5682, 0.8678, 0, 0.66, 1.0, 22, 0, 12, 0, 0, 186, 0, 73], "semantic": {"name": "GraspBehaviorServer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class GraspBehaviorServer(object):\n def __init__(self, arm, grasp_manager):\n self.arm = arm\n self.gman = grasp_manager\n\n ##\n # Open gripper fully.\n def open_gripper(self, blocking = False):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L34_C4", "label": "__init__", "type": "function", "loc": [34, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L33_C0", "vector": [2, 1, 0.1446, 0.0124, 1, 0.72, 0.0, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "arm", "grasp_manager"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arm, grasp_manager):\n self.arm = arm\n self.gman = grasp_manager"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L35_C8", "label": "self.arm =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L34_C4", "vector": [14, 2, 0.1446, 0.0041, 2, 0.1, 0.0, 720, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm = arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L36_C8", "label": "self.gman =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L34_C4", "vector": [14, 2, 0.1488, 0.0041, 2, 0.1, 1.0, 215, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.gman", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.gman = grasp_manager"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L40_C4", "label": "open_gripper", "type": "function", "loc": [40, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L33_C0", "vector": [2, 1, 0.1715, 0.0165, 1, 0.72, 0.1111, 833, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "open_gripper", "arg_names": ["self", "blocking"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def open_gripper(self, blocking = False):\n self.gman.cm.command_gripper(1.0, -1.0, False)\n if blocking:\n self.gman.cm.gripper_action_client.wait_for_result(rospy.Duration(4.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L41_C8", "label": "command_gripper()", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L40_C4", "vector": [8, 2, 0.1694, 0.0041, 2, 0.58, 0.0, 250, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "command_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "command_gripper", "annotation": ""}, "snippet": " self.gman.cm.command_gripper(1.0, -1.0, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L42_C8", "label": "if", "type": "if", "loc": [42, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L40_C4", "vector": [4, 2, 0.1756, 0.0083, 2, 0.58, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if blocking:\n self.gman.cm.gripper_action_client.wait_for_result(rospy.Duration(4.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L43_C12", "label": "wait_for_result()", "type": "expression", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L42_C8", "vector": [8, 3, 0.1777, 0.0041, 3, 0.15, 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.gman.cm.gripper_action_client.wait_for_result(rospy.Duration(4.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L49_C4", "label": "detect_tabletop_objects", "type": "function", "loc": [49, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L33_C0", "vector": [2, 1, 0.2583, 0.1157, 1, 0.72, 0.2222, 463, 0, 1, 1, 0, 0, 0, 9], "semantic": {"name": "detect_tabletop_objects", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def detect_tabletop_objects(self):\n DETECT_ERROR = 0.\n cbbf = ClusterBoundingBoxFinder(tf_listener=self.gman.cm.tf_listener)\n object_detector = rospy.ServiceProxy(\"/object_detection\", TabletopSegmentation)\n try:\n detects = object_detector()\n object_detector.close()\n except ServiceException as se:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L50_C8", "label": "DETECT_ERROR =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L49_C4", "vector": [14, 2, 0.2066, 0.0041, 2, 0.73, 0.0, 77, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "DETECT_ERROR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " DETECT_ERROR = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L51_C8", "label": "cbbf = ClusterBoundingBoxFinder()", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L49_C4", "vector": [14, 2, 0.2107, 0.0041, 2, 0.73, 0.125, 428, 3, 1, 0, 0, 518, 10, 1], "semantic": {"name": "cbbf", "arg_names": [], "import_names": [], "rhs_call_name": "ClusterBoundingBoxFinder", "annotation": ""}, "snippet": " cbbf = ClusterBoundingBoxFinder(tf_listener=self.gman.cm.tf_listener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L52_C8", "label": "object_detector = ServiceProxy()", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L49_C4", "vector": [14, 2, 0.2149, 0.0041, 2, 0.73, 0.25, 484, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "object_detector", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " object_detector = rospy.ServiceProxy(\"/object_detection\", TabletopSegmentation)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L53_C8", "label": "try", "type": "try", "loc": [53, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L49_C4", "vector": [7, 2, 0.2293, 0.0248, 2, 0.73, 0.375, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n detects = object_detector()\n object_detector.close()\n except ServiceException as se:\n rospy.logerr(\"Tabletop segmentation crashed\")\n return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L54_C12", "label": "detects = object_detector()", "type": "assigned_variable", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L53_C8", "vector": [14, 3, 0.2231, 0.0041, 3, 0.99, 0.0, 200, 3, 0, 0, 0, 484, 10, 1], "semantic": {"name": "detects", "arg_names": [], "import_names": [], "rhs_call_name": "object_detector", "annotation": ""}, "snippet": " detects = object_detector()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L55_C12", "label": "close()", "type": "expression", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L53_C8", "vector": [8, 3, 0.2273, 0.0041, 3, 0.99, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " object_detector.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L57_C12", "label": "logerr()", "type": "expression", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L53_C8", "vector": [8, 3, 0.2355, 0.0041, 3, 0.99, 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(\"Tabletop segmentation crashed\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L58_C12", "label": "return", "type": "return", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L53_C8", "vector": [13, 3, 0.2397, 0.0041, 3, 0.99, 1.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L59_C8", "label": "if", "type": "if", "loc": [59, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L49_C4", "vector": [4, 2, 0.2479, 0.0124, 2, 0.73, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if detects.result != 4:\n rospy.logerr(\"Detection failed (err %d)\" % (detects.result))\n return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L60_C12", "label": "logerr()", "type": "expression", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L59_C8", "vector": [8, 3, 0.2479, 0.0041, 3, 0.01, 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(\"Detection failed (err %d)\" % (detects.result))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L61_C12", "label": "return", "type": "return", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L59_C8", "vector": [13, 3, 0.2521, 0.0041, 3, 0.01, 1.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L62_C8", "label": "table_z =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L49_C4", "vector": [14, 2, 0.2562, 0.0041, 2, 0.73, 0.625, 93, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "table_z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " table_z = detects.table.pose.pose.position.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L63_C8", "label": "objects =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L49_C4", "vector": [14, 2, 0.2603, 0.0041, 2, 0.73, 0.75, 550, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "objects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " objects = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:For_L64_C8", "label": "for cluster", "type": "for", "loc": [64, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L49_C4", "vector": [6, 2, 0.2872, 0.0496, 2, 0.73, 0.875, 446, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "cluster", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for cluster in detects.clusters:\n (object_points, \n object_bounding_box_dims, \n object_bounding_box, \n object_to_base_link_frame, \n object_to_cluster_frame) = cbbf.find_object_frame_and_bounding_box(cluster)\n # rospy.loginfo(\"bounding box:\", object_bounding_box)\n (object_pos, object_quat) = cf.mat_to_pos_and_quat(object_to_cluster_frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L65_C12", "label": "object_points, object_bounding_box_dims, object_bounding_box, object_to_base_link_frame, object_to_cluster_frame = find_object_frame_and_bounding_box()", "type": "assigned_variable", "loc": [65, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:For_L64_C8", "vector": [14, 3, 0.2769, 0.0207, 3, 0.88, 0.0, 499, 3, 1, 0, 0, 584, 10, 1], "semantic": {"name": "object_points, object_bounding_box_dims, object_bounding_box, object_to_base_link_frame, object_to_cluster_frame", "arg_names": [], "import_names": [], "rhs_call_name": "find_object_frame_and_bounding_box", "annotation": ""}, "snippet": " (object_points, \n object_bounding_box_dims, \n object_bounding_box, \n object_to_base_link_frame, \n object_to_cluster_frame) = cbbf.find_object_frame_and_bounding_box(cluster)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L71_C12", "label": "object_pos, object_quat = mat_to_pos_and_quat()", "type": "assigned_variable", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:For_L64_C8", "vector": [14, 3, 0.2934, 0.0041, 3, 0.88, 0.3333, 564, 3, 1, 0, 0, 711, 10, 1], "semantic": {"name": "object_pos, object_quat", "arg_names": [], "import_names": [], "rhs_call_name": "mat_to_pos_and_quat", "annotation": ""}, "snippet": " (object_pos, object_quat) = cf.mat_to_pos_and_quat(object_to_cluster_frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L72_C12", "label": "angs = euler_from_quaternion()", "type": "assigned_variable", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:For_L64_C8", "vector": [14, 3, 0.2975, 0.0041, 3, 0.88, 0.6667, 510, 3, 1, 0, 0, 409, 10, 1], "semantic": {"name": "angs", "arg_names": [], "import_names": [], "rhs_call_name": "euler_from_quaternion", "annotation": ""}, "snippet": " angs = euler_from_quaternion(object_quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L74_C12", "label": "assign", "type": "assigned_variable", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:For_L64_C8", "vector": [14, 3, 0.3058, 0.0041, 3, 0.88, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " object_pos[2] = table_z + object_bounding_box[1][2] / 2. + DETECT_ERROR"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L76_C8", "label": "return", "type": "return", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L49_C4", "vector": [13, 2, 0.314, 0.0041, 2, 0.73, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return objects"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L78_C4", "label": "get_grasp_loc", "type": "function", "loc": [78, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L33_C0", "vector": [2, 1, 0.3244, 0.0083, 1, 0.72, 0.3333, 507, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "get_grasp_loc", "arg_names": ["self", "obj"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_grasp_loc(self, obj):\n return obj[0][0], obj[0][1], obj[1], obj[0][2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L79_C8", "label": "return", "type": "return", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L78_C4", "vector": [13, 2, 0.3264, 0.0041, 2, 0.34, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return obj[0][0], obj[0][1], obj[1], obj[0][2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L84_C4", "label": "detect_closest_object", "type": "function", "loc": [84, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L33_C0", "vector": [2, 1, 0.438, 0.186, 1, 0.72, 0.4444, 444, 0, 5, 1, 0, 0, 0, 18], "semantic": {"name": "detect_closest_object", "arg_names": ["self", "x", "y", "repeat", "disable_head"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def detect_closest_object(self, x, y, repeat=True, disable_head=False):\n def dist(o):\n return (o[0][0] - x) ** 2 + (o[0][1] - y) ** 2\n\n grasped = False\n num_tries = 0\n\n if not disable_head:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L85_C8", "label": "dist", "type": "function", "loc": [85, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L84_C4", "vector": [2, 2, 0.3533, 0.0083, 2, 0.63, 0.0, 673, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "dist", "arg_names": ["o"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def dist(o):\n return (o[0][0] - x) ** 2 + (o[0][1] - y) ** 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L86_C12", "label": "return", "type": "return", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L85_C8", "vector": [13, 3, 0.3554, 0.0041, 3, 0.83, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (o[0][0] - x) ** 2 + (o[0][1] - y) ** 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L88_C8", "label": "grasped =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L84_C4", "vector": [14, 2, 0.3636, 0.0041, 2, 0.63, 0.2, 785, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "grasped", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasped = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L89_C8", "label": "num_tries =", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L84_C4", "vector": [14, 2, 0.3678, 0.0041, 2, 0.63, 0.4, 388, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "num_tries", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " num_tries = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L91_C8", "label": "if", "type": "if", "loc": [91, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L84_C4", "vector": [4, 2, 0.3781, 0.0083, 2, 0.63, 0.6, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not disable_head:\n self.point_head([x,y,-0.3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L92_C12", "label": "point_head()", "type": "expression", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L91_C8", "vector": [8, 3, 0.3802, 0.0041, 3, 0.1, 0.0, 553, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "point_head", "arg_names": [], "import_names": [], "rhs_call_name": "point_head", "annotation": ""}, "snippet": " self.point_head([x,y,-0.3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:While_L94_C8", "label": "while", "type": "while", "loc": [94, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L84_C4", "vector": [5, 2, 0.4566, 0.1405, 2, 0.63, 0.8, 0, 0, 0, 0, 0, 0, 0, 17], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not grasped and num_tries < 4:\n rospy.loginfo(\"Detect in\")\n rospy.sleep(0.6)\n detect_tries = 0\n objects = None\n while (objects is None or len(objects) == 0):\n objects = self.detect_tabletop_objects()\n rospy.sleep(0.6)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L95_C12", "label": "loginfo()", "type": "expression", "loc": [95, 95], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:While_L94_C8", "vector": [8, 3, 0.3926, 0.0041, 3, 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(\"Detect in\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L96_C12", "label": "sleep()", "type": "expression", "loc": [96, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:While_L94_C8", "vector": [8, 3, 0.3967, 0.0041, 3, 0.24, 0.1667, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(0.6)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L97_C12", "label": "detect_tries =", "type": "assigned_variable", "loc": [97, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:While_L94_C8", "vector": [14, 3, 0.4008, 0.0041, 3, 0.24, 0.3333, 616, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "detect_tries", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " detect_tries = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L98_C12", "label": "objects =", "type": "assigned_variable", "loc": [98, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:While_L94_C8", "vector": [14, 3, 0.405, 0.0041, 3, 0.24, 0.5, 550, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "objects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " objects = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:While_L99_C12", "label": "while", "type": "while", "loc": [99, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:While_L94_C8", "vector": [5, 3, 0.4215, 0.0289, 3, 0.24, 0.6667, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while (objects is None or len(objects) == 0):\n objects = self.detect_tabletop_objects()\n rospy.sleep(0.6)\n detect_tries += 1\n if detect_tries == 3 and (objects is None or len(objects) == 0):\n rospy.logerr(\"Cannot detect any objects\")\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L100_C16", "label": "objects = detect_tabletop_objects()", "type": "assigned_variable", "loc": [100, 100], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:While_L99_C12", "vector": [14, 4, 0.4132, 0.0041, 4, 0.69, 0.0, 550, 3, 0, 0, 0, 463, 10, 1], "semantic": {"name": "objects", "arg_names": [], "import_names": [], "rhs_call_name": "detect_tabletop_objects", "annotation": ""}, "snippet": " objects = self.detect_tabletop_objects()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L101_C16", "label": "sleep()", "type": "expression", "loc": [101, 101], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:While_L99_C12", "vector": [8, 4, 0.4174, 0.0041, 4, 0.69, 0.5, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(0.6)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L103_C16", "label": "if", "type": "if", "loc": [103, 105], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:While_L99_C12", "vector": [4, 4, 0.4298, 0.0124, 4, 0.69, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if detect_tries == 3 and (objects is None or len(objects) == 0):\n rospy.logerr(\"Cannot detect any objects\")\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L104_C20", "label": "logerr()", "type": "expression", "loc": [104, 104], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L103_C16", "vector": [8, 5, 0.4298, 0.0041, 5, 0.37, 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(\"Cannot detect any objects\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L105_C20", "label": "return", "type": "return", "loc": [105, 105], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L103_C16", "vector": [13, 5, 0.4339, 0.0041, 5, 0.37, 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_99343:Expr_L106_C12", "label": "loginfo()", "type": "expression", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:While_L94_C8", "vector": [8, 3, 0.438, 0.0041, 3, 0.24, 0.8333, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"Detect out\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L107_C12", "label": "if", "type": "if", "loc": [107, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:While_L94_C8", "vector": [4, 3, 0.4835, 0.0868, 3, 0.24, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(objects) > 0:\n try:\n obj = min(objects, key=dist)\n\n # Get better look\n if not disable_head:\n obj_pt = obj[0]\n obj_pt[2] = -0.4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L108_C16", "label": "try", "type": "try", "loc": [108, 122], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L107_C12", "vector": [7, 4, 0.4752, 0.062, 4, 0.46, 0.0, 0, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n obj = min(objects, key=dist)\n\n # Get better look\n if not disable_head:\n obj_pt = obj[0]\n obj_pt[2] = -0.4\n self.point_head(obj_pt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L109_C20", "label": "obj = min()", "type": "assigned_variable", "loc": [109, 109], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L108_C16", "vector": [14, 5, 0.4504, 0.0041, 5, 0.56, 0.0, 505, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " obj = min(objects, key=dist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L112_C20", "label": "if", "type": "if", "loc": [112, 115], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L108_C16", "vector": [4, 5, 0.469, 0.0165, 5, 0.56, 0.1667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not disable_head:\n obj_pt = obj[0]\n obj_pt[2] = -0.4\n self.point_head(obj_pt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L113_C24", "label": "obj_pt =", "type": "assigned_variable", "loc": [113, 113], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L112_C20", "vector": [14, 6, 0.4669, 0.0041, 6, 0.31, 0.0, 791, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "obj_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " obj_pt = obj[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L114_C24", "label": "assign", "type": "assigned_variable", "loc": [114, 114], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L112_C20", "vector": [14, 6, 0.4711, 0.0041, 6, 0.31, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " obj_pt[2] = -0.4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L115_C24", "label": "point_head()", "type": "expression", "loc": [115, 115], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L112_C20", "vector": [8, 6, 0.4752, 0.0041, 6, 0.31, 1.0, 553, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "point_head", "arg_names": [], "import_names": [], "rhs_call_name": "point_head", "annotation": ""}, "snippet": " self.point_head(obj_pt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L116_C20", "label": "sleep()", "type": "expression", "loc": [116, 116], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L108_C16", "vector": [8, 5, 0.4793, 0.0041, 5, 0.56, 0.3333, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(0.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L117_C20", "label": "loginfo()", "type": "expression", "loc": [117, 117], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L108_C16", "vector": [8, 5, 0.4835, 0.0041, 5, 0.56, 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(\"Detect2 in\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L118_C20", "label": "objects = detect_tabletop_objects()", "type": "assigned_variable", "loc": [118, 118], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L108_C16", "vector": [14, 5, 0.4876, 0.0041, 5, 0.56, 0.6667, 550, 3, 0, 0, 0, 463, 10, 1], "semantic": {"name": "objects", "arg_names": [], "import_names": [], "rhs_call_name": "detect_tabletop_objects", "annotation": ""}, "snippet": " objects = self.detect_tabletop_objects()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L119_C20", "label": "loginfo()", "type": "expression", "loc": [119, 119], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L108_C16", "vector": [8, 5, 0.4917, 0.0041, 5, 0.56, 0.8333, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"Detect2 out\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L120_C20", "label": "obj = min()", "type": "assigned_variable", "loc": [120, 120], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L108_C16", "vector": [14, 5, 0.4959, 0.0041, 5, 0.56, 1.0, 505, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " obj = min(objects, key=dist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L124_C16", "label": "return", "type": "return", "loc": [124, 124], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L107_C12", "vector": [13, 4, 0.5124, 0.0041, 4, 0.46, 0.3333, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L126_C16", "label": "loginfo()", "type": "expression", "loc": [126, 126], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L107_C12", "vector": [8, 4, 0.5207, 0.0041, 4, 0.46, 0.6667, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"No objects near point\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L127_C16", "label": "return", "type": "return", "loc": [127, 127], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L107_C12", "vector": [13, 4, 0.5248, 0.0041, 4, 0.46, 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_99343:Return_L128_C8", "label": "return", "type": "return", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L84_C4", "vector": [13, 2, 0.5289, 0.0041, 2, 0.63, 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_99343:FunctionDef_L132_C4", "label": "point_head", "type": "function", "loc": [132, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L33_C0", "vector": [2, 1, 0.5847, 0.0826, 1, 0.72, 0.5556, 553, 0, 5, 1, 0, 0, 0, 9], "semantic": {"name": "point_head", "arg_names": ["self", "point", "velocity", "frame", "block"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def point_head(self, point, velocity = 0.6, frame=\"/torso_lift_link\", block = True):\n head_action_client = actionlib.SimpleActionClient(\"/head_traj_controller/point_head_action\", PointHeadAction)\n head_action_client.wait_for_server()\n goal = PointHeadGoal()\n goal.target = cf.create_point_stamped(point, frame)\n goal.pointing_frame = \"/openni_rgb_optical_frame\"\n goal.max_velocity = velocity\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L133_C8", "label": "head_action_client = SimpleActionClient()", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L132_C4", "vector": [14, 2, 0.5496, 0.0041, 2, 0.52, 0.0, 410, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "head_action_client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " head_action_client = actionlib.SimpleActionClient(\"/head_traj_controller/point_head_action\", PointHeadAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L134_C8", "label": "wait_for_server()", "type": "expression", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L132_C4", "vector": [8, 2, 0.5537, 0.0041, 2, 0.52, 0.1, 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": " head_action_client.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L135_C8", "label": "goal = PointHeadGoal()", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L132_C4", "vector": [14, 2, 0.5579, 0.0041, 2, 0.52, 0.2, 914, 3, 0, 0, 0, 479, 10, 1], "semantic": {"name": "goal", "arg_names": [], "import_names": [], "rhs_call_name": "PointHeadGoal", "annotation": ""}, "snippet": " goal = PointHeadGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L136_C8", "label": "goal.target = create_point_stamped()", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L132_C4", "vector": [14, 2, 0.562, 0.0041, 2, 0.52, 0.3, 730, 3, 2, 0, 0, 184, 10, 1], "semantic": {"name": "goal.target", "arg_names": [], "import_names": [], "rhs_call_name": "create_point_stamped", "annotation": ""}, "snippet": " goal.target = cf.create_point_stamped(point, frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L137_C8", "label": "goal.pointing_frame =", "type": "assigned_variable", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L132_C4", "vector": [14, 2, 0.5661, 0.0041, 2, 0.52, 0.4, 177, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "goal.pointing_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.pointing_frame = \"/openni_rgb_optical_frame\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L138_C8", "label": "goal.max_velocity =", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L132_C4", "vector": [14, 2, 0.5702, 0.0041, 2, 0.52, 0.5, 950, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.max_velocity", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.max_velocity = velocity"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L140_C8", "label": "send_goal()", "type": "expression", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L132_C4", "vector": [8, 2, 0.5785, 0.0041, 2, 0.52, 0.6, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " head_action_client.send_goal(goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L142_C8", "label": "if", "type": "if", "loc": [142, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L132_C4", "vector": [4, 2, 0.5888, 0.0083, 2, 0.52, 0.7, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not block:\n return 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L143_C12", "label": "return", "type": "return", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L142_C8", "vector": [13, 3, 0.5909, 0.0041, 3, 0.51, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L145_C8", "label": "finished_within_time = wait_for_result()", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L132_C4", "vector": [14, 2, 0.5992, 0.0041, 2, 0.52, 0.8, 778, 3, 1, 0, 0, 328, 10, 2], "semantic": {"name": "finished_within_time", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_result", "annotation": ""}, "snippet": " finished_within_time = head_action_client.wait_for_result(rospy.Duration(10))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L146_C8", "label": "if", "type": "if", "loc": [146, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L132_C4", "vector": [4, 2, 0.6095, 0.0165, 2, 0.52, 0.9, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not finished_within_time:\n head_action_client.cancel_goal()\n rospy.logerr(\"timed out when asking the head to point to a new goal\")\n return 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L147_C12", "label": "cancel_goal()", "type": "expression", "loc": [147, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L146_C8", "vector": [8, 3, 0.6074, 0.0041, 3, 0.11, 0.0, 349, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel_goal", "arg_names": [], "import_names": [], "rhs_call_name": "cancel_goal", "annotation": ""}, "snippet": " head_action_client.cancel_goal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L148_C12", "label": "logerr()", "type": "expression", "loc": [148, 148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L146_C8", "vector": [8, 3, 0.6116, 0.0041, 3, 0.11, 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(\"timed out when asking the head to point to a new goal\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L149_C12", "label": "return", "type": "return", "loc": [149, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L146_C8", "vector": [13, 3, 0.6157, 0.0041, 3, 0.11, 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_99343:Return_L151_C8", "label": "return", "type": "return", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L132_C4", "vector": [13, 2, 0.624, 0.0041, 2, 0.52, 1.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L155_C4", "label": "setup_grasp", "type": "function", "loc": [155, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L33_C0", "vector": [2, 1, 0.657, 0.0372, 1, 0.72, 0.6667, 69, 0, 4, 0, 0, 0, 0, 5], "semantic": {"name": "setup_grasp", "arg_names": ["self", "block", "disable_head", "open_gripper"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setup_grasp(self, block = False, disable_head=False, open_gripper=False):\n if open_gripper:\n self.open_gripper(blocking=False)\n if not disable_head:\n self.point_head([0.3, 0.0, -0.3], block=False)\n self.gman.grasp_preparation_move()\n rospy.sleep(1.)\n if block:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L156_C8", "label": "if", "type": "if", "loc": [156, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L155_C4", "vector": [4, 2, 0.6467, 0.0083, 2, 0.31, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if open_gripper:\n self.open_gripper(blocking=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L157_C12", "label": "open_gripper()", "type": "expression", "loc": [157, 157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L156_C8", "vector": [8, 3, 0.6488, 0.0041, 3, 0.66, 0.0, 833, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "open_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "open_gripper", "annotation": ""}, "snippet": " self.open_gripper(blocking=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L158_C8", "label": "if", "type": "if", "loc": [158, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L155_C4", "vector": [4, 2, 0.655, 0.0083, 2, 0.31, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not disable_head:\n self.point_head([0.3, 0.0, -0.3], block=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L159_C12", "label": "point_head()", "type": "expression", "loc": [159, 159], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L158_C8", "vector": [8, 3, 0.657, 0.0041, 3, 0.76, 0.0, 553, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "point_head", "arg_names": [], "import_names": [], "rhs_call_name": "point_head", "annotation": ""}, "snippet": " self.point_head([0.3, 0.0, -0.3], block=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L160_C8", "label": "grasp_preparation_move()", "type": "expression", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L155_C4", "vector": [8, 2, 0.6612, 0.0041, 2, 0.31, 0.5, 292, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "grasp_preparation_move", "arg_names": [], "import_names": [], "rhs_call_name": "grasp_preparation_move", "annotation": ""}, "snippet": " self.gman.grasp_preparation_move()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L161_C8", "label": "sleep()", "type": "expression", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L155_C4", "vector": [8, 2, 0.6653, 0.0041, 2, 0.31, 0.75, 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_99343:If_L162_C8", "label": "if", "type": "if", "loc": [162, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L155_C4", "vector": [4, 2, 0.6715, 0.0083, 2, 0.31, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if block:\n self.gman.arm_moving_wait(True, 8.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L163_C12", "label": "arm_moving_wait()", "type": "expression", "loc": [163, 163], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L162_C8", "vector": [8, 3, 0.6736, 0.0041, 3, 0.64, 0.0, 771, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "arm_moving_wait", "arg_names": [], "import_names": [], "rhs_call_name": "arm_moving_wait", "annotation": ""}, "snippet": " self.gman.arm_moving_wait(True, 8.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L167_C4", "label": "start_grasping_server", "type": "function", "loc": [167, 175], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L33_C0", "vector": [2, 1, 0.7066, 0.0372, 1, 0.72, 0.7778, 892, 0, 3, 0, 0, 0, 0, 7], "semantic": {"name": "start_grasping_server", "arg_names": ["self", "grasp_server_name", "setup_server_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_grasping_server(self, grasp_server_name, setup_server_name):\n self.grasping_server = actionlib.SimpleActionServer(grasp_server_name, OverheadGraspAction, self.execute_grasping_goal, False)\n self.grasping_server.register_preempt_callback(self.gman.kill_arm_movement)\n self.grasping_server.start()\n self.setup_server = actionlib.SimpleActionServer(setup_server_name, OverheadGraspSetupAction, self.execute_grasping_setup, False)\n self.setup_server.register_preempt_callback(self.gman.kill_arm_movement)\n self.setup_server.start()\n rospy.loginfo(\"Grasping server launched on %s, setup at %s\", "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L168_C8", "label": "self.grasping_server = SimpleActionServer()", "type": "assigned_variable", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L167_C4", "vector": [14, 2, 0.6942, 0.0041, 2, 0.92, 0.0, 41, 3, 4, 0, 0, 975, 10, 1], "semantic": {"name": "self.grasping_server", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionServer", "annotation": ""}, "snippet": " self.grasping_server = actionlib.SimpleActionServer(grasp_server_name, OverheadGraspAction, self.execute_grasping_goal, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L169_C8", "label": "register_preempt_callback()", "type": "expression", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L167_C4", "vector": [8, 2, 0.6983, 0.0041, 2, 0.92, 0.1667, 758, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "register_preempt_callback", "arg_names": [], "import_names": [], "rhs_call_name": "register_preempt_callback", "annotation": ""}, "snippet": " self.grasping_server.register_preempt_callback(self.gman.kill_arm_movement)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L170_C8", "label": "start()", "type": "expression", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L167_C4", "vector": [8, 2, 0.7025, 0.0041, 2, 0.92, 0.3333, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.grasping_server.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L171_C8", "label": "self.setup_server = SimpleActionServer()", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L167_C4", "vector": [14, 2, 0.7066, 0.0041, 2, 0.92, 0.5, 55, 3, 4, 0, 0, 975, 10, 1], "semantic": {"name": "self.setup_server", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionServer", "annotation": ""}, "snippet": " self.setup_server = actionlib.SimpleActionServer(setup_server_name, OverheadGraspSetupAction, self.execute_grasping_setup, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L172_C8", "label": "register_preempt_callback()", "type": "expression", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L167_C4", "vector": [8, 2, 0.7107, 0.0041, 2, 0.92, 0.6667, 758, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "register_preempt_callback", "arg_names": [], "import_names": [], "rhs_call_name": "register_preempt_callback", "annotation": ""}, "snippet": " self.setup_server.register_preempt_callback(self.gman.kill_arm_movement)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L173_C8", "label": "start()", "type": "expression", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L167_C4", "vector": [8, 2, 0.7149, 0.0041, 2, 0.92, 0.8333, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.setup_server.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L174_C8", "label": "loginfo()", "type": "expression", "loc": [174, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L167_C4", "vector": [8, 2, 0.7211, 0.0083, 2, 0.92, 1.0, 607, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"Grasping server launched on %s, setup at %s\", \n grasp_server_name, setup_server_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L179_C4", "label": "execute_grasping_setup", "type": "function", "loc": [179, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L33_C0", "vector": [2, 1, 0.7479, 0.0207, 1, 0.72, 0.8889, 482, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "execute_grasping_setup", "arg_names": ["self", "goal"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute_grasping_setup(self, goal):\n result = OverheadGraspSetupResult()\n self.setup_grasp(block=True, disable_head=goal.disable_head, open_gripper=goal.open_gripper)\n rospy.loginfo(\"Finished setup\")\n self.setup_server.set_succeeded(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L180_C8", "label": "result = OverheadGraspSetupResult()", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L179_C4", "vector": [14, 2, 0.7438, 0.0041, 2, 0.96, 0.0, 51, 3, 0, 0, 0, 262, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "OverheadGraspSetupResult", "annotation": ""}, "snippet": " result = OverheadGraspSetupResult()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L181_C8", "label": "setup_grasp()", "type": "expression", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L179_C4", "vector": [8, 2, 0.7479, 0.0041, 2, 0.96, 0.3333, 69, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setup_grasp", "arg_names": [], "import_names": [], "rhs_call_name": "setup_grasp", "annotation": ""}, "snippet": " self.setup_grasp(block=True, disable_head=goal.disable_head, open_gripper=goal.open_gripper)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L182_C8", "label": "loginfo()", "type": "expression", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L179_C4", "vector": [8, 2, 0.7521, 0.0041, 2, 0.96, 0.6667, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"Finished setup\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L183_C8", "label": "set_succeeded()", "type": "expression", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L179_C4", "vector": [8, 2, 0.7562, 0.0041, 2, 0.96, 1.0, 825, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_succeeded", "arg_names": [], "import_names": [], "rhs_call_name": "set_succeeded", "annotation": ""}, "snippet": " self.setup_server.set_succeeded(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L189_C4", "label": "execute_grasping_goal", "type": "function", "loc": [189, 242], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L33_C0", "vector": [2, 1, 0.8905, 0.2231, 1, 0.72, 1.0, 577, 0, 2, 0, 0, 0, 0, 18], "semantic": {"name": "execute_grasping_goal", "arg_names": ["self", "goal"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute_grasping_goal(self, goal):\n result = OverheadGraspResult()\n feedback = OverheadGraspFeedback()\n def publish_state(state):\n feedback.state = state\n self.grasping_server.publish_feedback(feedback)\n publish_state(GraspStates.ACTIONLIB_CALLED)\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L190_C8", "label": "result = OverheadGraspResult()", "type": "assigned_variable", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L189_C4", "vector": [14, 2, 0.7851, 0.0041, 2, 0.36, 0.0, 51, 3, 0, 0, 0, 976, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "OverheadGraspResult", "annotation": ""}, "snippet": " result = OverheadGraspResult()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L191_C8", "label": "feedback = OverheadGraspFeedback()", "type": "assigned_variable", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L189_C4", "vector": [14, 2, 0.7893, 0.0041, 2, 0.36, 0.1, 918, 3, 0, 0, 0, 31, 10, 1], "semantic": {"name": "feedback", "arg_names": [], "import_names": [], "rhs_call_name": "OverheadGraspFeedback", "annotation": ""}, "snippet": " feedback = OverheadGraspFeedback()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L192_C8", "label": "publish_state", "type": "function", "loc": [192, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L189_C4", "vector": [2, 2, 0.7975, 0.0124, 2, 0.36, 0.2, 843, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish_state", "arg_names": ["state"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def publish_state(state):\n feedback.state = state\n self.grasping_server.publish_feedback(feedback)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L193_C12", "label": "feedback.state =", "type": "assigned_variable", "loc": [193, 193], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L192_C8", "vector": [14, 3, 0.7975, 0.0041, 3, 0.92, 0.0, 171, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "feedback.state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " feedback.state = state"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L194_C12", "label": "publish_feedback()", "type": "expression", "loc": [194, 194], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L192_C8", "vector": [8, 3, 0.8017, 0.0041, 3, 0.92, 1.0, 56, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish_feedback", "arg_names": [], "import_names": [], "rhs_call_name": "publish_feedback", "annotation": ""}, "snippet": " self.grasping_server.publish_feedback(feedback)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L195_C8", "label": "publish_state()", "type": "expression", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L189_C4", "vector": [8, 2, 0.8058, 0.0041, 2, 0.36, 0.3, 843, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish_state", "arg_names": [], "import_names": [], "rhs_call_name": "publish_state", "annotation": ""}, "snippet": " publish_state(GraspStates.ACTIONLIB_CALLED)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L198_C8", "label": "if", "type": "if", "loc": [198, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L189_C4", "vector": [4, 2, 0.8678, 0.1033, 2, 0.36, 0.4, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if goal.grasp_type == goal.MANUAL_GRASP:\n grasp_params = (goal.x, goal.y, goal.roll, goal.pitch)\n\n # Robot finds parameters\n elif goal.grasp_type == goal.VISION_GRASP:\n obj = self.detect_closest_object(goal.x, \n goal.y, \n disable_head=goal.disable_head)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L199_C12", "label": "grasp_params =", "type": "assigned_variable", "loc": [199, 199], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L198_C8", "vector": [14, 3, 0.8223, 0.0041, 3, 0.52, 0.0, 572, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "grasp_params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_params = (goal.x, goal.y, goal.roll, goal.pitch)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L202_C8", "label": "if", "type": "if", "loc": [202, 222], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L198_C8", "vector": [4, 3, 0.876, 0.0868, 3, 0.52, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif goal.grasp_type == goal.VISION_GRASP:\n obj = self.detect_closest_object(goal.x, \n goal.y, \n disable_head=goal.disable_head)\n publish_state(GraspStates.PERCEIVING_OBJECTS)\n if obj is None:\n rospy.loginfo(\"No objects detected\")\n result.grasp_result = \"No objects detected\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L203_C12", "label": "obj = detect_closest_object()", "type": "assigned_variable", "loc": [203, 205], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L202_C8", "vector": [14, 4, 0.843, 0.0124, 4, 0.13, 0.0, 505, 3, 3, 0, 0, 444, 10, 1], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "detect_closest_object", "annotation": ""}, "snippet": " obj = self.detect_closest_object(goal.x, \n goal.y, \n disable_head=goal.disable_head)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L206_C12", "label": "publish_state()", "type": "expression", "loc": [206, 206], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L202_C8", "vector": [8, 4, 0.8512, 0.0041, 4, 0.13, 0.2, 843, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish_state", "arg_names": [], "import_names": [], "rhs_call_name": "publish_state", "annotation": ""}, "snippet": " publish_state(GraspStates.PERCEIVING_OBJECTS)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L207_C12", "label": "if", "type": "if", "loc": [207, 211], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L202_C8", "vector": [4, 4, 0.8636, 0.0207, 4, 0.13, 0.4, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if obj is None:\n rospy.loginfo(\"No objects detected\")\n result.grasp_result = \"No objects detected\"\n self.grasping_server.set_aborted(result)\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L208_C16", "label": "loginfo()", "type": "expression", "loc": [208, 208], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L207_C12", "vector": [8, 5, 0.8595, 0.0041, 5, 0.31, 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(\"No objects detected\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L209_C16", "label": "result.grasp_result =", "type": "assigned_variable", "loc": [209, 209], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L207_C12", "vector": [14, 5, 0.8636, 0.0041, 5, 0.31, 0.3333, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "result.grasp_result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result.grasp_result = \"No objects detected\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L210_C16", "label": "set_aborted()", "type": "expression", "loc": [210, 210], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L207_C12", "vector": [8, 5, 0.8678, 0.0041, 5, 0.31, 0.6667, 210, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_aborted", "arg_names": [], "import_names": [], "rhs_call_name": "set_aborted", "annotation": ""}, "snippet": " self.grasping_server.set_aborted(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L211_C16", "label": "return", "type": "return", "loc": [211, 211], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L207_C12", "vector": [13, 5, 0.8719, 0.0041, 5, 0.31, 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_99343:Assign_L212_C12", "label": "x, y, rot, z = get_grasp_loc()", "type": "assigned_variable", "loc": [212, 212], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L202_C8", "vector": [14, 4, 0.876, 0.0041, 4, 0.13, 0.6, 339, 3, 1, 0, 0, 507, 10, 1], "semantic": {"name": "x, y, rot, z", "arg_names": [], "import_names": [], "rhs_call_name": "get_grasp_loc", "annotation": ""}, "snippet": " x, y, rot, z = self.get_grasp_loc(obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L213_C12", "label": "grasp_params =", "type": "assigned_variable", "loc": [213, 213], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L202_C8", "vector": [14, 4, 0.8802, 0.0041, 4, 0.13, 0.8, 572, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "grasp_params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_params = (x, y, rot, goal.pitch)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L216_C8", "label": "if", "type": "if", "loc": [216, 222], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L202_C8", "vector": [4, 4, 0.905, 0.0289, 4, 0.13, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif goal.grasp_type == goal.RANDOM_GRASP:\n grasp_params = self.random_generator()\n\n else:\n rospy.logerr(\"Bad grasp type\")\n self.grasping_server.set_aborted(result)\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L217_C12", "label": "grasp_params = random_generator()", "type": "assigned_variable", "loc": [217, 217], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L216_C8", "vector": [14, 5, 0.8967, 0.0041, 5, 0.83, 0.0, 572, 3, 0, 0, 0, 425, 10, 1], "semantic": {"name": "grasp_params", "arg_names": [], "import_names": [], "rhs_call_name": "random_generator", "annotation": ""}, "snippet": " grasp_params = self.random_generator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L220_C12", "label": "logerr()", "type": "expression", "loc": [220, 220], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L216_C8", "vector": [8, 5, 0.9091, 0.0041, 5, 0.83, 0.3333, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr(\"Bad grasp type\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L221_C12", "label": "set_aborted()", "type": "expression", "loc": [221, 221], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L216_C8", "vector": [8, 5, 0.9132, 0.0041, 5, 0.83, 0.6667, 210, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_aborted", "arg_names": [], "import_names": [], "rhs_call_name": "set_aborted", "annotation": ""}, "snippet": " self.grasping_server.set_aborted(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L222_C12", "label": "return", "type": "return", "loc": [222, 222], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L216_C8", "vector": [13, 5, 0.9174, 0.0041, 5, 0.83, 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_99343:Assign_L224_C8", "label": "assign", "type": "assigned_variable", "loc": [224, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L189_C4", "vector": [14, 2, 0.9256, 0.0041, 2, 0.36, 0.5, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " feedback.x, feedback.y = grasp_params[0], grasp_params[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L225_C8", "label": "assign", "type": "assigned_variable", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L189_C4", "vector": [14, 2, 0.9298, 0.0041, 2, 0.36, 0.6, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " feedback.roll, feedback.pitch = grasp_params[2], grasp_params[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L226_C8", "label": "grasp_result = perform_grasp()", "type": "assigned_variable", "loc": [226, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L189_C4", "vector": [14, 2, 0.9421, 0.0207, 2, 0.36, 0.7, 706, 3, 6, 0, 0, 121, 10, 1], "semantic": {"name": "grasp_result", "arg_names": [], "import_names": [], "rhs_call_name": "perform_grasp", "annotation": ""}, "snippet": " grasp_result = self.gman.perform_grasp(grasp_params, collide=not goal.disable_coll,\n behavior_name=goal.behavior_name,\n sig_level=goal.sig_level,\n is_place=not goal.is_grasp,\n publish_state=publish_state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L231_C8", "label": "result.grasp_result =", "type": "assigned_variable", "loc": [231, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L189_C4", "vector": [14, 2, 0.9545, 0.0041, 2, 0.36, 0.8, 316, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "result.grasp_result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result.grasp_result = grasp_result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L232_C8", "label": "if", "type": "if", "loc": [232, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L189_C4", "vector": [4, 2, 0.9773, 0.0413, 2, 0.36, 0.9, 0, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if goal.is_grasp:\n if grasp_result == \"Object grasped\":\n self.grasping_server.set_succeeded(result)\n else:\n self.grasping_server.set_aborted(result)\n else:\n if grasp_result == \"Object placed\":\n self.grasping_server.set_succeeded(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L233_C12", "label": "if", "type": "if", "loc": [233, 236], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L232_C8", "vector": [4, 3, 0.969, 0.0165, 3, 0.91, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if grasp_result == \"Object grasped\":\n self.grasping_server.set_succeeded(result)\n else:\n self.grasping_server.set_aborted(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L234_C16", "label": "set_succeeded()", "type": "expression", "loc": [234, 234], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L233_C12", "vector": [8, 4, 0.9669, 0.0041, 4, 0.85, 0.0, 825, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_succeeded", "arg_names": [], "import_names": [], "rhs_call_name": "set_succeeded", "annotation": ""}, "snippet": " self.grasping_server.set_succeeded(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L236_C16", "label": "set_aborted()", "type": "expression", "loc": [236, 236], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L233_C12", "vector": [8, 4, 0.9752, 0.0041, 4, 0.85, 1.0, 210, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_aborted", "arg_names": [], "import_names": [], "rhs_call_name": "set_aborted", "annotation": ""}, "snippet": " self.grasping_server.set_aborted(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L238_C12", "label": "if", "type": "if", "loc": [238, 241], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L232_C8", "vector": [4, 3, 0.9897, 0.0165, 3, 0.91, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if grasp_result == \"Object placed\":\n self.grasping_server.set_succeeded(result)\n else:\n self.grasping_server.set_aborted(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L239_C16", "label": "set_succeeded()", "type": "expression", "loc": [239, 239], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L238_C12", "vector": [8, 4, 0.9876, 0.0041, 4, 0.36, 0.0, 825, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_succeeded", "arg_names": [], "import_names": [], "rhs_call_name": "set_succeeded", "annotation": ""}, "snippet": " self.grasping_server.set_succeeded(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L241_C16", "label": "set_aborted()", "type": "expression", "loc": [241, 241], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L238_C12", "vector": [8, 4, 0.9959, 0.0041, 4, 0.36, 1.0, 210, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_aborted", "arg_names": [], "import_names": [], "rhs_call_name": "set_aborted", "annotation": ""}, "snippet": " self.grasping_server.set_aborted(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L242_C8", "label": "publish_state()", "type": "expression", "loc": [242, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L189_C4", "vector": [8, 2, 1.0, 0.0041, 2, 0.36, 1.0, 843, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish_state", "arg_names": [], "import_names": [], "rhs_call_name": "publish_state", "annotation": ""}, "snippet": " publish_state(GraspStates.ACTIONLIB_COMPLETE)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:For_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:For_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:For_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:For_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:For_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L85_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:While_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:While_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:While_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L96_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:While_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L97_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:While_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:While_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:While_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:While_L99_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L100_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:While_L99_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L101_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:While_L99_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L103_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L103_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L104_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L103_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L105_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:While_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:While_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L107_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L108_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L108_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L109_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L108_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L112_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L112_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L113_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L112_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L114_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L112_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L115_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L108_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L116_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L108_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L117_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L108_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L118_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L108_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L119_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:Try_L108_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L120_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L107_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L124_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L107_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L126_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L107_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L127_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L142_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L146_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L146_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L148_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L146_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L149_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L156_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L157_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L158_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L159_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L162_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L163_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L192_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L193_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L192_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L194_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L198_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L199_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L198_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L202_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L203_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L202_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L206_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L202_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L207_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L207_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L208_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L207_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L209_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L207_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L210_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L207_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L211_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L202_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L212_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L202_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L213_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L202_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L216_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L217_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L216_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L220_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L216_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L221_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L216_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Return_L222_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L224_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Assign_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L232_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L233_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L233_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L234_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L233_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L236_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L232_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L238_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L238_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L239_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:If_L238_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L241_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99343:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99343:Expr_L242_C8"}]
#! /usr/bin/python import numpy as np, math import random import roslib; roslib.load_manifest('pr2_grasp_behaviors') import rospy from grasp_manager import GraspBehavior class SidewaysGrasp(GraspBehavior): def __init__(self, arm, use_coll_detection=False): super(OverheadGrasp, self).__init__(arm, use_coll_detection) self.SIDE_GRASP_DIST = 0.4 self.TABLE_Z = -0.2 self.JOINTS_BIAS = [0.0, 5.0, 0.0, -1.0, 4.0, -1.0, 0.0] if arm == 'l': for i in [0, 2, 4]: self.JOINTS_BIAS[i] *= -1 self.BIAS_RADIUS = 0.012 self.INIT_ANGS = [-0.05, -0.3, -3.1, -1.9, 3.1, -1.5, 0.0] self.GRASP_TIME = 2.0 self.SETUP_VELOCITY = 0.8 self.GRASP_VELOCITY = 0.4 def setup_move(self, params): # object location (x, y), approach angle (r) self.xyr = params rospy.loginfo("Moving to grasp position (%1.2f, %1.2f, %1.2f)" % self.xyr) grasp_pose = self.create_goal_pose(self.xyr[0], self.xyr[1], self.TABLE_Z, quaternion_about_axis(self.xyr[2], (0, 0, 1))) return self.cm.move_arm_pose_biased(grasp_pose, self.JOINTS_BIAS, self.SETUP_VELOCITY, blocking = True, init_angs=self.INIT_ANGS) def execute_approach(self, block): rospy.loginfo("Moving arm sideways") goal_pose = self.create_goal_pose( self.xyr[0] + self.SIDE_GRASP_DIST * np.cos(-self.xyr[2]), self.xyr[1] - self.SIDE_GRASP_DIST * np.sin(-self.xyr[2]), self.TABLE_Z, quaternion_about_axis(self.xyr[2], (0, 0, 1))) goal_pose.header.stamp = rospy.Time.now() return self.cm.move_cartesian_ik(goal_pose, collision_aware = False, blocking = block, step_size = .005, pos_thres = .02, rot_thres = .1, settling_time = rospy.Duration(self.GRASP_TIME), joints_bias = self.JOINTS_BIAS, bias_radius = self.BIAS_RADIUS, vel = self.GRASP_VELOCITY) def execute_retreat(self): rospy.logerr("Need to implement this!") ## # Return random grasp configuration in entire space. def random_generator(self): x = random.uniform(0.45, 0.75) y = random.uniform(-0.55, 0.10) r = random.uniform(0., np.pi/2.) return x, y, r
ajibawa-2023/Python-Code-Large/train/row_99344
36
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_99344:Import_L3_C0", "label": "numpy import np, math", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0508, 0.0169, 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_99344:Import_L4_C0", "label": "random import random", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0678, 0.0169, 0, 0.66, 0.1667, 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_99344:Import_L6_C0", "label": "roslib import roslib", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1017, 0.0169, 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('pr2_grasp_behaviors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:Expr_L6_C15", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.1017, 0.0169, 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('pr2_grasp_behaviors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:Import_L7_C0", "label": "rospy import rospy", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1186, 0.0169, 0, 0.66, 0.6667, 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_99344:ImportFrom_L8_C0", "label": "from grasp_manager import GraspBehavior", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1356, 0.0169, 0, 0.66, 0.8333, 49, 0, 1, 0, 0, 49, 0, 0], "semantic": {"name": "grasp_manager", "arg_names": [], "import_names": ["GraspBehavior"], "rhs_call_name": "", "annotation": ""}, "snippet": "from grasp_manager import GraspBehavior"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:ClassDef_L10_C0", "label": "SidewaysGrasp", "type": "class", "loc": [10, 59], "level": 0, "parent": null, "vector": [3, 0, 0.5847, 0.8475, 0, 0.66, 1.0, 105, 0, 5, 0, 0, 198, 0, 18], "semantic": {"name": "SidewaysGrasp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SidewaysGrasp(GraspBehavior):\n def __init__(self, arm, use_coll_detection=False):\n super(OverheadGrasp, self).__init__(arm, use_coll_detection)\n self.SIDE_GRASP_DIST = 0.4\n self.TABLE_Z = -0.2\n self.JOINTS_BIAS = [0.0, 5.0, 0.0, -1.0, 4.0, -1.0, 0.0]\n if arm == 'l':\n for i in [0, 2, 4]:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L11_C4", "label": "__init__", "type": "function", "loc": [11, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:ClassDef_L10_C0", "vector": [2, 1, 0.2881, 0.2203, 1, 0.85, 0.0, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "arm", "use_coll_detection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arm, use_coll_detection=False):\n super(OverheadGrasp, self).__init__(arm, use_coll_detection)\n self.SIDE_GRASP_DIST = 0.4\n self.TABLE_Z = -0.2\n self.JOINTS_BIAS = [0.0, 5.0, 0.0, -1.0, 4.0, -1.0, 0.0]\n if arm == 'l':\n for i in [0, 2, 4]:\n self.JOINTS_BIAS[i] *= -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:Expr_L12_C8", "label": "__init__()", "type": "expression", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L11_C4", "vector": [8, 2, 0.2034, 0.0169, 2, 0.65, 0.0, 555, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(OverheadGrasp, self).__init__(arm, use_coll_detection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L13_C8", "label": "self.SIDE_GRASP_DIST =", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L11_C4", "vector": [14, 2, 0.2203, 0.0169, 2, 0.65, 0.1111, 675, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.SIDE_GRASP_DIST", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.SIDE_GRASP_DIST = 0.4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L14_C8", "label": "self.TABLE_Z =", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L11_C4", "vector": [14, 2, 0.2373, 0.0169, 2, 0.65, 0.2222, 430, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.TABLE_Z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.TABLE_Z = -0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L15_C8", "label": "self.JOINTS_BIAS =", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L11_C4", "vector": [14, 2, 0.2542, 0.0169, 2, 0.65, 0.3333, 57, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.JOINTS_BIAS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.JOINTS_BIAS = [0.0, 5.0, 0.0, -1.0, 4.0, -1.0, 0.0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:If_L16_C8", "label": "if", "type": "if", "loc": [16, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L11_C4", "vector": [4, 2, 0.2881, 0.0508, 2, 0.65, 0.4444, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'l':\n for i in [0, 2, 4]:\n self.JOINTS_BIAS[i] *= -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:For_L17_C12", "label": "for i", "type": "for", "loc": [17, 18], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:If_L16_C8", "vector": [6, 3, 0.2966, 0.0339, 3, 0.35, 0.0, 826, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in [0, 2, 4]:\n self.JOINTS_BIAS[i] *= -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L19_C8", "label": "self.BIAS_RADIUS =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L11_C4", "vector": [14, 2, 0.322, 0.0169, 2, 0.65, 0.5556, 510, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.BIAS_RADIUS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.BIAS_RADIUS = 0.012"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L20_C8", "label": "self.INIT_ANGS =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L11_C4", "vector": [14, 2, 0.339, 0.0169, 2, 0.65, 0.6667, 856, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.INIT_ANGS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.INIT_ANGS = [-0.05, -0.3, -3.1, -1.9, 3.1, -1.5, 0.0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L21_C8", "label": "self.GRASP_TIME =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L11_C4", "vector": [14, 2, 0.3559, 0.0169, 2, 0.65, 0.7778, 576, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.GRASP_TIME", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.GRASP_TIME = 2.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L22_C8", "label": "self.SETUP_VELOCITY =", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L11_C4", "vector": [14, 2, 0.3729, 0.0169, 2, 0.65, 0.8889, 419, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.SETUP_VELOCITY", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.SETUP_VELOCITY = 0.8"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L23_C8", "label": "self.GRASP_VELOCITY =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L11_C4", "vector": [14, 2, 0.3898, 0.0169, 2, 0.65, 1.0, 215, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.GRASP_VELOCITY", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.GRASP_VELOCITY = 0.4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L25_C4", "label": "setup_move", "type": "function", "loc": [25, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:ClassDef_L10_C0", "vector": [2, 1, 0.4915, 0.1525, 1, 0.85, 0.25, 257, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "setup_move", "arg_names": ["self", "params"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setup_move(self, params):\n # object location (x, y), approach angle (r)\n self.xyr = params\n rospy.loginfo(\"Moving to grasp position (%1.2f, %1.2f, %1.2f)\" % self.xyr)\n grasp_pose = self.create_goal_pose(self.xyr[0], self.xyr[1], self.TABLE_Z, \n quaternion_about_axis(self.xyr[2], (0, 0, 1)))\n return self.cm.move_arm_pose_biased(grasp_pose, self.JOINTS_BIAS, \n self.SETUP_VELOCITY, blocking = True,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L27_C8", "label": "self.xyr =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L25_C4", "vector": [14, 2, 0.4576, 0.0169, 2, 0.14, 0.0, 457, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.xyr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.xyr = params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:Expr_L28_C8", "label": "loginfo()", "type": "expression", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L25_C4", "vector": [8, 2, 0.4746, 0.0169, 2, 0.14, 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(\"Moving to grasp position (%1.2f, %1.2f, %1.2f)\" % self.xyr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L29_C8", "label": "grasp_pose = create_goal_pose()", "type": "assigned_variable", "loc": [29, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L25_C4", "vector": [14, 2, 0.5, 0.0339, 2, 0.14, 0.6667, 752, 3, 4, 0, 0, 758, 10, 2], "semantic": {"name": "grasp_pose", "arg_names": [], "import_names": [], "rhs_call_name": "create_goal_pose", "annotation": ""}, "snippet": " grasp_pose = self.create_goal_pose(self.xyr[0], self.xyr[1], self.TABLE_Z, \n quaternion_about_axis(self.xyr[2], (0, 0, 1)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:Return_L31_C8", "label": "return", "type": "return", "loc": [31, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L25_C4", "vector": [13, 2, 0.5424, 0.0508, 2, 0.14, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.cm.move_arm_pose_biased(grasp_pose, self.JOINTS_BIAS, \n self.SETUP_VELOCITY, blocking = True,\n init_angs=self.INIT_ANGS)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L35_C4", "label": "execute_approach", "type": "function", "loc": [35, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:ClassDef_L10_C0", "vector": [2, 1, 0.7034, 0.2373, 1, 0.85, 0.5, 414, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "execute_approach", "arg_names": ["self", "block"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute_approach(self, block):\n rospy.loginfo(\"Moving arm sideways\")\n goal_pose = self.create_goal_pose(\n self.xyr[0] + self.SIDE_GRASP_DIST * np.cos(-self.xyr[2]), \n self.xyr[1] - self.SIDE_GRASP_DIST * np.sin(-self.xyr[2]), \n self.TABLE_Z,\n quaternion_about_axis(self.xyr[2], (0, 0, 1)))\n goal_pose.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:Expr_L36_C8", "label": "loginfo()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L35_C4", "vector": [8, 2, 0.6102, 0.0169, 2, 0.47, 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(\"Moving arm sideways\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L37_C8", "label": "goal_pose = create_goal_pose()", "type": "assigned_variable", "loc": [37, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L35_C4", "vector": [14, 2, 0.661, 0.0847, 2, 0.47, 0.3333, 109, 3, 4, 0, 0, 758, 10, 4], "semantic": {"name": "goal_pose", "arg_names": [], "import_names": [], "rhs_call_name": "create_goal_pose", "annotation": ""}, "snippet": " goal_pose = self.create_goal_pose(\n self.xyr[0] + self.SIDE_GRASP_DIST * np.cos(-self.xyr[2]), \n self.xyr[1] - self.SIDE_GRASP_DIST * np.sin(-self.xyr[2]), \n self.TABLE_Z,\n quaternion_about_axis(self.xyr[2], (0, 0, 1)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L42_C8", "label": "goal_pose.header.stamp = now()", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L35_C4", "vector": [14, 2, 0.7119, 0.0169, 2, 0.47, 0.6667, 393, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "goal_pose.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " goal_pose.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:Return_L43_C8", "label": "return", "type": "return", "loc": [43, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L35_C4", "vector": [13, 2, 0.7712, 0.1017, 2, 0.47, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.cm.move_cartesian_ik(goal_pose, collision_aware = False, \n blocking = block,\n step_size = .005, pos_thres = .02, rot_thres = .1,\n settling_time = rospy.Duration(self.GRASP_TIME),\n joints_bias = self.JOINTS_BIAS, bias_radius = self.BIAS_RADIUS,\n vel = self.GRASP_VELOCITY)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L50_C4", "label": "execute_retreat", "type": "function", "loc": [50, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:ClassDef_L10_C0", "vector": [2, 1, 0.8559, 0.0339, 1, 0.85, 0.75, 538, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "execute_retreat", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute_retreat(self):\n rospy.logerr(\"Need to implement this!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:Expr_L51_C8", "label": "logerr()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L50_C4", "vector": [8, 2, 0.8644, 0.0169, 2, 0.84, 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 implement this!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L55_C4", "label": "random_generator", "type": "function", "loc": [55, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:ClassDef_L10_C0", "vector": [2, 1, 0.9661, 0.0847, 1, 0.85, 1.0, 425, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "random_generator", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def random_generator(self):\n x = random.uniform(0.45, 0.75)\n y = random.uniform(-0.55, 0.10)\n r = random.uniform(0., np.pi/2.)\n return x, y, r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L56_C8", "label": "x = uniform()", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L55_C4", "vector": [14, 2, 0.9492, 0.0169, 2, 0.32, 0.0, 190, 3, 2, 0, 0, 463, 10, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "uniform", "annotation": ""}, "snippet": " x = random.uniform(0.45, 0.75)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L57_C8", "label": "y = uniform()", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L55_C4", "vector": [14, 2, 0.9661, 0.0169, 2, 0.32, 0.3333, 304, 3, 2, 0, 0, 463, 10, 1], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "uniform", "annotation": ""}, "snippet": " y = random.uniform(-0.55, 0.10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L58_C8", "label": "r = uniform()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L55_C4", "vector": [14, 2, 0.9831, 0.0169, 2, 0.32, 0.6667, 436, 3, 2, 0, 0, 463, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "uniform", "annotation": ""}, "snippet": " r = random.uniform(0., np.pi/2.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99344:Return_L59_C8", "label": "return", "type": "return", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L55_C4", "vector": [13, 2, 1.0, 0.0169, 2, 0.32, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return x, y, r"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99344:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:Expr_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:If_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:If_L16_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:For_L17_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:Expr_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:Return_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:Return_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99344:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99344:Return_L59_C8"}]
#! /usr/bin/python import roslib roslib.load_manifest('pr2_approach_table') import rospy from geometry_msgs.msg import Twist import actionlib import costmap_services.python_client as costmap from pr2_approach_table.srv import ApproachSrv from pr2_approach_table.msg import ApproachAction, ApproachResult, ApproachGoal import numpy as np, math from collections import deque import os from threading import Lock def ctime(): return rospy.Time.now().to_time() def retfalse(): return False class Approach( ): def __init__( self, costmap_ns = '' ): rospy.logout('approach_node: Initializing') try: rospy.init_node('approach_node') except: # Node probably already initialized elsewhere pass # Create Costmap Services obj self.cs = costmap.CostmapServices( accum = 3, ns = costmap_ns ) # be really conservative! # Note: After moving, this will require accum * -1's before stopping. # Publish move_base command self._pub = rospy.Publisher( 'approach_cmd_vel', Twist ) # Alterative ways to call using ROS services / actionlib self._service = rospy.Service( '/approach_table/move_forward_srv', ApproachSrv, self.service_request ) self._as = actionlib.SimpleActionServer( '/approach_table/move_forward_act', ApproachAction, execute_cb = self.action_request ) self._as.start() rospy.logout( 'approach_node: Service ready and waiting' ) def service_request( self, req ): return self.run( forward_vel = req.forward_vel, forward_mult = req.forward_mult ) def action_request( self, goal ): def preempt_func(): # self._as should be in scope and bound @ function def. (I think for python...) check = self._as.is_preempt_requested() if check: rospy.logout( 'approach_node: action_request preempted!' ) return check rv = self.run( preempt_func = preempt_func, forward_vel = goal.forward_vel, forward_mult = goal.forward_mult ) rospy.logout( 'approach_node: action_request received result %d' % int(rv) ) if preempt_func(): # this is a relatively new addition rospy.logout('approach_node: returning actionlib state preempted.') self._as.set_preempted() elif rv == True: self._as.set_succeeded( ApproachResult( int(rv) )) def run( self, preempt_func = retfalse, forward_vel = 0.05, forward_mult = 1.0 ): # preempt_func => returns true when a preempt request is received, else false rospy.logout( 'approach_node: Run called for with values: \'%1.2f, %1.2f\'' % (forward_vel, forward_mult) ) rospy.logout('approach_node: Running') r = rospy.Rate( 10 ) def check_func(): a = not rospy.is_shutdown() # forward_mult is a hack to let us get closer at the current forward_vel # without reducing the footprint. b = self.cs.scoreTraj_PosHyst( forward_vel * forward_mult, 0.0, 0.0 ) != -1.0 c = not preempt_func() return a and b and c while check_func(): move_command = Twist() move_command.linear.x = forward_vel self._pub.publish( move_command ) # Don't do this too fast (avoid unwanted buffering / rate issues) try: r.sleep() except rospy.ROSInterruptException: # rospy shutdown request received pass self._pub.publish( Twist() ) # Stop moving! if preempt_func(): rospy.logout( 'approach_node: Preempt was requested. May not have finished.' ) rospy.logout( 'approach_node: Exiting' ) return False else: rospy.logout( 'approach_node: Exiting' ) return True if __name__ == '__main__': import optparse p = optparse.OptionParser() p.add_option('--ns', action='store', type='string', dest='ns', help='Uses the namespace [ns] for services: /ns/approach_table/costmap_services/cs/...', default = '') opt, args = p.parse_args() ap = Approach( costmap_ns = opt.ns ) # There are (at least) three ways to call this code. # 1) Python: # ap.run( forward_vel = 0.05, forward_mult = 0.5 ) # 2) ROS service: # rosservice call /approach_table/move_forward_srv 0.05 0.5 # 3) ROS actionlib: # try: # client = actionlib.SimpleActionClient( '/approach_table/move_forward_act', ApproachAction ) # client.wait_for_server() # client.send_goal( ActionGoal( 0.05, 0.5 )) # client.wait_for_result() # print client.get_result() # except rospy.ROSInterruptException: # print 'Program interrupted before completion' rospy.spin()
ajibawa-2023/Python-Code-Large/train/row_99347
71
149
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0134, 0.0067, 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_99347:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0201, 0.0067, 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('pr2_approach_table')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0268, 0.0067, 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_99347:ImportFrom_L6_C0", "label": "from geometry_msgs.msg import Twist", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0403, 0.0067, 0, 0.66, 0.2, 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_99347:Import_L7_C0", "label": "actionlib import actionlib", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.047, 0.0067, 0, 0.66, 0.2667, 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_99347:Import_L9_C0", "label": "costmap_services.python_client import costmap", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0604, 0.0067, 0, 0.66, 0.3333, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "costmap_services.python_client", "arg_names": [], "import_names": ["costmap"], "rhs_call_name": "", "annotation": ""}, "snippet": "import costmap_services.python_client as costmap"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:ImportFrom_L10_C0", "label": "from pr2_approach_table.srv import ApproachSrv", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0671, 0.0067, 0, 0.66, 0.4, 222, 0, 1, 0, 0, 222, 0, 0], "semantic": {"name": "pr2_approach_table.srv", "arg_names": [], "import_names": ["ApproachSrv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_approach_table.srv import ApproachSrv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:ImportFrom_L11_C0", "label": "from pr2_approach_table.msg import ApproachAction, ApproachResult, ApproachGoal", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0738, 0.0067, 0, 0.66, 0.4667, 860, 0, 3, 0, 0, 860, 0, 0], "semantic": {"name": "pr2_approach_table.msg", "arg_names": [], "import_names": ["ApproachAction", "ApproachResult", "ApproachGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_approach_table.msg import ApproachAction, ApproachResult, ApproachGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Import_L13_C0", "label": "numpy import np, math", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0872, 0.0067, 0, 0.66, 0.5333, 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_99347:ImportFrom_L14_C0", "label": "from collections import deque", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.094, 0.0067, 0, 0.66, 0.6, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "collections", "arg_names": [], "import_names": ["deque"], "rhs_call_name": "", "annotation": ""}, "snippet": "from collections import deque"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Import_L15_C0", "label": "os import os", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1007, 0.0067, 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_99347:ImportFrom_L16_C0", "label": "from threading import Lock", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1074, 0.0067, 0, 0.66, 0.7333, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["Lock"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import Lock"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L18_C0", "label": "ctime", "type": "function", "loc": [18, 19], "level": 0, "parent": null, "vector": [2, 0, 0.1242, 0.0134, 0, 0.66, 0.8, 671, 0, 0, 1, 0, 0, 0, 2], "semantic": {"name": "ctime", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ctime():\n return rospy.Time.now().to_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Return_L19_C4", "label": "return", "type": "return", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L18_C0", "vector": [13, 1, 0.1275, 0.0067, 1, 0.84, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rospy.Time.now().to_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L21_C0", "label": "retfalse", "type": "function", "loc": [21, 22], "level": 0, "parent": null, "vector": [2, 0, 0.1443, 0.0134, 0, 0.66, 0.8667, 71, 0, 0, 1, 0, 0, 0, 0], "semantic": {"name": "retfalse", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def retfalse():\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Return_L22_C4", "label": "return", "type": "return", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L21_C0", "vector": [13, 1, 0.1477, 0.0067, 1, 0.11, 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_99347:ClassDef_L24_C0", "label": "Approach", "type": "class", "loc": [24, 110], "level": 0, "parent": null, "vector": [3, 0, 0.4497, 0.5839, 0, 0.66, 0.9333, 10, 0, 6, 0, 0, 0, 0, 36], "semantic": {"name": "Approach", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Approach( ):\n def __init__( self, costmap_ns = '' ):\n rospy.logout('approach_node: Initializing')\n try:\n rospy.init_node('approach_node')\n except: # Node probably already initialized elsewhere\n pass\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L25_C4", "label": "__init__", "type": "function", "loc": [25, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:ClassDef_L24_C0", "vector": [2, 1, 0.245, 0.1611, 1, 0.97, 0.0, 555, 0, 2, 0, 0, 0, 0, 8], "semantic": {"name": "__init__", "arg_names": ["self", "costmap_ns"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, costmap_ns = '' ):\n rospy.logout('approach_node: Initializing')\n try:\n rospy.init_node('approach_node')\n except: # Node probably already initialized elsewhere\n pass\n\n # Create Costmap Services obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L26_C8", "label": "logout()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L25_C4", "vector": [8, 2, 0.1745, 0.0067, 2, 0.35, 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('approach_node: Initializing')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Try_L27_C8", "label": "try", "type": "try", "loc": [27, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L25_C4", "vector": [7, 2, 0.1913, 0.0268, 2, 0.35, 0.1429, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node('approach_node')\n except: # Node probably already initialized elsewhere\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L28_C12", "label": "init_node()", "type": "expression", "loc": [28, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:Try_L27_C8", "vector": [8, 3, 0.1879, 0.0067, 3, 0.23, 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('approach_node')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L33_C8", "label": "self.cs = CostmapServices()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L25_C4", "vector": [14, 2, 0.2215, 0.0067, 2, 0.35, 0.2857, 23, 3, 2, 0, 0, 974, 10, 1], "semantic": {"name": "self.cs", "arg_names": [], "import_names": [], "rhs_call_name": "CostmapServices", "annotation": ""}, "snippet": " self.cs = costmap.CostmapServices( accum = 3, ns = costmap_ns ) # be really conservative!"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L37_C8", "label": "self._pub = Publisher()", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L25_C4", "vector": [14, 2, 0.2483, 0.0067, 2, 0.35, 0.4286, 415, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self._pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self._pub = rospy.Publisher( 'approach_cmd_vel', Twist )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L40_C8", "label": "self._service = Service()", "type": "assigned_variable", "loc": [40, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L25_C4", "vector": [14, 2, 0.2752, 0.0201, 2, 0.35, 0.5714, 143, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self._service", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self._service = rospy.Service( '/approach_table/move_forward_srv',\n ApproachSrv,\n self.service_request )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L43_C8", "label": "self._as = SimpleActionServer()", "type": "assigned_variable", "loc": [43, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L25_C4", "vector": [14, 2, 0.2953, 0.0201, 2, 0.35, 0.7143, 777, 3, 3, 0, 0, 975, 10, 1], "semantic": {"name": "self._as", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionServer", "annotation": ""}, "snippet": " self._as = actionlib.SimpleActionServer( '/approach_table/move_forward_act',\n ApproachAction,\n execute_cb = self.action_request )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L46_C8", "label": "start()", "type": "expression", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L25_C4", "vector": [8, 2, 0.3087, 0.0067, 2, 0.35, 0.8571, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self._as.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L48_C8", "label": "logout()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L25_C4", "vector": [8, 2, 0.3221, 0.0067, 2, 0.35, 1.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'approach_node: Service ready and waiting' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L51_C4", "label": "service_request", "type": "function", "loc": [51, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:ClassDef_L24_C0", "vector": [2, 1, 0.349, 0.0201, 1, 0.97, 0.3333, 396, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "service_request", "arg_names": ["self", "req"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def service_request( self, req ):\n return self.run( forward_vel = req.forward_vel,\n forward_mult = req.forward_mult )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Return_L52_C8", "label": "return", "type": "return", "loc": [52, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L51_C4", "vector": [13, 2, 0.3523, 0.0134, 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.run( forward_vel = req.forward_vel,\n forward_mult = req.forward_mult )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L55_C4", "label": "action_request", "type": "function", "loc": [55, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:ClassDef_L24_C0", "vector": [2, 1, 0.4262, 0.1208, 1, 0.97, 0.6667, 616, 0, 2, 1, 0, 0, 0, 11], "semantic": {"name": "action_request", "arg_names": ["self", "goal"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def action_request( self, goal ):\n def preempt_func():\n # self._as should be in scope and bound @ function def. (I think for python...)\n check = self._as.is_preempt_requested()\n if check:\n rospy.logout( 'approach_node: action_request preempted!' )\n return check\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L56_C8", "label": "preempt_func", "type": "function", "loc": [56, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L55_C4", "vector": [2, 2, 0.3926, 0.0403, 2, 0.2, 0.0, 314, 0, 0, 1, 0, 0, 0, 2], "semantic": {"name": "preempt_func", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def preempt_func():\n # self._as should be in scope and bound @ function def. (I think for python...)\n check = self._as.is_preempt_requested()\n if check:\n rospy.logout( 'approach_node: action_request preempted!' )\n return check"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L58_C12", "label": "check = is_preempt_requested()", "type": "assigned_variable", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L56_C8", "vector": [14, 3, 0.3893, 0.0067, 3, 0.5, 0.0, 803, 3, 0, 0, 0, 468, 10, 1], "semantic": {"name": "check", "arg_names": [], "import_names": [], "rhs_call_name": "is_preempt_requested", "annotation": ""}, "snippet": " check = self._as.is_preempt_requested()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L59_C12", "label": "if", "type": "if", "loc": [59, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L56_C8", "vector": [4, 3, 0.3993, 0.0134, 3, 0.5, 0.5, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if check:\n rospy.logout( 'approach_node: action_request preempted!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L60_C16", "label": "logout()", "type": "expression", "loc": [60, 60], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L59_C12", "vector": [8, 4, 0.4027, 0.0067, 4, 0.32, 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( 'approach_node: action_request preempted!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Return_L61_C12", "label": "return", "type": "return", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L56_C8", "vector": [13, 3, 0.4094, 0.0067, 3, 0.5, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return check"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L63_C8", "label": "rv = run()", "type": "assigned_variable", "loc": [63, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L55_C4", "vector": [14, 2, 0.4295, 0.0201, 2, 0.2, 0.3333, 222, 3, 3, 0, 0, 679, 10, 1], "semantic": {"name": "rv", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " rv = self.run( preempt_func = preempt_func,\n forward_vel = goal.forward_vel,\n forward_mult = goal.forward_mult )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L66_C8", "label": "logout()", "type": "expression", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L55_C4", "vector": [8, 2, 0.443, 0.0067, 2, 0.2, 0.6667, 525, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'approach_node: action_request received result %d' % int(rv) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L68_C8", "label": "if", "type": "if", "loc": [68, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L55_C4", "vector": [4, 2, 0.4698, 0.0336, 2, 0.2, 1.0, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if preempt_func(): # this is a relatively new addition\n rospy.logout('approach_node: returning actionlib state preempted.')\n self._as.set_preempted()\n elif rv == True:\n self._as.set_succeeded( ApproachResult( int(rv) ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L69_C12", "label": "logout()", "type": "expression", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L68_C8", "vector": [8, 3, 0.4631, 0.0067, 3, 0.55, 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('approach_node: returning actionlib state preempted.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L70_C12", "label": "set_preempted()", "type": "expression", "loc": [70, 70], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L68_C8", "vector": [8, 3, 0.4698, 0.0067, 3, 0.55, 0.5, 196, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_preempted", "arg_names": [], "import_names": [], "rhs_call_name": "set_preempted", "annotation": ""}, "snippet": " self._as.set_preempted()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L71_C8", "label": "if", "type": "if", "loc": [71, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L68_C8", "vector": [4, 3, 0.4799, 0.0134, 3, 0.55, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif rv == True:\n self._as.set_succeeded( ApproachResult( int(rv) ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L72_C12", "label": "set_succeeded()", "type": "expression", "loc": [72, 72], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L71_C8", "vector": [8, 4, 0.4832, 0.0067, 4, 0.35, 0.0, 825, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "set_succeeded", "arg_names": [], "import_names": [], "rhs_call_name": "set_succeeded", "annotation": ""}, "snippet": " self._as.set_succeeded( ApproachResult( int(rv) ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L75_C4", "label": "run", "type": "function", "loc": [75, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:ClassDef_L24_C0", "vector": [2, 1, 0.6208, 0.2416, 1, 0.97, 1.0, 679, 0, 4, 1, 0, 0, 0, 16], "semantic": {"name": "run", "arg_names": ["self", "preempt_func", "forward_vel", "forward_mult"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run( self, preempt_func = retfalse, forward_vel = 0.05, forward_mult = 1.0 ):\n # preempt_func => returns true when a preempt request is received, else false\n rospy.logout( 'approach_node: Run called for with values: \\'%1.2f, %1.2f\\'' % (forward_vel, forward_mult) )\n\n rospy.logout('approach_node: Running')\n\n r = rospy.Rate( 10 )\n def check_func():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L77_C8", "label": "logout()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L75_C4", "vector": [8, 2, 0.5168, 0.0067, 2, 0.06, 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( 'approach_node: Run called for with values: \\'%1.2f, %1.2f\\'' % (forward_vel, forward_mult) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L79_C8", "label": "logout()", "type": "expression", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L75_C4", "vector": [8, 2, 0.5302, 0.0067, 2, 0.06, 0.1667, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('approach_node: Running')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L81_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L75_C4", "vector": [14, 2, 0.5436, 0.0067, 2, 0.06, 0.3333, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " r = rospy.Rate( 10 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L82_C8", "label": "check_func", "type": "function", "loc": [82, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L75_C4", "vector": [2, 2, 0.5705, 0.047, 2, 0.06, 0.5, 76, 0, 0, 1, 0, 0, 0, 3], "semantic": {"name": "check_func", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_func():\n a = not rospy.is_shutdown()\n # forward_mult is a hack to let us get closer at the current forward_vel\n # without reducing the footprint.\n b = self.cs.scoreTraj_PosHyst( forward_vel * forward_mult, 0.0, 0.0 ) != -1.0\n c = not preempt_func()\n return a and b and c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L83_C12", "label": "a =", "type": "assigned_variable", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L82_C8", "vector": [14, 3, 0.557, 0.0067, 3, 0.82, 0.0, 475, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " a = not rospy.is_shutdown()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L86_C12", "label": "b =", "type": "assigned_variable", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L82_C8", "vector": [14, 3, 0.5772, 0.0067, 3, 0.82, 0.3333, 756, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "b", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " b = self.cs.scoreTraj_PosHyst( forward_vel * forward_mult, 0.0, 0.0 ) != -1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L87_C12", "label": "c =", "type": "assigned_variable", "loc": [87, 87], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L82_C8", "vector": [14, 3, 0.5839, 0.0067, 3, 0.82, 0.6667, 411, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c = not preempt_func()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Return_L88_C12", "label": "return", "type": "return", "loc": [88, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L82_C8", "vector": [13, 3, 0.5906, 0.0067, 3, 0.82, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return a and b and c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:While_L90_C8", "label": "while", "type": "while", "loc": [90, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L75_C4", "vector": [5, 2, 0.6376, 0.0738, 2, 0.06, 0.6667, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while check_func():\n move_command = Twist()\n move_command.linear.x = forward_vel\n\n self._pub.publish( move_command )\n\n # Don't do this too fast (avoid unwanted buffering / rate issues)\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L91_C12", "label": "move_command = Twist()", "type": "assigned_variable", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:While_L90_C8", "vector": [14, 3, 0.6107, 0.0067, 3, 0.2, 0.0, 175, 3, 0, 0, 0, 9, 10, 1], "semantic": {"name": "move_command", "arg_names": [], "import_names": [], "rhs_call_name": "Twist", "annotation": ""}, "snippet": " move_command = Twist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L92_C12", "label": "move_command.linear.x =", "type": "assigned_variable", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:While_L90_C8", "vector": [14, 3, 0.6174, 0.0067, 3, 0.2, 0.3333, 56, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "move_command.linear.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " move_command.linear.x = forward_vel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L94_C12", "label": "publish()", "type": "expression", "loc": [94, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:While_L90_C8", "vector": [8, 3, 0.6309, 0.0067, 3, 0.2, 0.6667, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self._pub.publish( move_command )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Try_L97_C12", "label": "try", "type": "try", "loc": [97, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:While_L90_C8", "vector": [7, 3, 0.6611, 0.0268, 3, 0.2, 1.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n r.sleep()\n except rospy.ROSInterruptException: # rospy shutdown request received\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L98_C16", "label": "sleep()", "type": "expression", "loc": [98, 98], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:Try_L97_C12", "vector": [8, 4, 0.6577, 0.0067, 4, 0.59, 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_99347:Expr_L102_C8", "label": "publish()", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L75_C4", "vector": [8, 2, 0.6846, 0.0067, 2, 0.06, 0.8333, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self._pub.publish( Twist() ) # Stop moving!"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L104_C8", "label": "if", "type": "if", "loc": [104, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L75_C4", "vector": [4, 2, 0.7181, 0.047, 2, 0.06, 1.0, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if preempt_func():\n rospy.logout( 'approach_node: Preempt was requested. May not have finished.' )\n rospy.logout( 'approach_node: Exiting' )\n return False\n else:\n rospy.logout( 'approach_node: Exiting' )\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L105_C12", "label": "logout()", "type": "expression", "loc": [105, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L104_C8", "vector": [8, 3, 0.7047, 0.0067, 3, 0.65, 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( 'approach_node: Preempt was requested. May not have finished.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L106_C12", "label": "logout()", "type": "expression", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L104_C8", "vector": [8, 3, 0.7114, 0.0067, 3, 0.65, 0.25, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'approach_node: Exiting' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Return_L107_C12", "label": "return", "type": "return", "loc": [107, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L104_C8", "vector": [13, 3, 0.7181, 0.0067, 3, 0.65, 0.5, 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_99347:Expr_L109_C12", "label": "logout()", "type": "expression", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L104_C8", "vector": [8, 3, 0.7315, 0.0067, 3, 0.65, 0.75, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'approach_node: Exiting' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Return_L110_C12", "label": "return", "type": "return", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L104_C8", "vector": [13, 3, 0.7383, 0.0067, 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 True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L115_C0", "label": "if", "type": "if", "loc": [115, 145], "level": 0, "parent": null, "vector": [4, 0, 0.8725, 0.2081, 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 optparse\n p = optparse.OptionParser()\n p.add_option('--ns', action='store', type='string', dest='ns',\n help='Uses the namespace [ns] for services: /ns/approach_table/costmap_services/cs/...',\n default = '')\n opt, args = p.parse_args()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Import_L116_C4", "label": "optparse import optparse", "type": "import", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L115_C0", "vector": [1, 1, 0.7785, 0.0067, 1, 0.58, 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_99347:Assign_L117_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L115_C0", "vector": [14, 1, 0.7852, 0.0067, 1, 0.58, 0.2, 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_99347:Expr_L118_C4", "label": "add_option()", "type": "expression", "loc": [118, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L115_C0", "vector": [8, 1, 0.7987, 0.0201, 1, 0.58, 0.4, 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('--ns', action='store', type='string', dest='ns',\n help='Uses the namespace [ns] for services: /ns/approach_table/costmap_services/cs/...',\n default = '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L121_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L115_C0", "vector": [14, 1, 0.8121, 0.0067, 1, 0.58, 0.6, 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_99347:Assign_L123_C4", "label": "ap = Approach()", "type": "assigned_variable", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L115_C0", "vector": [14, 1, 0.8255, 0.0067, 1, 0.58, 0.8, 642, 3, 1, 0, 0, 10, 10, 1], "semantic": {"name": "ap", "arg_names": [], "import_names": [], "rhs_call_name": "Approach", "annotation": ""}, "snippet": " ap = Approach( costmap_ns = opt.ns )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L145_C4", "label": "spin()", "type": "expression", "loc": [145, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L115_C0", "vector": [8, 1, 0.9732, 0.0067, 1, 0.58, 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_99347:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Return_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Return_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Try_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:Try_L27_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L28_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Return_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L56_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L56_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L59_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L60_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L56_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Return_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L68_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L68_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L70_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L68_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Return_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:While_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:While_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:While_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:While_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L94_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:While_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Try_L97_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:Try_L97_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L98_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L104_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L105_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L104_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L104_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Return_L107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L104_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L104_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Return_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Import_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99347:If_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99347:Expr_L145_C4"}]
#! /usr/bin/python import roslib roslib.load_manifest('pr2_approach_table') roslib.load_manifest('rfid_behaviors') import rospy import tf import tf.transformations as tft import smach from smach_ros import SimpleActionState, ServiceState, IntrospectionServer import actionlib from geometry_msgs.msg import PoseStamped, PoseArray, Pose, Quaternion from move_base_msgs.msg import MoveBaseAction from pr2_approach_table.srv import ApproachSrv from pr2_approach_table.msg import ApproachAction, ApproachResult, ApproachGoal from rfid_behaviors.srv import FloatFloat_Int32 as RotateBackupSrv import numpy as np, math class CheckHeading(smach.State): def __init__(self, listener): smach.State.__init__(self, outcomes=['succeeded', 'preempted'], input_keys = ['target_pose'], # PoseStamped output_keys = ['angular_error']) # float self.listener = listener self.initialized = False def execute(self, userdata): ps_desired = userdata.target_pose self.GLOBAL_FRAME = ps_desired.header.frame_id if not self.initialized: self.initialized = True # self.listener = tf.TransformListener() # this is now passed in. rospy.logout( 'CheckHeading (smach): Waiting on transforms from (%s -> %s)' % ( self.GLOBAL_FRAME, '/base_link' )) self.listener.waitForTransform( '/base_link', self.GLOBAL_FRAME, rospy.Time(0), timeout = rospy.Duration(30) ) rospy.logout( 'CheckHeading (smach): Ready.' ) try: ps = PoseStamped() ps.header.stamp = rospy.Time(0) ps.header.frame_id = '/base_link' ps.pose.orientation.w = 1.0 ps_global = self.listener.transformPose( self.GLOBAL_FRAME, ps ) efq = tft.euler_from_quaternion r,p,yaw_curr = efq(( ps_global.pose.orientation.x, ps_global.pose.orientation.y, ps_global.pose.orientation.z, ps_global.pose.orientation.w )) r,p,yaw_des = efq(( ps_desired.pose.orientation.x, ps_desired.pose.orientation.y, ps_desired.pose.orientation.z, ps_desired.pose.orientation.w )) rospy.logout( 'CheckHeading (smach): Error was %3.2f (deg)' % math.degrees(yaw_des - yaw_curr)) userdata.angular_error = yaw_des - yaw_curr except: rospy.logout( 'CheckHeading (smach): TF failed. Returning ang error of 0.0' ) userdata.angular_error = 0.0 return 'succeeded' class PoseSelection(smach.State): def __init__(self, listener): smach.State.__init__(self, outcomes=['succeeded', 'aborted'], input_keys=['candidate_poses'], # of type PoseArray! output_keys=['selected_pose_global', # of type PoseStamped! 'movebase_pose_global' ]) # of type PoseStamped! self.listener = listener self.poses = [] self.initialized = False self.ind = 0 #self.GLOBAL_FRAME = '/odom_combined' self.GLOBAL_FRAME = '/map' def execute(self, userdata): rospy.logout( 'Executing POSE_SELECTION' ) poses_frame = userdata.candidate_poses.header.frame_id #dist = userdata.approach_dist dist = 0.80 if not self.initialized: self.initialized = True self.ind = 0 # self.listener = tf.TransformListener() # This is now passed in rospy.logout( 'PoseSelector (smach): Waiting on transforms from (%s -> %s)' % ( self.GLOBAL_FRAME, poses_frame )) self.listener.waitForTransform( poses_frame, self.GLOBAL_FRAME, rospy.Time(0), timeout = rospy.Duration(30) ) rospy.logout( 'PoseSelector (smach): Ready.' ) # convert PoseArray to list of PoseStamped in global frame frame_adjusted = [ self.frame_adjust(i,poses_frame,dist) for i in userdata.candidate_poses.poses ] self.poses = [ i for i in frame_adjusted if i != None ] # in case the transforms fail. if len( self.poses ) == 0 or self.ind >= len( self.poses ): # we've tried everything... return 'aborted' # print 'POSES:\n', self.poses userdata.selected_pose_global = self.poses[ self.ind ][0] userdata.movebase_pose_global = self.poses[ self.ind ][1] # print 'SELECTED_POSE:\n', self.poses[ self.ind ] self.ind += 1 return 'succeeded' def frame_adjust( self, pose, poses_frame, dist, arm_offset = 0.0 ): # Adjust all incoming candidate poses into a "Global" frame. # Positive arm offset to move the approach point "right" ps = PoseStamped() ps.header.frame_id = poses_frame ps.header.stamp = rospy.Time(0) ps.pose = pose # In some cases, we may want to move the pose right or left # depending on which arm will be used for grasping. efq = tft.euler_from_quaternion r,p,y = efq(( pose.orientation.x, pose.orientation.y, pose.orientation.z, pose.orientation.w )) ps.pose.position.x = pose.position.x + arm_offset * np.cos( y + np.pi/2 ) ps.pose.position.y = pose.position.y + arm_offset * np.sin( y + np.pi/2 ) # print ps, '\nto\n', self.GLOBAL_FRAME, '\ntime:', rospy.Time.now() try: ps_global = self.listener.transformPose( self.GLOBAL_FRAME, ps ) ps_global.pose.position.z = 0.0 # print 'PS:\n', ps, '\nPS_GLOBAL:\n', ps_global r,p,y = efq(( ps_global.pose.orientation.x, ps_global.pose.orientation.y, ps_global.pose.orientation.z, ps_global.pose.orientation.w )) # We want to move to a position that is 40-cm back from the tabletop using navstack mps = PoseStamped() mps.header.frame_id = ps_global.header.frame_id mps.header.stamp = rospy.Time.now() mps.pose.position.x = ps_global.pose.position.x + dist * np.cos( y ) mps.pose.position.y = ps_global.pose.position.y + dist * np.sin( y ) qfe = tft.quaternion_from_euler mps.pose.orientation = Quaternion( *qfe( 0.0, 0.0, y - np.pi )) # print 'MPS:\n', mps # Return value: selected_pose_global, movebase_pose_global. rv = [ ps_global, mps ] except: rospy.logout( 'PoseSelector (smach): TF failed. Ignoring pose.' ) rv = None return rv # Return value: selected_pose_global (PoseStamped), movebase_pose_global (PoseStamped) def sm_approach_table( listener = None ): # for various states, you need a tf listener, but only one per thread supported. if listener == None: try: rospy.init_node( 'sm_approach' ) except: rospy.logout( 'sm_approach_table: Node already initialized elsewhere' ) listener = tf.TransformListener() # Python only allows one listener per thread. This function has two (or more) # classes that require the listener. You can pass in one from higher in the # hierarchy if you prefer. # Create a SMACH state machine sm = smach.StateMachine( outcomes = ['succeeded','aborted','preempted'], input_keys = ['table_edge_poses'], # type PoseArray output_keys = ['movebase_pose_global', # type PoseStamped 'table_edge_global']) # type PoseStamped # Open the container with sm: smach.StateMachine.add( 'POSE_SELECTION', PoseSelection( listener = listener ), transitions = { 'succeeded' : 'MOVE_BASE' }, remapping = {'candidate_poses':'table_edge_poses', # input (PoseArray) 'selected_pose_global':'table_edge_global', # output (PoseStamped) 'movebase_pose_global':'movebase_pose_global'}) # output (PoseStamped) smach.StateMachine.add( 'MOVE_BASE', SimpleActionState( '/move_base', MoveBaseAction, goal_slots = ['target_pose'], # PoseStamped outcomes = ['succeeded','aborted','preempted']), transitions = { 'succeeded' : 'CHECK_HEADING', 'aborted' : 'POSE_SELECTION' }, remapping = {'target_pose':'movebase_pose_global'}) # input (PoseStamped) smach.StateMachine.add( 'CHECK_HEADING', CheckHeading( listener = listener ), transitions = { 'succeeded':'ADJUST_HEADING' }, remapping = { 'target_pose':'movebase_pose_global', # input (PoseStamped) 'angular_error':'angular_error' }) # output (float) smach.StateMachine.add( 'ADJUST_HEADING', ServiceState( '/rotate_backup', RotateBackupSrv, request_slots = ['rotate']), # float (displace = 0.0) transitions = { 'succeeded':'MOVE_FORWARD' }, remapping = {'rotate':'angular_error'}) approach_goal = ApproachGoal() approach_goal.forward_vel = 0.05 approach_goal.forward_mult = 0.50 smach.StateMachine.add( 'MOVE_FORWARD', SimpleActionState( '/approach_table/move_forward_act', ApproachAction, goal = approach_goal ), transitions = { 'succeeded' : 'succeeded' }) return sm if __name__ == '__main__': rospy.init_node('smach_example_state_machine') # sm = sm_approach_table() sm = smach.StateMachine(outcomes=['succeeded','aborted','preempted'], input_keys = [ 'approach_poses' ]) p = Pose() p.position.x = 0.3879 p.position.y = 0.79838 p.position.z = 0.0 p.orientation.z = -0.704 p.orientation.w = 0.709 pa = PoseArray() pa.header.frame_id = '/map' pa.poses = [ p ] sm.userdata.table_edge_poses = pa with sm: sm_table = sm_approach_table() smach.StateMachine.add( 'APPROACH_TABLE', sm_table, remapping = {'table_edge_poses':'table_edge_poses', # input 'movebase_pose_global':'movebase_pose_global', # output 'table_edge_global':'table_edge_global'}, # output #transitions = {'succeeded':'MOVE_BACK'}) transitions = {'succeeded':'succeeded'}) # GRASP! # smach.StateMachine.add( # 'MOVE_BACK', # SimpleActionState( '/move_base', # MoveBaseAction, # goal_slots = ['target_pose'], # PoseStamped # outcomes = ['succeeded','aborted','preempted']), # transitions = { 'succeeded' : 'succeeded'}, # remapping = {'target_pose':'intermediate_pose'}) # input # GO DELIVER! sis = IntrospectionServer('Approach_Table', sm, '/SM_APPROACH_TABLE') sis.start() rospy.sleep( 3.0 ) outcome = sm.execute() sis.stop()
ajibawa-2023/Python-Code-Large/train/row_99348
127
303
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0066, 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_99348:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0099, 0.0033, 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_approach_table')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0132, 0.0033, 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": "roslib.load_manifest('rfid_behaviors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0165, 0.0033, 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_99348:Import_L7_C0", "label": "tf import tf", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0231, 0.0033, 0, 0.66, 0.2222, 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_99348:Import_L8_C0", "label": "tf.transformations import tft", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0264, 0.0033, 0, 0.66, 0.2778, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tft"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tft"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Import_L9_C0", "label": "smach import smach", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0297, 0.0033, 0, 0.66, 0.3333, 345, 0, 1, 0, 0, 345, 0, 0], "semantic": {"name": "smach", "arg_names": [], "import_names": ["smach"], "rhs_call_name": "", "annotation": ""}, "snippet": "import smach"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:ImportFrom_L10_C0", "label": "from smach_ros import SimpleActionState, ServiceState, IntrospectionServer", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.033, 0.0033, 0, 0.66, 0.3889, 716, 0, 3, 0, 0, 716, 0, 0], "semantic": {"name": "smach_ros", "arg_names": [], "import_names": ["SimpleActionState", "ServiceState", "IntrospectionServer"], "rhs_call_name": "", "annotation": ""}, "snippet": "from smach_ros import SimpleActionState, ServiceState, IntrospectionServer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Import_L11_C0", "label": "actionlib import actionlib", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0363, 0.0033, 0, 0.66, 0.4444, 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_99348:ImportFrom_L12_C0", "label": "from geometry_msgs.msg import PoseStamped, PoseArray, Pose\u2026", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0396, 0.0033, 0, 0.66, 0.5, 951, 0, 4, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["PoseStamped", "PoseArray", "Pose", "Quaternion"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import PoseStamped, PoseArray, Pose, Quaternion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:ImportFrom_L13_C0", "label": "from move_base_msgs.msg import MoveBaseAction", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0429, 0.0033, 0, 0.66, 0.5556, 440, 0, 1, 0, 0, 440, 0, 0], "semantic": {"name": "move_base_msgs.msg", "arg_names": [], "import_names": ["MoveBaseAction"], "rhs_call_name": "", "annotation": ""}, "snippet": "from move_base_msgs.msg import MoveBaseAction"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:ImportFrom_L15_C0", "label": "from pr2_approach_table.srv import ApproachSrv", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0495, 0.0033, 0, 0.66, 0.6111, 222, 0, 1, 0, 0, 222, 0, 0], "semantic": {"name": "pr2_approach_table.srv", "arg_names": [], "import_names": ["ApproachSrv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_approach_table.srv import ApproachSrv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:ImportFrom_L16_C0", "label": "from pr2_approach_table.msg import ApproachAction, ApproachResult, ApproachGoal", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0528, 0.0033, 0, 0.66, 0.6667, 860, 0, 3, 0, 0, 860, 0, 0], "semantic": {"name": "pr2_approach_table.msg", "arg_names": [], "import_names": ["ApproachAction", "ApproachResult", "ApproachGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_approach_table.msg import ApproachAction, ApproachResult, ApproachGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:ImportFrom_L17_C0", "label": "from rfid_behaviors.srv import RotateBackupSrv", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0561, 0.0033, 0, 0.66, 0.7222, 647, 0, 1, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["RotateBackupSrv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import FloatFloat_Int32 as RotateBackupSrv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Import_L19_C0", "label": "numpy import np, math", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0627, 0.0033, 0, 0.66, 0.7778, 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_99348:ClassDef_L21_C0", "label": "CheckHeading", "type": "class", "loc": [21, 66], "level": 0, "parent": null, "vector": [3, 0, 0.1436, 0.1518, 0, 0.66, 0.8333, 52, 0, 2, 0, 0, 892, 0, 14], "semantic": {"name": "CheckHeading", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CheckHeading(smach.State):\n def __init__(self, listener):\n smach.State.__init__(self,\n outcomes=['succeeded', 'preempted'],\n input_keys = ['target_pose'], # PoseStamped\n output_keys = ['angular_error']) # float\n self.listener = listener\n self.initialized = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L22_C4", "label": "__init__", "type": "function", "loc": [22, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:ClassDef_L21_C0", "vector": [2, 1, 0.0825, 0.0231, 1, 0.92, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "listener"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, listener):\n smach.State.__init__(self,\n outcomes=['succeeded', 'preempted'],\n input_keys = ['target_pose'], # PoseStamped\n output_keys = ['angular_error']) # float\n self.listener = listener\n self.initialized = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L23_C8", "label": "__init__()", "type": "expression", "loc": [23, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L22_C4", "vector": [8, 2, 0.0809, 0.0132, 2, 0.44, 0.0, 555, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " smach.State.__init__(self,\n outcomes=['succeeded', 'preempted'],\n input_keys = ['target_pose'], # PoseStamped\n output_keys = ['angular_error']) # float"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L27_C8", "label": "self.listener =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L22_C4", "vector": [14, 2, 0.0891, 0.0033, 2, 0.44, 0.5, 686, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.listener", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.listener = listener"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L28_C8", "label": "self.initialized =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L22_C4", "vector": [14, 2, 0.0924, 0.0033, 2, 0.44, 1.0, 841, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.initialized", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.initialized = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L30_C4", "label": "execute", "type": "function", "loc": [30, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:ClassDef_L21_C0", "vector": [2, 1, 0.1584, 0.1221, 1, 0.92, 1.0, 569, 0, 2, 1, 0, 0, 0, 13], "semantic": {"name": "execute", "arg_names": ["self", "userdata"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute(self, userdata):\n ps_desired = userdata.target_pose\n self.GLOBAL_FRAME = ps_desired.header.frame_id\n \n if not self.initialized:\n self.initialized = True\n # self.listener = tf.TransformListener() # this is now passed in.\n rospy.logout( 'CheckHeading (smach): Waiting on transforms from (%s -> %s)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L31_C8", "label": "ps_desired =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L30_C4", "vector": [14, 2, 0.1023, 0.0033, 2, 0.82, 0.0, 214, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps_desired", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps_desired = userdata.target_pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L32_C8", "label": "self.GLOBAL_FRAME =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L30_C4", "vector": [14, 2, 0.1056, 0.0033, 2, 0.82, 0.25, 498, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.GLOBAL_FRAME", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.GLOBAL_FRAME = ps_desired.header.frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L34_C8", "label": "if", "type": "if", "loc": [34, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L30_C4", "vector": [4, 2, 0.1254, 0.0297, 2, 0.82, 0.5, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.initialized:\n self.initialized = True\n # self.listener = tf.TransformListener() # this is now passed in.\n rospy.logout( 'CheckHeading (smach): Waiting on transforms from (%s -> %s)'\n % ( self.GLOBAL_FRAME, '/base_link' ))\n self.listener.waitForTransform( '/base_link',\n self.GLOBAL_FRAME,\n rospy.Time(0), timeout = rospy.Duration(30) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L35_C12", "label": "self.initialized =", "type": "assigned_variable", "loc": [35, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L34_C8", "vector": [14, 3, 0.1155, 0.0033, 3, 0.32, 0.0, 841, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.initialized", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.initialized = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L37_C12", "label": "logout()", "type": "expression", "loc": [37, 38], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L34_C8", "vector": [8, 3, 0.1238, 0.0066, 3, 0.32, 0.3333, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'CheckHeading (smach): Waiting on transforms from (%s -> %s)'\n % ( self.GLOBAL_FRAME, '/base_link' ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L39_C12", "label": "waitForTransform()", "type": "expression", "loc": [39, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L34_C8", "vector": [8, 3, 0.132, 0.0099, 3, 0.32, 0.6667, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.listener.waitForTransform( '/base_link',\n self.GLOBAL_FRAME,\n rospy.Time(0), timeout = rospy.Duration(30) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L42_C12", "label": "logout()", "type": "expression", "loc": [42, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L34_C8", "vector": [8, 3, 0.1386, 0.0033, 3, 0.32, 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( 'CheckHeading (smach): Ready.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "label": "try", "type": "try", "loc": [44, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L30_C4", "vector": [7, 2, 0.1799, 0.0726, 2, 0.82, 0.75, 0, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n ps = PoseStamped()\n ps.header.stamp = rospy.Time(0)\n ps.header.frame_id = '/base_link'\n ps.pose.orientation.w = 1.0\n\n ps_global = self.listener.transformPose( self.GLOBAL_FRAME, ps )\n efq = tft.euler_from_quaternion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L45_C12", "label": "ps = PoseStamped()", "type": "assigned_variable", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "vector": [14, 3, 0.1485, 0.0033, 3, 0.5, 0.0, 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_99348:Assign_L46_C12", "label": "ps.header.stamp = Time()", "type": "assigned_variable", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "vector": [14, 3, 0.1518, 0.0033, 3, 0.5, 0.1111, 161, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " ps.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L47_C12", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "vector": [14, 3, 0.1551, 0.0033, 3, 0.5, 0.2222, 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_99348:Assign_L48_C12", "label": "ps.pose.orientation.w =", "type": "assigned_variable", "loc": [48, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "vector": [14, 3, 0.1584, 0.0033, 3, 0.5, 0.3333, 163, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "ps.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.w = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L50_C12", "label": "ps_global = transformPose()", "type": "assigned_variable", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "vector": [14, 3, 0.165, 0.0033, 3, 0.5, 0.4444, 239, 3, 2, 0, 0, 654, 10, 1], "semantic": {"name": "ps_global", "arg_names": [], "import_names": [], "rhs_call_name": "transformPose", "annotation": ""}, "snippet": " ps_global = self.listener.transformPose( self.GLOBAL_FRAME, ps )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L51_C12", "label": "efq =", "type": "assigned_variable", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "vector": [14, 3, 0.1683, 0.0033, 3, 0.5, 0.5556, 607, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "efq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " efq = tft.euler_from_quaternion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L52_C12", "label": "r, p, yaw_curr = efq()", "type": "assigned_variable", "loc": [52, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "vector": [14, 3, 0.1766, 0.0132, 3, 0.5, 0.6667, 245, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "r, p, yaw_curr", "arg_names": [], "import_names": [], "rhs_call_name": "efq", "annotation": ""}, "snippet": " r,p,yaw_curr = efq(( ps_global.pose.orientation.x,\n ps_global.pose.orientation.y,\n ps_global.pose.orientation.z,\n ps_global.pose.orientation.w ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L56_C12", "label": "r, p, yaw_des = efq()", "type": "assigned_variable", "loc": [56, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "vector": [14, 3, 0.1898, 0.0132, 3, 0.5, 0.7778, 24, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "r, p, yaw_des", "arg_names": [], "import_names": [], "rhs_call_name": "efq", "annotation": ""}, "snippet": " r,p,yaw_des = efq(( ps_desired.pose.orientation.x,\n ps_desired.pose.orientation.y,\n ps_desired.pose.orientation.z,\n ps_desired.pose.orientation.w ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L61_C12", "label": "logout()", "type": "expression", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "vector": [8, 3, 0.2013, 0.0033, 3, 0.5, 0.8889, 525, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'CheckHeading (smach): Error was %3.2f (deg)' % math.degrees(yaw_des - yaw_curr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L62_C12", "label": "userdata.angular_error =", "type": "assigned_variable", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "vector": [14, 3, 0.2046, 0.0033, 3, 0.5, 1.0, 291, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "userdata.angular_error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " userdata.angular_error = yaw_des - yaw_curr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L64_C12", "label": "logout()", "type": "expression", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "vector": [8, 3, 0.2112, 0.0033, 3, 0.5, 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( 'CheckHeading (smach): TF failed. Returning ang error of 0.0' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L65_C12", "label": "userdata.angular_error =", "type": "assigned_variable", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "vector": [14, 3, 0.2145, 0.0033, 3, 0.5, 1.0, 291, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "userdata.angular_error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " userdata.angular_error = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Return_L66_C8", "label": "return", "type": "return", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L30_C4", "vector": [13, 2, 0.2178, 0.0033, 2, 0.82, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'succeeded'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:ClassDef_L69_C0", "label": "PoseSelection", "type": "class", "loc": [69, 163], "level": 0, "parent": null, "vector": [3, 0, 0.3828, 0.3135, 0, 0.66, 0.8889, 674, 0, 3, 0, 0, 892, 0, 24], "semantic": {"name": "PoseSelection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PoseSelection(smach.State):\n def __init__(self, listener):\n smach.State.__init__(self,\n outcomes=['succeeded', 'aborted'],\n input_keys=['candidate_poses'], # of type PoseArray!\n output_keys=['selected_pose_global', # of type PoseStamped!\n 'movebase_pose_global' ]) # of type PoseStamped!\n self.listener = listener"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L70_C4", "label": "__init__", "type": "function", "loc": [70, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:ClassDef_L69_C0", "vector": [2, 1, 0.2492, 0.0396, 1, 0.33, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "listener"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, listener):\n smach.State.__init__(self,\n outcomes=['succeeded', 'aborted'],\n input_keys=['candidate_poses'], # of type PoseArray!\n output_keys=['selected_pose_global', # of type PoseStamped!\n 'movebase_pose_global' ]) # of type PoseStamped!\n self.listener = listener\n self.poses = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L71_C8", "label": "__init__()", "type": "expression", "loc": [71, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L70_C4", "vector": [8, 2, 0.2409, 0.0165, 2, 0.29, 0.0, 555, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " smach.State.__init__(self,\n outcomes=['succeeded', 'aborted'],\n input_keys=['candidate_poses'], # of type PoseArray!\n output_keys=['selected_pose_global', # of type PoseStamped!\n 'movebase_pose_global' ]) # of type PoseStamped!"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L76_C8", "label": "self.listener =", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L70_C4", "vector": [14, 2, 0.2508, 0.0033, 2, 0.29, 0.2, 686, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.listener", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.listener = listener"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L77_C8", "label": "self.poses =", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L70_C4", "vector": [14, 2, 0.2541, 0.0033, 2, 0.29, 0.4, 872, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.poses", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.poses = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L78_C8", "label": "self.initialized =", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L70_C4", "vector": [14, 2, 0.2574, 0.0033, 2, 0.29, 0.6, 841, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.initialized", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.initialized = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L79_C8", "label": "self.ind =", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L70_C4", "vector": [14, 2, 0.2607, 0.0033, 2, 0.29, 0.8, 616, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.ind", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ind = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L81_C8", "label": "self.GLOBAL_FRAME =", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L70_C4", "vector": [14, 2, 0.2673, 0.0033, 2, 0.29, 1.0, 498, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.GLOBAL_FRAME", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.GLOBAL_FRAME = '/map'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L83_C4", "label": "execute", "type": "function", "loc": [83, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:ClassDef_L69_C0", "vector": [2, 1, 0.3251, 0.1056, 1, 0.33, 0.5, 569, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "execute", "arg_names": ["self", "userdata"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute(self, userdata):\n rospy.logout( 'Executing POSE_SELECTION' )\n\n poses_frame = userdata.candidate_poses.header.frame_id\n #dist = userdata.approach_dist\n dist = 0.80\n\n if not self.initialized:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L84_C8", "label": "logout()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L83_C4", "vector": [8, 2, 0.2772, 0.0033, 2, 0.47, 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( 'Executing POSE_SELECTION' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L86_C8", "label": "poses_frame =", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L83_C4", "vector": [14, 2, 0.2838, 0.0033, 2, 0.47, 0.1429, 89, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "poses_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " poses_frame = userdata.candidate_poses.header.frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L88_C8", "label": "dist =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L83_C4", "vector": [14, 2, 0.2904, 0.0033, 2, 0.47, 0.2857, 673, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dist = 0.80"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L90_C8", "label": "if", "type": "if", "loc": [90, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L83_C4", "vector": [4, 2, 0.3201, 0.0495, 2, 0.47, 0.4286, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.initialized:\n self.initialized = True\n self.ind = 0\n # self.listener = tf.TransformListener() # This is now passed in\n rospy.logout( 'PoseSelector (smach): Waiting on transforms from (%s -> %s)'\n % ( self.GLOBAL_FRAME, poses_frame ))\n self.listener.waitForTransform( poses_frame,\n self.GLOBAL_FRAME,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L91_C12", "label": "self.initialized =", "type": "assigned_variable", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L90_C8", "vector": [14, 3, 0.3003, 0.0033, 3, 0.13, 0.0, 841, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.initialized", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.initialized = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L92_C12", "label": "self.ind =", "type": "assigned_variable", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L90_C8", "vector": [14, 3, 0.3036, 0.0033, 3, 0.13, 0.1667, 616, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.ind", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ind = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L94_C12", "label": "logout()", "type": "expression", "loc": [94, 95], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L90_C8", "vector": [8, 3, 0.3119, 0.0066, 3, 0.13, 0.3333, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'PoseSelector (smach): Waiting on transforms from (%s -> %s)'\n % ( self.GLOBAL_FRAME, poses_frame ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L96_C12", "label": "waitForTransform()", "type": "expression", "loc": [96, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L90_C8", "vector": [8, 3, 0.3201, 0.0099, 3, 0.13, 0.5, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.listener.waitForTransform( poses_frame,\n self.GLOBAL_FRAME,\n rospy.Time(0), timeout = rospy.Duration(30) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L99_C12", "label": "logout()", "type": "expression", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L90_C8", "vector": [8, 3, 0.3267, 0.0033, 3, 0.13, 0.6667, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'PoseSelector (smach): Ready.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L103_C12", "label": "frame_adjusted =", "type": "assigned_variable", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L90_C8", "vector": [14, 3, 0.3399, 0.0033, 3, 0.13, 0.8333, 46, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "frame_adjusted", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frame_adjusted = [ self.frame_adjust(i,poses_frame,dist) for i in userdata.candidate_poses.poses ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L104_C12", "label": "self.poses =", "type": "assigned_variable", "loc": [104, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L90_C8", "vector": [14, 3, 0.3432, 0.0033, 3, 0.13, 1.0, 872, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.poses", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.poses = [ i for i in frame_adjusted if i != None ] # in case the transforms fail."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L106_C8", "label": "if", "type": "if", "loc": [106, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L83_C4", "vector": [4, 2, 0.3515, 0.0066, 2, 0.47, 0.5714, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len( self.poses ) == 0 or self.ind >= len( self.poses ): # we've tried everything...\n return 'aborted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Return_L107_C12", "label": "return", "type": "return", "loc": [107, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L106_C8", "vector": [13, 3, 0.3531, 0.0033, 3, 0.32, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'aborted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L110_C8", "label": "userdata.selected_pose_global =", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L83_C4", "vector": [14, 2, 0.363, 0.0033, 2, 0.47, 0.7143, 953, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "userdata.selected_pose_global", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " userdata.selected_pose_global = self.poses[ self.ind ][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L111_C8", "label": "userdata.movebase_pose_global =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L83_C4", "vector": [14, 2, 0.3663, 0.0033, 2, 0.47, 0.8571, 457, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "userdata.movebase_pose_global", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " userdata.movebase_pose_global = self.poses[ self.ind ][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Return_L114_C8", "label": "return", "type": "return", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L83_C4", "vector": [13, 2, 0.3762, 0.0033, 2, 0.47, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'succeeded'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L116_C4", "label": "frame_adjust", "type": "function", "loc": [116, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:ClassDef_L69_C0", "vector": [2, 1, 0.4604, 0.1584, 1, 0.33, 1.0, 606, 0, 5, 1, 0, 0, 0, 14], "semantic": {"name": "frame_adjust", "arg_names": ["self", "pose", "poses_frame", "dist", "arm_offset"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def frame_adjust( self, pose, poses_frame, dist, arm_offset = 0.0 ):\n # Adjust all incoming candidate poses into a \"Global\" frame.\n # Positive arm offset to move the approach point \"right\"\n ps = PoseStamped()\n ps.header.frame_id = poses_frame\n ps.header.stamp = rospy.Time(0)\n ps.pose = pose\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L119_C8", "label": "ps = PoseStamped()", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L116_C4", "vector": [14, 2, 0.3927, 0.0033, 2, 0.76, 0.0, 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_99348:Assign_L120_C8", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L116_C4", "vector": [14, 2, 0.396, 0.0033, 2, 0.76, 0.1111, 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 = poses_frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L121_C8", "label": "ps.header.stamp = Time()", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L116_C4", "vector": [14, 2, 0.3993, 0.0033, 2, 0.76, 0.2222, 161, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " ps.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L122_C8", "label": "ps.pose =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L116_C4", "vector": [14, 2, 0.4026, 0.0033, 2, 0.76, 0.3333, 529, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose = pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L126_C8", "label": "efq =", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L116_C4", "vector": [14, 2, 0.4158, 0.0033, 2, 0.76, 0.4444, 607, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "efq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " efq = tft.euler_from_quaternion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L127_C8", "label": "r, p, y = efq()", "type": "assigned_variable", "loc": [127, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L116_C4", "vector": [14, 2, 0.4241, 0.0132, 2, 0.76, 0.5556, 387, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "r, p, y", "arg_names": [], "import_names": [], "rhs_call_name": "efq", "annotation": ""}, "snippet": " r,p,y = efq(( pose.orientation.x,\n pose.orientation.y,\n pose.orientation.z,\n pose.orientation.w ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L131_C8", "label": "ps.pose.position.x =", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L116_C4", "vector": [14, 2, 0.4323, 0.0033, 2, 0.76, 0.6667, 782, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ps.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.position.x = pose.position.x + arm_offset * np.cos( y + np.pi/2 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L132_C8", "label": "ps.pose.position.y =", "type": "assigned_variable", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L116_C4", "vector": [14, 2, 0.4356, 0.0033, 2, 0.76, 0.7778, 661, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ps.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.position.y = pose.position.y + arm_offset * np.sin( y + np.pi/2 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "label": "try", "type": "try", "loc": [136, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L116_C4", "vector": [7, 2, 0.4901, 0.0858, 2, 0.76, 0.8889, 0, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n ps_global = self.listener.transformPose( self.GLOBAL_FRAME, ps )\n ps_global.pose.position.z = 0.0\n # print 'PS:\\n', ps, '\\nPS_GLOBAL:\\n', ps_global\n\n r,p,y = efq(( ps_global.pose.orientation.x,\n ps_global.pose.orientation.y,\n ps_global.pose.orientation.z,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L137_C12", "label": "ps_global = transformPose()", "type": "assigned_variable", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "vector": [14, 3, 0.4521, 0.0033, 3, 0.79, 0.0, 239, 3, 2, 0, 0, 654, 10, 1], "semantic": {"name": "ps_global", "arg_names": [], "import_names": [], "rhs_call_name": "transformPose", "annotation": ""}, "snippet": " ps_global = self.listener.transformPose( self.GLOBAL_FRAME, ps )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L138_C12", "label": "ps_global.pose.position.z =", "type": "assigned_variable", "loc": [138, 138], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "vector": [14, 3, 0.4554, 0.0033, 3, 0.79, 0.1, 706, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "ps_global.pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps_global.pose.position.z = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L141_C12", "label": "r, p, y = efq()", "type": "assigned_variable", "loc": [141, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "vector": [14, 3, 0.4703, 0.0132, 3, 0.79, 0.2, 387, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "r, p, y", "arg_names": [], "import_names": [], "rhs_call_name": "efq", "annotation": ""}, "snippet": " r,p,y = efq(( ps_global.pose.orientation.x,\n ps_global.pose.orientation.y,\n ps_global.pose.orientation.z,\n ps_global.pose.orientation.w ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L147_C12", "label": "mps = PoseStamped()", "type": "assigned_variable", "loc": [147, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "vector": [14, 3, 0.4851, 0.0033, 3, 0.79, 0.3, 663, 3, 0, 0, 0, 226, 10, 1], "semantic": {"name": "mps", "arg_names": [], "import_names": [], "rhs_call_name": "PoseStamped", "annotation": ""}, "snippet": " mps = PoseStamped() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L148_C12", "label": "mps.header.frame_id =", "type": "assigned_variable", "loc": [148, 148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "vector": [14, 3, 0.4884, 0.0033, 3, 0.79, 0.4, 184, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mps.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mps.header.frame_id = ps_global.header.frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L149_C12", "label": "mps.header.stamp = now()", "type": "assigned_variable", "loc": [149, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "vector": [14, 3, 0.4917, 0.0033, 3, 0.79, 0.5, 793, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "mps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " mps.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L150_C12", "label": "mps.pose.position.x =", "type": "assigned_variable", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "vector": [14, 3, 0.495, 0.0033, 3, 0.79, 0.6, 335, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "mps.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mps.pose.position.x = ps_global.pose.position.x + dist * np.cos( y )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L151_C12", "label": "mps.pose.position.y =", "type": "assigned_variable", "loc": [151, 151], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "vector": [14, 3, 0.4983, 0.0033, 3, 0.79, 0.7, 802, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "mps.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mps.pose.position.y = ps_global.pose.position.y + dist * np.sin( y )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L152_C12", "label": "qfe =", "type": "assigned_variable", "loc": [152, 152], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "vector": [14, 3, 0.5017, 0.0033, 3, 0.79, 0.8, 714, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "qfe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qfe = tft.quaternion_from_euler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L153_C12", "label": "mps.pose.orientation = Quaternion()", "type": "assigned_variable", "loc": [153, 153], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "vector": [14, 3, 0.505, 0.0033, 3, 0.79, 0.9, 19, 3, 1, 0, 0, 747, 10, 2], "semantic": {"name": "mps.pose.orientation", "arg_names": [], "import_names": [], "rhs_call_name": "Quaternion", "annotation": ""}, "snippet": " mps.pose.orientation = Quaternion( *qfe( 0.0, 0.0, y - np.pi ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L157_C12", "label": "rv =", "type": "assigned_variable", "loc": [157, 157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "vector": [14, 3, 0.5182, 0.0033, 3, 0.79, 1.0, 222, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "rv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rv = [ ps_global, mps ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L160_C12", "label": "logout()", "type": "expression", "loc": [160, 160], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "vector": [8, 3, 0.5281, 0.0033, 3, 0.79, 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( 'PoseSelector (smach): TF failed. Ignoring pose.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L161_C12", "label": "rv =", "type": "assigned_variable", "loc": [161, 161], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "vector": [14, 3, 0.5314, 0.0033, 3, 0.79, 1.0, 222, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "rv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rv = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Return_L163_C8", "label": "return", "type": "return", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L116_C4", "vector": [13, 2, 0.538, 0.0033, 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 rv # Return value: selected_pose_global (PoseStamped), movebase_pose_global (PoseStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L167_C0", "label": "sm_approach_table", "type": "function", "loc": [167, 235], "level": 0, "parent": null, "vector": [2, 0, 0.6634, 0.2277, 0, 0.66, 0.9444, 227, 0, 1, 1, 0, 0, 0, 15], "semantic": {"name": "sm_approach_table", "arg_names": ["listener"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def sm_approach_table( listener = None ):\n \n # for various states, you need a tf listener, but only one per thread supported.\n if listener == None:\n try:\n rospy.init_node( 'sm_approach' )\n except:\n rospy.logout( 'sm_approach_table: Node already initialized elsewhere' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L170_C4", "label": "if", "type": "if", "loc": [170, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L167_C0", "vector": [4, 1, 0.571, 0.0231, 1, 0.01, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if listener == None:\n try:\n rospy.init_node( 'sm_approach' )\n except:\n rospy.logout( 'sm_approach_table: Node already initialized elsewhere' )\n\n listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L171_C8", "label": "try", "type": "try", "loc": [171, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L170_C4", "vector": [7, 2, 0.5693, 0.0132, 2, 0.6, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node( 'sm_approach' )\n except:\n rospy.logout( 'sm_approach_table: Node already initialized elsewhere' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L172_C12", "label": "init_node()", "type": "expression", "loc": [172, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L171_C8", "vector": [8, 3, 0.5677, 0.0033, 3, 0.43, 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( 'sm_approach' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L174_C12", "label": "logout()", "type": "expression", "loc": [174, 174], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L171_C8", "vector": [8, 3, 0.5743, 0.0033, 3, 0.43, 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( 'sm_approach_table: Node already initialized elsewhere' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L176_C8", "label": "listener = TransformListener()", "type": "assigned_variable", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L170_C4", "vector": [14, 2, 0.5809, 0.0033, 2, 0.6, 1.0, 870, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "listener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L183_C4", "label": "sm = StateMachine()", "type": "assigned_variable", "loc": [183, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L167_C0", "vector": [14, 1, 0.6089, 0.0132, 1, 0.01, 0.5, 21, 3, 3, 0, 0, 174, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "StateMachine", "annotation": ""}, "snippet": " sm = smach.StateMachine( outcomes = ['succeeded','aborted','preempted'],\n input_keys = ['table_edge_poses'], # type PoseArray\n output_keys = ['movebase_pose_global', # type PoseStamped\n 'table_edge_global']) # type PoseStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L190_C8", "label": "add()", "type": "expression", "loc": [190, 196], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L167_C0", "vector": [8, 1, 0.637, 0.0231, 1, 0.01, 0.0, 241, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'POSE_SELECTION',\n PoseSelection( listener = listener ),\n transitions = { 'succeeded' : 'MOVE_BASE' },\n remapping = {'candidate_poses':'table_edge_poses', # input (PoseArray)\n 'selected_pose_global':'table_edge_global', # output (PoseStamped)\n 'movebase_pose_global':'movebase_pose_global'}) # output (PoseStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L199_C8", "label": "add()", "type": "expression", "loc": [199, 207], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L167_C0", "vector": [8, 1, 0.67, 0.0297, 1, 0.01, 0.1429, 241, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'MOVE_BASE',\n SimpleActionState( '/move_base',\n MoveBaseAction,\n goal_slots = ['target_pose'], # PoseStamped\n outcomes = ['succeeded','aborted','preempted']),\n transitions = { 'succeeded' : 'CHECK_HEADING',\n 'aborted' : 'POSE_SELECTION' },"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L209_C8", "label": "add()", "type": "expression", "loc": [209, 214], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L167_C0", "vector": [8, 1, 0.698, 0.0198, 1, 0.01, 0.2857, 241, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'CHECK_HEADING',\n CheckHeading( listener = listener ),\n transitions = { 'succeeded':'ADJUST_HEADING' },\n remapping = { 'target_pose':'movebase_pose_global', # input (PoseStamped)\n 'angular_error':'angular_error' }) # output (float)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L216_C8", "label": "add()", "type": "expression", "loc": [216, 222], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L167_C0", "vector": [8, 1, 0.7228, 0.0231, 1, 0.01, 0.4286, 241, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'ADJUST_HEADING',\n ServiceState( '/rotate_backup',\n RotateBackupSrv,\n request_slots = ['rotate']), # float (displace = 0.0)\n transitions = { 'succeeded':'MOVE_FORWARD' },\n remapping = {'rotate':'angular_error'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L225_C8", "label": "approach_goal = ApproachGoal()", "type": "assigned_variable", "loc": [225, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L167_C0", "vector": [14, 1, 0.7426, 0.0033, 1, 0.01, 0.5714, 862, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "approach_goal", "arg_names": [], "import_names": [], "rhs_call_name": "ApproachGoal", "annotation": ""}, "snippet": " approach_goal = ApproachGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L226_C8", "label": "approach_goal.forward_vel =", "type": "assigned_variable", "loc": [226, 226], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L167_C0", "vector": [14, 1, 0.7459, 0.0033, 1, 0.01, 0.7143, 28, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "approach_goal.forward_vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " approach_goal.forward_vel = 0.05"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L227_C8", "label": "approach_goal.forward_mult =", "type": "assigned_variable", "loc": [227, 227], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L167_C0", "vector": [14, 1, 0.7492, 0.0033, 1, 0.01, 0.8571, 223, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "approach_goal.forward_mult", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " approach_goal.forward_mult = 0.50"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L228_C8", "label": "add()", "type": "expression", "loc": [228, 233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L167_C0", "vector": [8, 1, 0.7607, 0.0198, 1, 0.01, 1.0, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'MOVE_FORWARD',\n SimpleActionState( '/approach_table/move_forward_act',\n ApproachAction,\n goal = approach_goal ),\n transitions = { 'succeeded' : 'succeeded' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Return_L235_C4", "label": "return", "type": "return", "loc": [235, 235], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L167_C0", "vector": [13, 1, 0.7756, 0.0033, 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 sm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "label": "if", "type": "if", "loc": [240, 295], "level": 0, "parent": null, "vector": [4, 0, 0.8828, 0.1848, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n rospy.init_node('smach_example_state_machine')\n\n # sm = sm_approach_table()\n\n sm = smach.StateMachine(outcomes=['succeeded','aborted','preempted'],\n input_keys = [ 'approach_poses' ])\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L241_C4", "label": "init_node()", "type": "expression", "loc": [241, 241], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "vector": [8, 1, 0.7954, 0.0033, 1, 0.03, 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('smach_example_state_machine')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L245_C4", "label": "sm = StateMachine()", "type": "assigned_variable", "loc": [245, 246], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "vector": [14, 1, 0.8102, 0.0066, 1, 0.03, 0.0625, 21, 3, 2, 0, 0, 174, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "StateMachine", "annotation": ""}, "snippet": " sm = smach.StateMachine(outcomes=['succeeded','aborted','preempted'],\n input_keys = [ 'approach_poses' ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L248_C4", "label": "p = Pose()", "type": "assigned_variable", "loc": [248, 248], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "vector": [14, 1, 0.8185, 0.0033, 1, 0.03, 0.125, 491, 3, 0, 0, 0, 902, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "Pose", "annotation": ""}, "snippet": " p = Pose()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L249_C4", "label": "p.position.x =", "type": "assigned_variable", "loc": [249, 249], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "vector": [14, 1, 0.8218, 0.0033, 1, 0.03, 0.1875, 581, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "p.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.position.x = 0.3879"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L250_C4", "label": "p.position.y =", "type": "assigned_variable", "loc": [250, 250], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "vector": [14, 1, 0.8251, 0.0033, 1, 0.03, 0.25, 503, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "p.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.position.y = 0.79838"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L251_C4", "label": "p.position.z =", "type": "assigned_variable", "loc": [251, 251], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "vector": [14, 1, 0.8284, 0.0033, 1, 0.03, 0.3125, 783, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "p.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.position.z = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L253_C4", "label": "p.orientation.z =", "type": "assigned_variable", "loc": [253, 253], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "vector": [14, 1, 0.835, 0.0033, 1, 0.03, 0.375, 10, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.orientation.z = -0.704"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L254_C4", "label": "p.orientation.w =", "type": "assigned_variable", "loc": [254, 254], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "vector": [14, 1, 0.8383, 0.0033, 1, 0.03, 0.4375, 975, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "p.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.orientation.w = 0.709"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L256_C4", "label": "pa = PoseArray()", "type": "assigned_variable", "loc": [256, 256], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "vector": [14, 1, 0.8449, 0.0033, 1, 0.03, 0.5, 418, 3, 0, 0, 0, 430, 10, 1], "semantic": {"name": "pa", "arg_names": [], "import_names": [], "rhs_call_name": "PoseArray", "annotation": ""}, "snippet": " pa = PoseArray()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L257_C4", "label": "pa.header.frame_id =", "type": "assigned_variable", "loc": [257, 257], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "vector": [14, 1, 0.8482, 0.0033, 1, 0.03, 0.5625, 985, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "pa.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pa.header.frame_id = '/map'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L258_C4", "label": "pa.poses =", "type": "assigned_variable", "loc": [258, 258], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "vector": [14, 1, 0.8515, 0.0033, 1, 0.03, 0.625, 626, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pa.poses", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pa.poses = [ p ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L260_C4", "label": "sm.userdata.table_edge_poses =", "type": "assigned_variable", "loc": [260, 260], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "vector": [14, 1, 0.8581, 0.0033, 1, 0.03, 0.6875, 469, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sm.userdata.table_edge_poses", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sm.userdata.table_edge_poses = pa"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L263_C8", "label": "sm_table = sm_approach_table()", "type": "assigned_variable", "loc": [263, 263], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "vector": [14, 1, 0.868, 0.0033, 1, 0.03, 0.0, 814, 3, 0, 0, 0, 227, 10, 1], "semantic": {"name": "sm_table", "arg_names": [], "import_names": [], "rhs_call_name": "sm_approach_table", "annotation": ""}, "snippet": " sm_table = sm_approach_table()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L265_C8", "label": "add()", "type": "expression", "loc": [265, 272], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "vector": [8, 1, 0.8861, 0.0264, 1, 0.03, 1.0, 241, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'APPROACH_TABLE',\n sm_table,\n remapping = {'table_edge_poses':'table_edge_poses', # input\n 'movebase_pose_global':'movebase_pose_global', # output\n 'table_edge_global':'table_edge_global'}, # output\n #transitions = {'succeeded':'MOVE_BACK'})\n transitions = {'succeeded':'succeeded'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L288_C4", "label": "sis = IntrospectionServer()", "type": "assigned_variable", "loc": [288, 288], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "vector": [14, 1, 0.9505, 0.0033, 1, 0.03, 0.75, 608, 3, 3, 0, 0, 702, 10, 1], "semantic": {"name": "sis", "arg_names": [], "import_names": [], "rhs_call_name": "IntrospectionServer", "annotation": ""}, "snippet": " sis = IntrospectionServer('Approach_Table', sm, '/SM_APPROACH_TABLE')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L289_C4", "label": "start()", "type": "expression", "loc": [289, 289], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "vector": [8, 1, 0.9538, 0.0033, 1, 0.03, 0.8125, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " sis.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L292_C4", "label": "sleep()", "type": "expression", "loc": [292, 292], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "vector": [8, 1, 0.9637, 0.0033, 1, 0.03, 0.875, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( 3.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L293_C4", "label": "outcome = execute()", "type": "assigned_variable", "loc": [293, 293], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "vector": [14, 1, 0.967, 0.0033, 1, 0.03, 0.9375, 805, 3, 0, 0, 0, 569, 10, 1], "semantic": {"name": "outcome", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " outcome = sm.execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L295_C4", "label": "stop()", "type": "expression", "loc": [295, 295], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "vector": [8, 1, 0.9736, 0.0033, 1, 0.03, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " sis.stop()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99348:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L34_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L35_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L34_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L34_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L39_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L34_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L42_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Return_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:ClassDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:ClassDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L94_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L96_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L104_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Return_L107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Return_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:ClassDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L138_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L141_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L148_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L149_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L150_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L151_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L152_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L153_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L157_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L160_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L161_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Return_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L167_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L171_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:Try_L171_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L174_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L167_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L167_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L167_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L167_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L167_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L167_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L167_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L167_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L167_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:FunctionDef_L167_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Return_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L241_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L245_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L248_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L249_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L250_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L251_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L253_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L254_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L256_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L257_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L258_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L260_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L265_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L288_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L289_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L292_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Assign_L293_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99348:If_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99348:Expr_L295_C4"}]
#! /usr/bin/python import numpy as np import roslib; roslib.load_manifest('hrl_clickable_behaviors') import rospy import std_srvs.srv import actionlib import tf.transformations as tf_trans from tf.listener import TransformListener from geometry_msgs.msg import Quaternion from hrl_clickable_world.srv import PerceiveButtons, ButtonAction, DisplayButtons from hrl_clickable_world.srv import PerceiveButtonsResponse, ButtonActionResponse from geometry_msgs.msg import Point, PoseStamped from visualization_msgs.msg import Marker from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal from hrl_move_floor_detect.srv import SegmentFloor class MoveFloorButton: def __init__(self): self.tl = TransformListener() self.perception_srv = rospy.Service("/clickable_world/detect_empty_floor", PerceiveButtons, self.do_perception) self.percept_pub = rospy.Publisher("/clickable_world/floor_button_vis", Marker) self.goal_pub = rospy.Publisher("/clickable_world/move_floor_goal", PoseStamped) self.action_srv = rospy.Service("/clickable_world/move_empty_floor", ButtonAction, self.do_action) self.floor_seg_srv = rospy.ServiceProxy("/move_floor_detect", SegmentFloor) self.floor_move_client = actionlib.SimpleActionClient("move_base", MoveBaseAction) rospy.loginfo("[move_floor_button] MoveFloorButton loaded.") def do_perception(self, req): # segment surfaces rospy.loginfo("[move_floor_button] Segmenting floor") self.surfaces = self.floor_seg_srv().surfaces for i in range(len(self.surfaces)): self.surfaces[i].color.r = 0 self.surfaces[i].color.g = 0 self.surfaces[i].color.b = 256 self.surfaces[i].color.a = 256 if len(self.surfaces) != 0: self.percept_pub.publish(self.surfaces[0]) resp = PerceiveButtonsResponse() resp.buttons = self.surfaces return resp def do_action(self, req): rospy.loginfo("[move_floor_button] MoveFloorButton clicked!") # put 3d pt in base frame req.pixel3d.header.stamp = rospy.Time(0) move_pt = self.tl.transformPoint("/base_link", req.pixel3d) floor_move_goal = MoveBaseGoal() floor_move_goal.target_pose.header.frame_id = move_pt.header.frame_id floor_move_goal.target_pose.pose.position = move_pt.point quat = tf_trans.quaternion_from_euler(0, 0, np.arctan2(move_pt.point.y, move_pt.point.x)) floor_move_goal.target_pose.pose.orientation = Quaternion(quat[0], quat[1], quat[2], quat[3]) floor_move_goal.target_pose.header.frame_id = "/base_link" floor_move_goal.target_pose.header.stamp = rospy.Time.now() try: self.goal_pub.publish(floor_move_goal.target_pose) self.floor_move_client.send_goal(floor_move_goal) self.floor_move_client.wait_for_result() cur_pose = self.floor_move_client.get_result() except rospy.ROSInterruptException: print "[move_floor_button] Move floor failed" return ButtonActionResponse() def main(): rospy.init_node('move_floor_button') tb = MoveFloorButton() rospy.spin() if __name__ == "__main__": main()
ajibawa-2023/Python-Code-Large/train/row_99349
62
82
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0366, 0.0122, 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_99349:Import_L5_C0", "label": "roslib import roslib", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.061, 0.0122, 0, 0.66, 0.0588, 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_clickable_behaviors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Expr_L5_C15", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.061, 0.0122, 0, 0.66, 0.1176, 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_clickable_behaviors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Import_L6_C0", "label": "rospy import rospy", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0732, 0.0122, 0, 0.66, 0.1765, 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_99349:Import_L7_C0", "label": "std_srvs.srv import std_srvs.srv", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0854, 0.0122, 0, 0.66, 0.2353, 261, 0, 1, 0, 0, 261, 0, 0], "semantic": {"name": "std_srvs.srv", "arg_names": [], "import_names": ["std_srvs.srv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import std_srvs.srv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Import_L8_C0", "label": "actionlib import actionlib", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0976, 0.0122, 0, 0.66, 0.2941, 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_99349:Import_L9_C0", "label": "tf.transformations import tf_trans", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1098, 0.0122, 0, 0.66, 0.3529, 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_99349:ImportFrom_L10_C0", "label": "from tf.listener import TransformListener", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.122, 0.0122, 0, 0.66, 0.4118, 577, 0, 1, 0, 0, 577, 0, 0], "semantic": {"name": "tf.listener", "arg_names": [], "import_names": ["TransformListener"], "rhs_call_name": "", "annotation": ""}, "snippet": "from tf.listener import TransformListener"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:ImportFrom_L11_C0", "label": "from geometry_msgs.msg import Quaternion", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1341, 0.0122, 0, 0.66, 0.4706, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Quaternion"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Quaternion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:ImportFrom_L13_C0", "label": "from hrl_clickable_world.srv import PerceiveButtons, ButtonAction, DisplayButtons", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.1585, 0.0122, 0, 0.66, 0.5294, 612, 0, 3, 0, 0, 612, 0, 0], "semantic": {"name": "hrl_clickable_world.srv", "arg_names": [], "import_names": ["PerceiveButtons", "ButtonAction", "DisplayButtons"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_clickable_world.srv import PerceiveButtons, ButtonAction, DisplayButtons"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:ImportFrom_L14_C0", "label": "from hrl_clickable_world.srv import PerceiveButtonsResponse, ButtonActionResponse", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.1707, 0.0122, 0, 0.66, 0.5882, 612, 0, 2, 0, 0, 612, 0, 0], "semantic": {"name": "hrl_clickable_world.srv", "arg_names": [], "import_names": ["PerceiveButtonsResponse", "ButtonActionResponse"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_clickable_world.srv import PerceiveButtonsResponse, ButtonActionResponse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:ImportFrom_L15_C0", "label": "from geometry_msgs.msg import Point, PoseStamped", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1829, 0.0122, 0, 0.66, 0.6471, 951, 0, 2, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Point", "PoseStamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Point, PoseStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:ImportFrom_L16_C0", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1951, 0.0122, 0, 0.66, 0.7059, 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_99349:ImportFrom_L17_C0", "label": "from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.2073, 0.0122, 0, 0.66, 0.7647, 440, 0, 2, 0, 0, 440, 0, 0], "semantic": {"name": "move_base_msgs.msg", "arg_names": [], "import_names": ["MoveBaseAction", "MoveBaseGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:ImportFrom_L19_C0", "label": "from hrl_move_floor_detect.srv import SegmentFloor", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.2317, 0.0122, 0, 0.66, 0.8235, 450, 0, 1, 0, 0, 450, 0, 0], "semantic": {"name": "hrl_move_floor_detect.srv", "arg_names": [], "import_names": ["SegmentFloor"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_move_floor_detect.srv import SegmentFloor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:ClassDef_L21_C0", "label": "MoveFloorButton", "type": "class", "loc": [21, 74], "level": 0, "parent": null, "vector": [3, 0, 0.5793, 0.6585, 0, 0.66, 0.8824, 429, 0, 3, 0, 0, 0, 0, 29], "semantic": {"name": "MoveFloorButton", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MoveFloorButton:\n def __init__(self):\n self.tl = TransformListener()\n self.perception_srv = rospy.Service(\"/clickable_world/detect_empty_floor\",\n PerceiveButtons,\n self.do_perception)\n self.percept_pub = rospy.Publisher(\"/clickable_world/floor_button_vis\",\n Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L22_C4", "label": "__init__", "type": "function", "loc": [22, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:ClassDef_L21_C0", "vector": [2, 1, 0.3537, 0.1829, 1, 0.97, 0.0, 555, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.tl = TransformListener()\n self.perception_srv = rospy.Service(\"/clickable_world/detect_empty_floor\",\n PerceiveButtons,\n self.do_perception)\n self.percept_pub = rospy.Publisher(\"/clickable_world/floor_button_vis\",\n Marker)\n self.goal_pub = rospy.Publisher(\"/clickable_world/move_floor_goal\", PoseStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L23_C8", "label": "self.tl = TransformListener()", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L22_C4", "vector": [14, 2, 0.2805, 0.0122, 2, 0.01, 0.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 = TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L24_C8", "label": "self.perception_srv = Service()", "type": "assigned_variable", "loc": [24, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L22_C4", "vector": [14, 2, 0.3049, 0.0366, 2, 0.01, 0.1429, 432, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self.perception_srv", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self.perception_srv = rospy.Service(\"/clickable_world/detect_empty_floor\",\n PerceiveButtons,\n self.do_perception)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L27_C8", "label": "self.percept_pub = Publisher()", "type": "assigned_variable", "loc": [27, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L22_C4", "vector": [14, 2, 0.3354, 0.0244, 2, 0.01, 0.2857, 902, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.percept_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.percept_pub = rospy.Publisher(\"/clickable_world/floor_button_vis\",\n Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L29_C8", "label": "self.goal_pub = Publisher()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L22_C4", "vector": [14, 2, 0.3537, 0.0122, 2, 0.01, 0.4286, 981, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.goal_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.goal_pub = rospy.Publisher(\"/clickable_world/move_floor_goal\", PoseStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L30_C8", "label": "self.action_srv = Service()", "type": "assigned_variable", "loc": [30, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L22_C4", "vector": [14, 2, 0.378, 0.0366, 2, 0.01, 0.5714, 932, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self.action_srv", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self.action_srv = rospy.Service(\"/clickable_world/move_empty_floor\",\n ButtonAction,\n self.do_action)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L33_C8", "label": "self.floor_seg_srv = ServiceProxy()", "type": "assigned_variable", "loc": [33, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L22_C4", "vector": [14, 2, 0.4085, 0.0244, 2, 0.01, 0.7143, 513, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.floor_seg_srv", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.floor_seg_srv = rospy.ServiceProxy(\"/move_floor_detect\",\n SegmentFloor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L35_C8", "label": "self.floor_move_client = SimpleActionClient()", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L22_C4", "vector": [14, 2, 0.4268, 0.0122, 2, 0.01, 0.8571, 155, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "self.floor_move_client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.floor_move_client = actionlib.SimpleActionClient(\"move_base\", MoveBaseAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Expr_L36_C8", "label": "loginfo()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L22_C4", "vector": [8, 2, 0.439, 0.0122, 2, 0.01, 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(\"[move_floor_button] MoveFloorButton loaded.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L38_C4", "label": "do_perception", "type": "function", "loc": [38, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:ClassDef_L21_C0", "vector": [2, 1, 0.5488, 0.1829, 1, 0.97, 0.5, 400, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "do_perception", "arg_names": ["self", "req"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def do_perception(self, req):\n # segment surfaces\n rospy.loginfo(\"[move_floor_button] Segmenting floor\")\n self.surfaces = self.floor_seg_srv().surfaces\n for i in range(len(self.surfaces)):\n self.surfaces[i].color.r = 0\n self.surfaces[i].color.g = 0\n self.surfaces[i].color.b = 256"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Expr_L40_C8", "label": "loginfo()", "type": "expression", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L38_C4", "vector": [8, 2, 0.4878, 0.0122, 2, 0.48, 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_floor_button] Segmenting floor\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L41_C8", "label": "self.surfaces =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L38_C4", "vector": [14, 2, 0.5, 0.0122, 2, 0.48, 0.1667, 962, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.surfaces", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.surfaces = self.floor_seg_srv().surfaces"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:For_L42_C8", "label": "for i", "type": "for", "loc": [42, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L38_C4", "vector": [6, 2, 0.5366, 0.061, 2, 0.48, 0.3333, 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(self.surfaces)):\n self.surfaces[i].color.r = 0\n self.surfaces[i].color.g = 0\n self.surfaces[i].color.b = 256\n self.surfaces[i].color.a = 256"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L43_C12", "label": "self.surfaces[i].color.r =", "type": "assigned_variable", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:For_L42_C8", "vector": [14, 3, 0.5244, 0.0122, 3, 0.75, 0.0, 96, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.surfaces[i].color.r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.surfaces[i].color.r = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L44_C12", "label": "self.surfaces[i].color.g =", "type": "assigned_variable", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:For_L42_C8", "vector": [14, 3, 0.5366, 0.0122, 3, 0.75, 0.3333, 215, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.surfaces[i].color.g", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.surfaces[i].color.g = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L45_C12", "label": "self.surfaces[i].color.b =", "type": "assigned_variable", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:For_L42_C8", "vector": [14, 3, 0.5488, 0.0122, 3, 0.75, 0.6667, 763, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.surfaces[i].color.b", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.surfaces[i].color.b = 256"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L46_C12", "label": "self.surfaces[i].color.a =", "type": "assigned_variable", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:For_L42_C8", "vector": [14, 3, 0.561, 0.0122, 3, 0.75, 1.0, 485, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.surfaces[i].color.a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.surfaces[i].color.a = 256"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:If_L47_C8", "label": "if", "type": "if", "loc": [47, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L38_C4", "vector": [4, 2, 0.5793, 0.0244, 2, 0.48, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(self.surfaces) != 0:\n self.percept_pub.publish(self.surfaces[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Expr_L48_C12", "label": "publish()", "type": "expression", "loc": [48, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:If_L47_C8", "vector": [8, 3, 0.5854, 0.0122, 3, 0.52, 0.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.percept_pub.publish(self.surfaces[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L50_C8", "label": "resp = PerceiveButtonsResponse()", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L38_C4", "vector": [14, 2, 0.6098, 0.0122, 2, 0.48, 0.6667, 48, 3, 0, 0, 0, 110, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "PerceiveButtonsResponse", "annotation": ""}, "snippet": " resp = PerceiveButtonsResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L51_C8", "label": "resp.buttons =", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L38_C4", "vector": [14, 2, 0.622, 0.0122, 2, 0.48, 0.8333, 461, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "resp.buttons", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resp.buttons = self.surfaces"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Return_L52_C8", "label": "return", "type": "return", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L38_C4", "vector": [13, 2, 0.6341, 0.0122, 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 resp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "label": "do_action", "type": "function", "loc": [54, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:ClassDef_L21_C0", "vector": [2, 1, 0.7805, 0.2561, 1, 0.97, 1.0, 937, 0, 2, 1, 0, 0, 0, 14], "semantic": {"name": "do_action", "arg_names": ["self", "req"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def do_action(self, req):\n rospy.loginfo(\"[move_floor_button] MoveFloorButton clicked!\")\n # put 3d pt in base frame\n req.pixel3d.header.stamp = rospy.Time(0)\n move_pt = self.tl.transformPoint(\"/base_link\", req.pixel3d)\n\n floor_move_goal = MoveBaseGoal()\n floor_move_goal.target_pose.header.frame_id = move_pt.header.frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Expr_L55_C8", "label": "loginfo()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "vector": [8, 2, 0.6707, 0.0122, 2, 0.23, 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_floor_button] MoveFloorButton clicked!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L57_C8", "label": "req.pixel3d.header.stamp = Time()", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "vector": [14, 2, 0.6951, 0.0122, 2, 0.23, 0.0909, 473, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "req.pixel3d.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " req.pixel3d.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L58_C8", "label": "move_pt = transformPoint()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "vector": [14, 2, 0.7073, 0.0122, 2, 0.23, 0.1818, 823, 3, 2, 0, 0, 987, 10, 1], "semantic": {"name": "move_pt", "arg_names": [], "import_names": [], "rhs_call_name": "transformPoint", "annotation": ""}, "snippet": " move_pt = self.tl.transformPoint(\"/base_link\", req.pixel3d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L60_C8", "label": "floor_move_goal = MoveBaseGoal()", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "vector": [14, 2, 0.7317, 0.0122, 2, 0.23, 0.2727, 142, 3, 0, 0, 0, 968, 10, 1], "semantic": {"name": "floor_move_goal", "arg_names": [], "import_names": [], "rhs_call_name": "MoveBaseGoal", "annotation": ""}, "snippet": " floor_move_goal = MoveBaseGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L61_C8", "label": "floor_move_goal.target_pose.header.frame_id =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "vector": [14, 2, 0.7439, 0.0122, 2, 0.23, 0.3636, 64, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "floor_move_goal.target_pose.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " floor_move_goal.target_pose.header.frame_id = move_pt.header.frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L62_C8", "label": "floor_move_goal.target_pose.pose.position =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "vector": [14, 2, 0.7561, 0.0122, 2, 0.23, 0.4545, 554, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "floor_move_goal.target_pose.pose.position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " floor_move_goal.target_pose.pose.position = move_pt.point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L63_C8", "label": "quat = quaternion_from_euler()", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "vector": [14, 2, 0.7683, 0.0122, 2, 0.23, 0.5455, 367, 3, 3, 0, 0, 561, 10, 2], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_from_euler", "annotation": ""}, "snippet": " quat = tf_trans.quaternion_from_euler(0, 0, np.arctan2(move_pt.point.y, move_pt.point.x))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L64_C8", "label": "floor_move_goal.target_pose.pose.orientation = Quaternion()", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "vector": [14, 2, 0.7805, 0.0122, 2, 0.23, 0.6364, 825, 3, 4, 0, 0, 747, 10, 1], "semantic": {"name": "floor_move_goal.target_pose.pose.orientation", "arg_names": [], "import_names": [], "rhs_call_name": "Quaternion", "annotation": ""}, "snippet": " floor_move_goal.target_pose.pose.orientation = Quaternion(quat[0], quat[1], quat[2], quat[3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L65_C8", "label": "floor_move_goal.target_pose.header.frame_id =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "vector": [14, 2, 0.7927, 0.0122, 2, 0.23, 0.7273, 64, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "floor_move_goal.target_pose.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " floor_move_goal.target_pose.header.frame_id = \"/base_link\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L66_C8", "label": "floor_move_goal.target_pose.header.stamp = now()", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "vector": [14, 2, 0.8049, 0.0122, 2, 0.23, 0.8182, 811, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "floor_move_goal.target_pose.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " floor_move_goal.target_pose.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Try_L67_C8", "label": "try", "type": "try", "loc": [67, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "vector": [7, 2, 0.8537, 0.0854, 2, 0.23, 0.9091, 0, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self.goal_pub.publish(floor_move_goal.target_pose)\n self.floor_move_client.send_goal(floor_move_goal)\n self.floor_move_client.wait_for_result()\n cur_pose = self.floor_move_client.get_result()\n except rospy.ROSInterruptException:\n print(\"[move_floor_button] Move floor failed\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Expr_L68_C12", "label": "publish()", "type": "expression", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:Try_L67_C8", "vector": [8, 3, 0.8293, 0.0122, 3, 0.47, 0.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.goal_pub.publish(floor_move_goal.target_pose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Expr_L69_C12", "label": "send_goal()", "type": "expression", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:Try_L67_C8", "vector": [8, 3, 0.8415, 0.0122, 3, 0.47, 0.3333, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.floor_move_client.send_goal(floor_move_goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Expr_L70_C12", "label": "wait_for_result()", "type": "expression", "loc": [70, 70], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:Try_L67_C8", "vector": [8, 3, 0.8537, 0.0122, 3, 0.47, 0.6667, 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.floor_move_client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L71_C12", "label": "cur_pose = get_result()", "type": "assigned_variable", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:Try_L67_C8", "vector": [14, 3, 0.8659, 0.0122, 3, 0.47, 1.0, 780, 3, 0, 0, 0, 569, 10, 1], "semantic": {"name": "cur_pose", "arg_names": [], "import_names": [], "rhs_call_name": "get_result", "annotation": ""}, "snippet": " cur_pose = self.floor_move_client.get_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Expr_L73_C12", "label": "print()", "type": "expression", "loc": [73, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:Try_L67_C8", "vector": [8, 3, 0.8902, 0.0122, 3, 0.47, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"[move_floor_button] Move floor failed\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Return_L74_C8", "label": "return", "type": "return", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "vector": [13, 2, 0.9024, 0.0122, 2, 0.23, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ButtonActionResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L76_C0", "label": "main", "type": "function", "loc": [76, 79], "level": 0, "parent": null, "vector": [2, 0, 0.9451, 0.0488, 0, 0.66, 0.9412, 624, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n rospy.init_node('move_floor_button')\n tb = MoveFloorButton()\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Expr_L77_C4", "label": "init_node()", "type": "expression", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L76_C0", "vector": [8, 1, 0.939, 0.0122, 1, 0.92, 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('move_floor_button')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L78_C4", "label": "tb = MoveFloorButton()", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L76_C0", "vector": [14, 1, 0.9512, 0.0122, 1, 0.92, 0.5, 469, 3, 0, 0, 0, 429, 10, 1], "semantic": {"name": "tb", "arg_names": [], "import_names": [], "rhs_call_name": "MoveFloorButton", "annotation": ""}, "snippet": " tb = MoveFloorButton()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Expr_L79_C4", "label": "spin()", "type": "expression", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L76_C0", "vector": [8, 1, 0.9634, 0.0122, 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()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:If_L81_C0", "label": "if", "type": "if", "loc": [81, 82], "level": 0, "parent": null, "vector": [4, 0, 0.9939, 0.0244, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99349:Expr_L82_C4", "label": "main()", "type": "expression", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99349:If_L81_C0", "vector": [8, 1, 1.0, 0.0122, 1, 0.96, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99349:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:For_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:For_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:For_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:For_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:For_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:If_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:If_L47_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Expr_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Return_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Try_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:Try_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Expr_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:Try_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Expr_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:Try_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Expr_L70_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:Try_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:Try_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Expr_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Return_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Expr_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:FunctionDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Expr_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99349:If_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99349:Expr_L82_C4"}]
#! /usr/bin/python import numpy as np import roslib; roslib.load_manifest('hrl_clickable_behaviors') import rospy import std_srvs.srv import actionlib from tf.listener import TransformListener from hrl_clickable_world.srv import PerceiveButtons, ButtonAction, DisplayButtons from hrl_clickable_world.srv import PerceiveButtonsResponse, ButtonActionResponse from geometry_msgs.msg import Point from visualization_msgs.msg import Marker from pr2_grasp_behaviors.msg import OverheadGraspSetupAction, OverheadGraspSetupGoal from pr2_grasp_behaviors.msg import OverheadGraspAction, OverheadGraspGoal from hrl_table_detect.srv import ObjectButtonDetect, SegmentSurfaces class PlaceObject: def __init__(self): self.arm = rospy.get_param("arm", "r") self.tl = TransformListener() self.perception_srv = rospy.Service("/clickable_world/place_table_perceive", PerceiveButtons, self.do_perception) self.action_srv = rospy.Service("/clickable_world/place_object", ButtonAction, self.do_action) self.pc_capture_srv = rospy.ServiceProxy("/table_detection/surf_seg_capture_pc", std_srvs.srv.Empty) self.table_seg_srv = rospy.ServiceProxy("/table_detection/segment_surfaces", SegmentSurfaces) self.grasp_client = actionlib.SimpleActionClient(self.arm + '_overhead_grasp', OverheadGraspAction) self.grasp_client.wait_for_server() self.grasp_setup_client = actionlib.SimpleActionClient(self.arm + '_overhead_grasp_setup', OverheadGraspSetupAction) self.grasp_setup_client.wait_for_server() def do_perception(self, req): rospy.loginfo("[place_object] Perceiving table...") # capture a few clouds rate = rospy.Rate(5) for i in range(5): self.pc_capture_srv() rate.sleep() # segment surfaces self.surfaces = self.table_seg_srv().surfaces for i in range(len(self.surfaces)): self.surfaces[i].color.r = 256 self.surfaces[i].color.g = 0 self.surfaces[i].color.b = 256 self.surfaces[i].color.a = 256 resp = PerceiveButtonsResponse() resp.buttons = self.surfaces return resp def do_action(self, req): rospy.loginfo("[place_object] Table clicked, placing object...") # put 3d pt in grasping frame req.pixel3d.header.stamp = rospy.Time(0) place_pt = self.tl.transformPoint("/torso_lift_link", req.pixel3d) # move to place setup position setup_goal = OverheadGraspSetupGoal() setup_goal.disable_head = False setup_goal.open_gripper = False self.grasp_setup_client.send_goal(setup_goal) self.grasp_setup_client.wait_for_result() ############################################################ # Creating place goal grasp_goal = OverheadGraspGoal() grasp_goal.is_grasp = False grasp_goal.disable_head = False grasp_goal.disable_coll = False grasp_goal.grasp_type=OverheadGraspGoal.MANUAL_GRASP grasp_goal.x = place_pt.point.x grasp_goal.y = place_pt.point.y grasp_goal.behavior_name = "overhead_grasp" grasp_goal.sig_level = 0.999 ############################################################ # place object self.grasp_client.send_goal(grasp_goal) self.grasp_client.wait_for_result() result = self.grasp_client.get_result() rospy.loginfo("[place_object] Place result: %s" % result) obj_in_hand = result.grasp_result == "Object placed" # go back to grasp setup setup_goal.open_gripper = True self.grasp_setup_client.send_goal(setup_goal) self.grasp_setup_client.wait_for_result() return ButtonActionResponse() def main(): rospy.init_node('place_object') po = PlaceObject() rospy.spin() if __name__ == "__main__": main()
ajibawa-2023/Python-Code-Large/train/row_99350
74
106
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0283, 0.0094, 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_99350:Import_L5_C0", "label": "roslib import roslib", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0472, 0.0094, 0, 0.66, 0.0625, 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_clickable_behaviors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L5_C15", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0472, 0.0094, 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('hrl_clickable_behaviors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Import_L6_C0", "label": "rospy import rospy", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0566, 0.0094, 0, 0.66, 0.1875, 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_99350:Import_L7_C0", "label": "std_srvs.srv import std_srvs.srv", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.066, 0.0094, 0, 0.66, 0.25, 261, 0, 1, 0, 0, 261, 0, 0], "semantic": {"name": "std_srvs.srv", "arg_names": [], "import_names": ["std_srvs.srv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import std_srvs.srv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Import_L8_C0", "label": "actionlib import actionlib", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0755, 0.0094, 0, 0.66, 0.3125, 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_99350:ImportFrom_L9_C0", "label": "from tf.listener import TransformListener", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0849, 0.0094, 0, 0.66, 0.375, 577, 0, 1, 0, 0, 577, 0, 0], "semantic": {"name": "tf.listener", "arg_names": [], "import_names": ["TransformListener"], "rhs_call_name": "", "annotation": ""}, "snippet": "from tf.listener import TransformListener"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:ImportFrom_L11_C0", "label": "from hrl_clickable_world.srv import PerceiveButtons, ButtonAction, DisplayButtons", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1038, 0.0094, 0, 0.66, 0.4375, 612, 0, 3, 0, 0, 612, 0, 0], "semantic": {"name": "hrl_clickable_world.srv", "arg_names": [], "import_names": ["PerceiveButtons", "ButtonAction", "DisplayButtons"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_clickable_world.srv import PerceiveButtons, ButtonAction, DisplayButtons"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:ImportFrom_L12_C0", "label": "from hrl_clickable_world.srv import PerceiveButtonsResponse, ButtonActionResponse", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1132, 0.0094, 0, 0.66, 0.5, 612, 0, 2, 0, 0, 612, 0, 0], "semantic": {"name": "hrl_clickable_world.srv", "arg_names": [], "import_names": ["PerceiveButtonsResponse", "ButtonActionResponse"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_clickable_world.srv import PerceiveButtonsResponse, ButtonActionResponse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:ImportFrom_L13_C0", "label": "from geometry_msgs.msg import Point", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.1226, 0.0094, 0, 0.66, 0.5625, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Point"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:ImportFrom_L14_C0", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.1321, 0.0094, 0, 0.66, 0.625, 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_99350:ImportFrom_L16_C0", "label": "from pr2_grasp_behaviors.msg import OverheadGraspSetupAction, OverheadGraspSetupGoal", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1509, 0.0094, 0, 0.66, 0.6875, 212, 0, 2, 0, 0, 212, 0, 0], "semantic": {"name": "pr2_grasp_behaviors.msg", "arg_names": [], "import_names": ["OverheadGraspSetupAction", "OverheadGraspSetupGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_grasp_behaviors.msg import OverheadGraspSetupAction, OverheadGraspSetupGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:ImportFrom_L17_C0", "label": "from pr2_grasp_behaviors.msg import OverheadGraspAction, OverheadGraspGoal", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.1604, 0.0094, 0, 0.66, 0.75, 212, 0, 2, 0, 0, 212, 0, 0], "semantic": {"name": "pr2_grasp_behaviors.msg", "arg_names": [], "import_names": ["OverheadGraspAction", "OverheadGraspGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_grasp_behaviors.msg import OverheadGraspAction, OverheadGraspGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:ImportFrom_L18_C0", "label": "from hrl_table_detect.srv import ObjectButtonDetect, SegmentSurfaces", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1698, 0.0094, 0, 0.66, 0.8125, 778, 0, 2, 0, 0, 778, 0, 0], "semantic": {"name": "hrl_table_detect.srv", "arg_names": [], "import_names": ["ObjectButtonDetect", "SegmentSurfaces"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_table_detect.srv import ObjectButtonDetect, SegmentSurfaces"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:ClassDef_L20_C0", "label": "PlaceObject", "type": "class", "loc": [20, 98], "level": 0, "parent": null, "vector": [3, 0, 0.5566, 0.7453, 0, 0.66, 0.875, 83, 0, 3, 0, 0, 0, 0, 33], "semantic": {"name": "PlaceObject", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PlaceObject:\n def __init__(self):\n self.arm = rospy.get_param(\"arm\", \"r\")\n self.tl = TransformListener()\n self.perception_srv = rospy.Service(\"/clickable_world/place_table_perceive\",\n PerceiveButtons,\n self.do_perception)\n self.action_srv = rospy.Service(\"/clickable_world/place_object\","}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L21_C4", "label": "__init__", "type": "function", "loc": [21, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:ClassDef_L20_C0", "vector": [2, 1, 0.2783, 0.1698, 1, 0.75, 0.0, 555, 0, 1, 0, 0, 0, 0, 10], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.arm = rospy.get_param(\"arm\", \"r\")\n self.tl = TransformListener()\n self.perception_srv = rospy.Service(\"/clickable_world/place_table_perceive\",\n PerceiveButtons,\n self.do_perception)\n self.action_srv = rospy.Service(\"/clickable_world/place_object\",\n ButtonAction,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L22_C8", "label": "self.arm = get_param()", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L21_C4", "vector": [14, 2, 0.2075, 0.0094, 2, 0.45, 0.0, 720, 3, 2, 0, 0, 427, 10, 1], "semantic": {"name": "self.arm", "arg_names": [], "import_names": [], "rhs_call_name": "get_param", "annotation": ""}, "snippet": " self.arm = rospy.get_param(\"arm\", \"r\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L23_C8", "label": "self.tl = TransformListener()", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L21_C4", "vector": [14, 2, 0.217, 0.0094, 2, 0.45, 0.1111, 790, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.tl", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.tl = TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L24_C8", "label": "self.perception_srv = Service()", "type": "assigned_variable", "loc": [24, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L21_C4", "vector": [14, 2, 0.2358, 0.0283, 2, 0.45, 0.2222, 432, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self.perception_srv", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self.perception_srv = rospy.Service(\"/clickable_world/place_table_perceive\",\n PerceiveButtons,\n self.do_perception)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L27_C8", "label": "self.action_srv = Service()", "type": "assigned_variable", "loc": [27, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L21_C4", "vector": [14, 2, 0.2642, 0.0283, 2, 0.45, 0.3333, 932, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self.action_srv", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self.action_srv = rospy.Service(\"/clickable_world/place_object\",\n ButtonAction,\n self.do_action)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L31_C8", "label": "self.pc_capture_srv = ServiceProxy()", "type": "assigned_variable", "loc": [31, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L21_C4", "vector": [14, 2, 0.2972, 0.0189, 2, 0.45, 0.4444, 720, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.pc_capture_srv", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.pc_capture_srv = rospy.ServiceProxy(\"/table_detection/surf_seg_capture_pc\",\n std_srvs.srv.Empty)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L33_C8", "label": "self.table_seg_srv = ServiceProxy()", "type": "assigned_variable", "loc": [33, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L21_C4", "vector": [14, 2, 0.316, 0.0189, 2, 0.45, 0.5556, 738, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.table_seg_srv", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.table_seg_srv = rospy.ServiceProxy(\"/table_detection/segment_surfaces\",\n SegmentSurfaces)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L35_C8", "label": "self.grasp_client = SimpleActionClient()", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L21_C4", "vector": [14, 2, 0.3302, 0.0094, 2, 0.45, 0.6667, 186, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "self.grasp_client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.grasp_client = actionlib.SimpleActionClient(self.arm + '_overhead_grasp', OverheadGraspAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L36_C8", "label": "wait_for_server()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L21_C4", "vector": [8, 2, 0.3396, 0.0094, 2, 0.45, 0.7778, 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.grasp_client.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L37_C8", "label": "self.grasp_setup_client = SimpleActionClient()", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L21_C4", "vector": [14, 2, 0.3491, 0.0094, 2, 0.45, 0.8889, 872, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "self.grasp_setup_client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.grasp_setup_client = actionlib.SimpleActionClient(self.arm + '_overhead_grasp_setup', OverheadGraspSetupAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L38_C8", "label": "wait_for_server()", "type": "expression", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L21_C4", "vector": [8, 2, 0.3585, 0.0094, 2, 0.45, 1.0, 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.grasp_setup_client.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L40_C4", "label": "do_perception", "type": "function", "loc": [40, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:ClassDef_L20_C0", "vector": [2, 1, 0.4623, 0.1792, 1, 0.75, 0.5, 400, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "do_perception", "arg_names": ["self", "req"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def do_perception(self, req):\n rospy.loginfo(\"[place_object] Perceiving table...\")\n # capture a few clouds\n rate = rospy.Rate(5)\n for i in range(5):\n self.pc_capture_srv()\n rate.sleep()\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L41_C8", "label": "loginfo()", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L40_C4", "vector": [8, 2, 0.3868, 0.0094, 2, 0.15, 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(\"[place_object] Perceiving table...\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L43_C8", "label": "rate = Rate()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L40_C4", "vector": [14, 2, 0.4057, 0.0094, 2, 0.15, 0.1429, 477, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "rate", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " rate = rospy.Rate(5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:For_L44_C8", "label": "for i", "type": "for", "loc": [44, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L40_C4", "vector": [6, 2, 0.4245, 0.0283, 2, 0.15, 0.2857, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(5):\n self.pc_capture_srv()\n rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L45_C12", "label": "pc_capture_srv()", "type": "expression", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:For_L44_C8", "vector": [8, 3, 0.4245, 0.0094, 3, 0.71, 0.0, 265, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pc_capture_srv", "arg_names": [], "import_names": [], "rhs_call_name": "pc_capture_srv", "annotation": ""}, "snippet": " self.pc_capture_srv()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L46_C12", "label": "sleep()", "type": "expression", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:For_L44_C8", "vector": [8, 3, 0.434, 0.0094, 3, 0.71, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L49_C8", "label": "self.surfaces =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L40_C4", "vector": [14, 2, 0.4623, 0.0094, 2, 0.15, 0.4286, 962, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.surfaces", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.surfaces = self.table_seg_srv().surfaces"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:For_L50_C8", "label": "for i", "type": "for", "loc": [50, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L40_C4", "vector": [6, 2, 0.4906, 0.0472, 2, 0.15, 0.5714, 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(self.surfaces)):\n self.surfaces[i].color.r = 256\n self.surfaces[i].color.g = 0\n self.surfaces[i].color.b = 256\n self.surfaces[i].color.a = 256"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L51_C12", "label": "self.surfaces[i].color.r =", "type": "assigned_variable", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:For_L50_C8", "vector": [14, 3, 0.4811, 0.0094, 3, 0.45, 0.0, 96, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.surfaces[i].color.r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.surfaces[i].color.r = 256"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L52_C12", "label": "self.surfaces[i].color.g =", "type": "assigned_variable", "loc": [52, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:For_L50_C8", "vector": [14, 3, 0.4906, 0.0094, 3, 0.45, 0.3333, 215, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.surfaces[i].color.g", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.surfaces[i].color.g = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L53_C12", "label": "self.surfaces[i].color.b =", "type": "assigned_variable", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:For_L50_C8", "vector": [14, 3, 0.5, 0.0094, 3, 0.45, 0.6667, 763, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.surfaces[i].color.b", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.surfaces[i].color.b = 256"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L54_C12", "label": "self.surfaces[i].color.a =", "type": "assigned_variable", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:For_L50_C8", "vector": [14, 3, 0.5094, 0.0094, 3, 0.45, 1.0, 485, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.surfaces[i].color.a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.surfaces[i].color.a = 256"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L56_C8", "label": "resp = PerceiveButtonsResponse()", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L40_C4", "vector": [14, 2, 0.5283, 0.0094, 2, 0.15, 0.7143, 48, 3, 0, 0, 0, 110, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "PerceiveButtonsResponse", "annotation": ""}, "snippet": " resp = PerceiveButtonsResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L57_C8", "label": "resp.buttons =", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L40_C4", "vector": [14, 2, 0.5377, 0.0094, 2, 0.15, 0.8571, 461, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "resp.buttons", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resp.buttons = self.surfaces"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Return_L58_C8", "label": "return", "type": "return", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L40_C4", "vector": [13, 2, 0.5472, 0.0094, 2, 0.15, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return resp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "label": "do_action", "type": "function", "loc": [60, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:ClassDef_L20_C0", "vector": [2, 1, 0.7453, 0.3679, 1, 0.75, 1.0, 937, 0, 2, 1, 0, 0, 0, 14], "semantic": {"name": "do_action", "arg_names": ["self", "req"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def do_action(self, req):\n rospy.loginfo(\"[place_object] Table clicked, placing object...\")\n # put 3d pt in grasping frame\n req.pixel3d.header.stamp = rospy.Time(0)\n place_pt = self.tl.transformPoint(\"/torso_lift_link\", req.pixel3d)\n\n # move to place setup position\n setup_goal = OverheadGraspSetupGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L61_C8", "label": "loginfo()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [8, 2, 0.5755, 0.0094, 2, 0.35, 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(\"[place_object] Table clicked, placing object...\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L63_C8", "label": "req.pixel3d.header.stamp = Time()", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [14, 2, 0.5943, 0.0094, 2, 0.35, 0.04, 473, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "req.pixel3d.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " req.pixel3d.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L64_C8", "label": "place_pt = transformPoint()", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [14, 2, 0.6038, 0.0094, 2, 0.35, 0.08, 521, 3, 2, 0, 0, 987, 10, 1], "semantic": {"name": "place_pt", "arg_names": [], "import_names": [], "rhs_call_name": "transformPoint", "annotation": ""}, "snippet": " place_pt = self.tl.transformPoint(\"/torso_lift_link\", req.pixel3d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L67_C8", "label": "setup_goal = OverheadGraspSetupGoal()", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [14, 2, 0.6321, 0.0094, 2, 0.35, 0.12, 159, 3, 0, 0, 0, 532, 10, 1], "semantic": {"name": "setup_goal", "arg_names": [], "import_names": [], "rhs_call_name": "OverheadGraspSetupGoal", "annotation": ""}, "snippet": " setup_goal = OverheadGraspSetupGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L68_C8", "label": "setup_goal.disable_head =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [14, 2, 0.6415, 0.0094, 2, 0.35, 0.16, 470, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "setup_goal.disable_head", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " setup_goal.disable_head = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L69_C8", "label": "setup_goal.open_gripper =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [14, 2, 0.6509, 0.0094, 2, 0.35, 0.2, 891, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "setup_goal.open_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " setup_goal.open_gripper = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L70_C8", "label": "send_goal()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [8, 2, 0.6604, 0.0094, 2, 0.35, 0.24, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.grasp_setup_client.send_goal(setup_goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L71_C8", "label": "wait_for_result()", "type": "expression", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [8, 2, 0.6698, 0.0094, 2, 0.35, 0.28, 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.grasp_setup_client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L75_C8", "label": "grasp_goal = OverheadGraspGoal()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [14, 2, 0.7075, 0.0094, 2, 0.35, 0.32, 379, 3, 0, 0, 0, 708, 10, 1], "semantic": {"name": "grasp_goal", "arg_names": [], "import_names": [], "rhs_call_name": "OverheadGraspGoal", "annotation": ""}, "snippet": " grasp_goal = OverheadGraspGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L76_C8", "label": "grasp_goal.is_grasp =", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [14, 2, 0.717, 0.0094, 2, 0.35, 0.36, 664, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "grasp_goal.is_grasp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_goal.is_grasp = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L77_C8", "label": "grasp_goal.disable_head =", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [14, 2, 0.7264, 0.0094, 2, 0.35, 0.4, 201, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "grasp_goal.disable_head", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_goal.disable_head = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L78_C8", "label": "grasp_goal.disable_coll =", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [14, 2, 0.7358, 0.0094, 2, 0.35, 0.44, 986, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "grasp_goal.disable_coll", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_goal.disable_coll = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L79_C8", "label": "grasp_goal.grasp_type =", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [14, 2, 0.7453, 0.0094, 2, 0.35, 0.48, 872, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "grasp_goal.grasp_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_goal.grasp_type=OverheadGraspGoal.MANUAL_GRASP"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L80_C8", "label": "grasp_goal.x =", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [14, 2, 0.7547, 0.0094, 2, 0.35, 0.52, 218, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "grasp_goal.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_goal.x = place_pt.point.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L81_C8", "label": "grasp_goal.y =", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [14, 2, 0.7642, 0.0094, 2, 0.35, 0.56, 559, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "grasp_goal.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_goal.y = place_pt.point.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L82_C8", "label": "grasp_goal.behavior_name =", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [14, 2, 0.7736, 0.0094, 2, 0.35, 0.6, 681, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "grasp_goal.behavior_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_goal.behavior_name = \"overhead_grasp\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L83_C8", "label": "grasp_goal.sig_level =", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [14, 2, 0.783, 0.0094, 2, 0.35, 0.64, 16, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "grasp_goal.sig_level", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_goal.sig_level = 0.999"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L87_C8", "label": "send_goal()", "type": "expression", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [8, 2, 0.8208, 0.0094, 2, 0.35, 0.68, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.grasp_client.send_goal(grasp_goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L88_C8", "label": "wait_for_result()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [8, 2, 0.8302, 0.0094, 2, 0.35, 0.72, 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.grasp_client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L89_C8", "label": "result = get_result()", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [14, 2, 0.8396, 0.0094, 2, 0.35, 0.76, 51, 3, 0, 0, 0, 569, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "get_result", "annotation": ""}, "snippet": " result = self.grasp_client.get_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L90_C8", "label": "loginfo()", "type": "expression", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [8, 2, 0.8491, 0.0094, 2, 0.35, 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(\"[place_object] Place result: %s\" % result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L91_C8", "label": "obj_in_hand =", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [14, 2, 0.8585, 0.0094, 2, 0.35, 0.84, 843, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "obj_in_hand", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " obj_in_hand = result.grasp_result == \"Object placed\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L94_C8", "label": "setup_goal.open_gripper =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [14, 2, 0.8868, 0.0094, 2, 0.35, 0.88, 891, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "setup_goal.open_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " setup_goal.open_gripper = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L95_C8", "label": "send_goal()", "type": "expression", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [8, 2, 0.8962, 0.0094, 2, 0.35, 0.92, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.grasp_setup_client.send_goal(setup_goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L96_C8", "label": "wait_for_result()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [8, 2, 0.9057, 0.0094, 2, 0.35, 0.96, 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.grasp_setup_client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Return_L98_C8", "label": "return", "type": "return", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "vector": [13, 2, 0.9245, 0.0094, 2, 0.35, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ButtonActionResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L100_C0", "label": "main", "type": "function", "loc": [100, 103], "level": 0, "parent": null, "vector": [2, 0, 0.9575, 0.0377, 0, 0.66, 0.9375, 624, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n rospy.init_node('place_object')\n po = PlaceObject()\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L101_C4", "label": "init_node()", "type": "expression", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L100_C0", "vector": [8, 1, 0.9528, 0.0094, 1, 0.62, 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('place_object')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L102_C4", "label": "po = PlaceObject()", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L100_C0", "vector": [14, 1, 0.9623, 0.0094, 1, 0.62, 0.5, 350, 3, 0, 0, 0, 83, 10, 1], "semantic": {"name": "po", "arg_names": [], "import_names": [], "rhs_call_name": "PlaceObject", "annotation": ""}, "snippet": " po = PlaceObject()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L103_C4", "label": "spin()", "type": "expression", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L100_C0", "vector": [8, 1, 0.9717, 0.0094, 1, 0.62, 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_99350:If_L105_C0", "label": "if", "type": "if", "loc": [105, 106], "level": 0, "parent": null, "vector": [4, 0, 0.9953, 0.0189, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L106_C4", "label": "main()", "type": "expression", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99350:If_L105_C0", "vector": [8, 1, 1.0, 0.0094, 1, 0.91, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99350:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:For_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:For_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:For_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:For_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:For_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:For_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:For_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:For_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Return_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Return_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:FunctionDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99350:If_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99350:Expr_L106_C4"}]
#! /usr/bin/python import numpy as np import roslib; roslib.load_manifest('hrl_clickable_behaviors') import rospy import std_srvs.srv import actionlib from hrl_clickable_world.srv import PerceiveButtons, ButtonAction, DisplayButtons from hrl_clickable_world.srv import PerceiveButtonsResponse, ButtonActionResponse from geometry_msgs.msg import Point from visualization_msgs.msg import Marker from hrl_table_detect.srv import SegmentSurfaces, GetTableApproaches from hrl_table_detect.srv import GetTableApproachesRequest from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal from pr2_approach_table.srv import ApproachSrv class TableClickable: def __init__(self): self.perception_srv = rospy.Service("/clickable_world/table_perception", PerceiveButtons, self.do_perception) self.percept_pub = rospy.Publisher("/clickable_world/table_button_vis", Marker) self.action_srv = rospy.Service("/clickable_world/table_approach_action", ButtonAction, self.do_action) self.pc_capture_srv = rospy.ServiceProxy("/table_detection/surf_seg_capture_pc", std_srvs.srv.Empty) self.table_seg_srv = rospy.ServiceProxy("/table_detection/segment_surfaces", SegmentSurfaces) self.table_approach_detect_srv = rospy.ServiceProxy( "/table_detection/detect_table_approaches", GetTableApproaches) self.table_move_client = actionlib.SimpleActionClient("move_base", MoveBaseAction) self.approach_table_srv = rospy.ServiceProxy("/approach_table/move_forward_srv", ApproachSrv) def do_perception(self, req): # capture a few clouds rate = rospy.Rate(5) for i in range(5): self.pc_capture_srv() rate.sleep() # segment surfaces self.surfaces = self.table_seg_srv().surfaces for i in range(len(self.surfaces)): self.surfaces[i].color.r = 0 self.surfaces[i].color.g = 256 self.surfaces[i].color.b = 0 self.surfaces[i].color.a = 256 self.percept_pub.publish(self.surfaces[0]) resp = PerceiveButtonsResponse() resp.buttons = self.surfaces return resp def do_action(self, req): rospy.loginfo("Table clicked!") approach_req = GetTableApproachesRequest() approach_req.table = self.surfaces[0] approach_req.approach_pt = req.pixel3d approach_poses = self.table_approach_detect_srv(approach_req).approach_poses #return ButtonActionResponse() table_move_goal = MoveBaseGoal() for approach_pose in approach_poses.poses: table_move_goal.target_pose.pose = approach_pose table_move_goal.target_pose.header.frame_id = approach_poses.header.frame_id table_move_goal.target_pose.header.stamp = rospy.Time.now() try: self.table_move_client.send_goal(table_move_goal) self.table_move_client.wait_for_result() cur_pose = self.table_move_client.get_result() try: self.approach_table_srv() return ButtonActionResponse() except rospy.ROSInterruptException: print "Table approach failed" except rospy.ROSInterruptException: print "Table move failed" return ButtonActionResponse() def main(): rospy.init_node('table_clickable') tc = TableClickable() rospy.spin() if __name__ == "__main__": main()
ajibawa-2023/Python-Code-Large/train/row_99351
66
93
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0323, 0.0108, 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_99351:Import_L5_C0", "label": "roslib import roslib", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0538, 0.0108, 0, 0.66, 0.0625, 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_clickable_behaviors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L5_C15", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0538, 0.0108, 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('hrl_clickable_behaviors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Import_L6_C0", "label": "rospy import rospy", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0645, 0.0108, 0, 0.66, 0.1875, 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_99351:Import_L7_C0", "label": "std_srvs.srv import std_srvs.srv", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0753, 0.0108, 0, 0.66, 0.25, 261, 0, 1, 0, 0, 261, 0, 0], "semantic": {"name": "std_srvs.srv", "arg_names": [], "import_names": ["std_srvs.srv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import std_srvs.srv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Import_L8_C0", "label": "actionlib import actionlib", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.086, 0.0108, 0, 0.66, 0.3125, 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_99351:ImportFrom_L10_C0", "label": "from hrl_clickable_world.srv import PerceiveButtons, ButtonAction, DisplayButtons", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1075, 0.0108, 0, 0.66, 0.375, 612, 0, 3, 0, 0, 612, 0, 0], "semantic": {"name": "hrl_clickable_world.srv", "arg_names": [], "import_names": ["PerceiveButtons", "ButtonAction", "DisplayButtons"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_clickable_world.srv import PerceiveButtons, ButtonAction, DisplayButtons"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:ImportFrom_L11_C0", "label": "from hrl_clickable_world.srv import PerceiveButtonsResponse, ButtonActionResponse", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1183, 0.0108, 0, 0.66, 0.4375, 612, 0, 2, 0, 0, 612, 0, 0], "semantic": {"name": "hrl_clickable_world.srv", "arg_names": [], "import_names": ["PerceiveButtonsResponse", "ButtonActionResponse"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_clickable_world.srv import PerceiveButtonsResponse, ButtonActionResponse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:ImportFrom_L12_C0", "label": "from geometry_msgs.msg import Point", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.129, 0.0108, 0, 0.66, 0.5, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Point"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:ImportFrom_L13_C0", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.1398, 0.0108, 0, 0.66, 0.5625, 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_99351:ImportFrom_L15_C0", "label": "from hrl_table_detect.srv import SegmentSurfaces, GetTableApproaches", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1613, 0.0108, 0, 0.66, 0.625, 778, 0, 2, 0, 0, 778, 0, 0], "semantic": {"name": "hrl_table_detect.srv", "arg_names": [], "import_names": ["SegmentSurfaces", "GetTableApproaches"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_table_detect.srv import SegmentSurfaces, GetTableApproaches"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:ImportFrom_L16_C0", "label": "from hrl_table_detect.srv import GetTableApproachesRequest", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.172, 0.0108, 0, 0.66, 0.6875, 778, 0, 1, 0, 0, 778, 0, 0], "semantic": {"name": "hrl_table_detect.srv", "arg_names": [], "import_names": ["GetTableApproachesRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_table_detect.srv import GetTableApproachesRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:ImportFrom_L17_C0", "label": "from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.1828, 0.0108, 0, 0.66, 0.75, 440, 0, 2, 0, 0, 440, 0, 0], "semantic": {"name": "move_base_msgs.msg", "arg_names": [], "import_names": ["MoveBaseAction", "MoveBaseGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:ImportFrom_L18_C0", "label": "from pr2_approach_table.srv import ApproachSrv", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1935, 0.0108, 0, 0.66, 0.8125, 222, 0, 1, 0, 0, 222, 0, 0], "semantic": {"name": "pr2_approach_table.srv", "arg_names": [], "import_names": ["ApproachSrv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_approach_table.srv import ApproachSrv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:ClassDef_L20_C0", "label": "TableClickable", "type": "class", "loc": [20, 85], "level": 0, "parent": null, "vector": [3, 0, 0.5645, 0.7097, 0, 0.66, 0.875, 779, 0, 3, 0, 0, 0, 0, 30], "semantic": {"name": "TableClickable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TableClickable:\n def __init__(self):\n self.perception_srv = rospy.Service(\"/clickable_world/table_perception\",\n PerceiveButtons,\n self.do_perception)\n self.percept_pub = rospy.Publisher(\"/clickable_world/table_button_vis\",\n Marker)\n self.action_srv = rospy.Service(\"/clickable_world/table_approach_action\","}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L21_C4", "label": "__init__", "type": "function", "loc": [21, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:ClassDef_L20_C0", "vector": [2, 1, 0.3226, 0.2043, 1, 0.49, 0.0, 555, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.perception_srv = rospy.Service(\"/clickable_world/table_perception\",\n PerceiveButtons,\n self.do_perception)\n self.percept_pub = rospy.Publisher(\"/clickable_world/table_button_vis\",\n Marker)\n self.action_srv = rospy.Service(\"/clickable_world/table_approach_action\",\n ButtonAction,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L22_C8", "label": "self.perception_srv = Service()", "type": "assigned_variable", "loc": [22, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L21_C4", "vector": [14, 2, 0.2473, 0.0323, 2, 0.91, 0.0, 432, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self.perception_srv", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self.perception_srv = rospy.Service(\"/clickable_world/table_perception\",\n PerceiveButtons,\n self.do_perception)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L25_C8", "label": "self.percept_pub = Publisher()", "type": "assigned_variable", "loc": [25, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L21_C4", "vector": [14, 2, 0.2742, 0.0215, 2, 0.91, 0.1429, 902, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.percept_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.percept_pub = rospy.Publisher(\"/clickable_world/table_button_vis\",\n Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L27_C8", "label": "self.action_srv = Service()", "type": "assigned_variable", "loc": [27, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L21_C4", "vector": [14, 2, 0.3011, 0.0323, 2, 0.91, 0.2857, 932, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self.action_srv", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self.action_srv = rospy.Service(\"/clickable_world/table_approach_action\",\n ButtonAction,\n self.do_action)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L30_C8", "label": "self.pc_capture_srv = ServiceProxy()", "type": "assigned_variable", "loc": [30, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L21_C4", "vector": [14, 2, 0.328, 0.0215, 2, 0.91, 0.4286, 720, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.pc_capture_srv", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.pc_capture_srv = rospy.ServiceProxy(\"/table_detection/surf_seg_capture_pc\",\n std_srvs.srv.Empty)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L32_C8", "label": "self.table_seg_srv = ServiceProxy()", "type": "assigned_variable", "loc": [32, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L21_C4", "vector": [14, 2, 0.3495, 0.0215, 2, 0.91, 0.5714, 738, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.table_seg_srv", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.table_seg_srv = rospy.ServiceProxy(\"/table_detection/segment_surfaces\",\n SegmentSurfaces)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L34_C8", "label": "self.table_approach_detect_srv = ServiceProxy()", "type": "assigned_variable", "loc": [34, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L21_C4", "vector": [14, 2, 0.3763, 0.0323, 2, 0.91, 0.7143, 971, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.table_approach_detect_srv", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.table_approach_detect_srv = rospy.ServiceProxy(\n \"/table_detection/detect_table_approaches\",\n GetTableApproaches)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L37_C8", "label": "self.table_move_client = SimpleActionClient()", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L21_C4", "vector": [14, 2, 0.3978, 0.0108, 2, 0.91, 0.8571, 212, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "self.table_move_client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.table_move_client = actionlib.SimpleActionClient(\"move_base\", MoveBaseAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L38_C8", "label": "self.approach_table_srv = ServiceProxy()", "type": "assigned_variable", "loc": [38, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L21_C4", "vector": [14, 2, 0.414, 0.0215, 2, 0.91, 1.0, 409, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.approach_table_srv", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.approach_table_srv = rospy.ServiceProxy(\"/approach_table/move_forward_srv\",\n ApproachSrv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L41_C4", "label": "do_perception", "type": "function", "loc": [41, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:ClassDef_L20_C0", "vector": [2, 1, 0.5376, 0.2043, 1, 0.49, 0.5, 400, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "do_perception", "arg_names": ["self", "req"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def do_perception(self, req):\n # capture a few clouds\n rate = rospy.Rate(5)\n for i in range(5):\n self.pc_capture_srv()\n rate.sleep()\n \n # segment surfaces"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L43_C8", "label": "rate = Rate()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L41_C4", "vector": [14, 2, 0.4624, 0.0108, 2, 0.06, 0.0, 477, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "rate", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " rate = rospy.Rate(5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L44_C8", "label": "for i", "type": "for", "loc": [44, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L41_C4", "vector": [6, 2, 0.4839, 0.0323, 2, 0.06, 0.1429, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(5):\n self.pc_capture_srv()\n rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L45_C12", "label": "pc_capture_srv()", "type": "expression", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L44_C8", "vector": [8, 3, 0.4839, 0.0108, 3, 0.47, 0.0, 265, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pc_capture_srv", "arg_names": [], "import_names": [], "rhs_call_name": "pc_capture_srv", "annotation": ""}, "snippet": " self.pc_capture_srv()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L46_C12", "label": "sleep()", "type": "expression", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L44_C8", "vector": [8, 3, 0.4946, 0.0108, 3, 0.47, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L49_C8", "label": "self.surfaces =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L41_C4", "vector": [14, 2, 0.5269, 0.0108, 2, 0.06, 0.2857, 962, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.surfaces", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.surfaces = self.table_seg_srv().surfaces"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L50_C8", "label": "for i", "type": "for", "loc": [50, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L41_C4", "vector": [6, 2, 0.5591, 0.0538, 2, 0.06, 0.4286, 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(self.surfaces)):\n self.surfaces[i].color.r = 0\n self.surfaces[i].color.g = 256\n self.surfaces[i].color.b = 0\n self.surfaces[i].color.a = 256"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L51_C12", "label": "self.surfaces[i].color.r =", "type": "assigned_variable", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L50_C8", "vector": [14, 3, 0.5484, 0.0108, 3, 0.57, 0.0, 96, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.surfaces[i].color.r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.surfaces[i].color.r = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L52_C12", "label": "self.surfaces[i].color.g =", "type": "assigned_variable", "loc": [52, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L50_C8", "vector": [14, 3, 0.5591, 0.0108, 3, 0.57, 0.3333, 215, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.surfaces[i].color.g", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.surfaces[i].color.g = 256"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L53_C12", "label": "self.surfaces[i].color.b =", "type": "assigned_variable", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L50_C8", "vector": [14, 3, 0.5699, 0.0108, 3, 0.57, 0.6667, 763, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.surfaces[i].color.b", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.surfaces[i].color.b = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L54_C12", "label": "self.surfaces[i].color.a =", "type": "assigned_variable", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L50_C8", "vector": [14, 3, 0.5806, 0.0108, 3, 0.57, 1.0, 485, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.surfaces[i].color.a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.surfaces[i].color.a = 256"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L55_C8", "label": "publish()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L41_C4", "vector": [8, 2, 0.5914, 0.0108, 2, 0.06, 0.5714, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.percept_pub.publish(self.surfaces[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L57_C8", "label": "resp = PerceiveButtonsResponse()", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L41_C4", "vector": [14, 2, 0.6129, 0.0108, 2, 0.06, 0.7143, 48, 3, 0, 0, 0, 110, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "PerceiveButtonsResponse", "annotation": ""}, "snippet": " resp = PerceiveButtonsResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L58_C8", "label": "resp.buttons =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L41_C4", "vector": [14, 2, 0.6237, 0.0108, 2, 0.06, 0.8571, 461, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "resp.buttons", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resp.buttons = self.surfaces"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Return_L59_C8", "label": "return", "type": "return", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L41_C4", "vector": [13, 2, 0.6344, 0.0108, 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 resp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L61_C4", "label": "do_action", "type": "function", "loc": [61, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:ClassDef_L20_C0", "vector": [2, 1, 0.7849, 0.2688, 1, 0.49, 1.0, 937, 0, 2, 1, 0, 0, 0, 13], "semantic": {"name": "do_action", "arg_names": ["self", "req"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def do_action(self, req):\n rospy.loginfo(\"Table clicked!\")\n approach_req = GetTableApproachesRequest()\n approach_req.table = self.surfaces[0]\n approach_req.approach_pt = req.pixel3d\n approach_poses = self.table_approach_detect_srv(approach_req).approach_poses\n #return ButtonActionResponse()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L62_C8", "label": "loginfo()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L61_C4", "vector": [8, 2, 0.6667, 0.0108, 2, 0.05, 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(\"Table clicked!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L63_C8", "label": "approach_req = GetTableApproachesRequest()", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L61_C4", "vector": [14, 2, 0.6774, 0.0108, 2, 0.05, 0.1429, 197, 3, 0, 0, 0, 234, 10, 1], "semantic": {"name": "approach_req", "arg_names": [], "import_names": [], "rhs_call_name": "GetTableApproachesRequest", "annotation": ""}, "snippet": " approach_req = GetTableApproachesRequest()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L64_C8", "label": "approach_req.table =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L61_C4", "vector": [14, 2, 0.6882, 0.0108, 2, 0.05, 0.2857, 474, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "approach_req.table", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " approach_req.table = self.surfaces[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L65_C8", "label": "approach_req.approach_pt =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L61_C4", "vector": [14, 2, 0.6989, 0.0108, 2, 0.05, 0.4286, 894, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "approach_req.approach_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " approach_req.approach_pt = req.pixel3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L66_C8", "label": "approach_poses =", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L61_C4", "vector": [14, 2, 0.7097, 0.0108, 2, 0.05, 0.5714, 307, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "approach_poses", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " approach_poses = self.table_approach_detect_srv(approach_req).approach_poses"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L69_C8", "label": "table_move_goal = MoveBaseGoal()", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L61_C4", "vector": [14, 2, 0.7419, 0.0108, 2, 0.05, 0.7143, 469, 3, 0, 0, 0, 968, 10, 1], "semantic": {"name": "table_move_goal", "arg_names": [], "import_names": [], "rhs_call_name": "MoveBaseGoal", "annotation": ""}, "snippet": " table_move_goal = MoveBaseGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L70_C8", "label": "for approach_pose", "type": "for", "loc": [70, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L61_C4", "vector": [6, 2, 0.828, 0.1613, 2, 0.05, 0.8571, 940, 7, 0, 0, 0, 0, 0, 8], "semantic": {"name": "approach_pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for approach_pose in approach_poses.poses:\n table_move_goal.target_pose.pose = approach_pose\n table_move_goal.target_pose.header.frame_id = approach_poses.header.frame_id\n table_move_goal.target_pose.header.stamp = rospy.Time.now()\n try:\n self.table_move_client.send_goal(table_move_goal)\n self.table_move_client.wait_for_result()\n cur_pose = self.table_move_client.get_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L71_C12", "label": "table_move_goal.target_pose.pose =", "type": "assigned_variable", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L70_C8", "vector": [14, 3, 0.7634, 0.0108, 3, 0.42, 0.0, 205, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "table_move_goal.target_pose.pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " table_move_goal.target_pose.pose = approach_pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L72_C12", "label": "table_move_goal.target_pose.header.frame_id =", "type": "assigned_variable", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L70_C8", "vector": [14, 3, 0.7742, 0.0108, 3, 0.42, 0.3333, 42, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "table_move_goal.target_pose.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " table_move_goal.target_pose.header.frame_id = approach_poses.header.frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L73_C12", "label": "table_move_goal.target_pose.header.stamp = now()", "type": "assigned_variable", "loc": [73, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L70_C8", "vector": [14, 3, 0.7849, 0.0108, 3, 0.42, 0.6667, 248, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "table_move_goal.target_pose.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " table_move_goal.target_pose.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Try_L74_C12", "label": "try", "type": "try", "loc": [74, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L70_C8", "vector": [7, 3, 0.8495, 0.1183, 3, 0.42, 1.0, 0, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self.table_move_client.send_goal(table_move_goal)\n self.table_move_client.wait_for_result()\n cur_pose = self.table_move_client.get_result()\n try:\n self.approach_table_srv()\n return ButtonActionResponse()\n except rospy.ROSInterruptException:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L75_C16", "label": "send_goal()", "type": "expression", "loc": [75, 75], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:Try_L74_C12", "vector": [8, 4, 0.8065, 0.0108, 4, 0.88, 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.table_move_client.send_goal(table_move_goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L76_C16", "label": "wait_for_result()", "type": "expression", "loc": [76, 76], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:Try_L74_C12", "vector": [8, 4, 0.8172, 0.0108, 4, 0.88, 0.3333, 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.table_move_client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L77_C16", "label": "cur_pose = get_result()", "type": "assigned_variable", "loc": [77, 77], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:Try_L74_C12", "vector": [14, 4, 0.828, 0.0108, 4, 0.88, 0.6667, 780, 3, 0, 0, 0, 569, 10, 1], "semantic": {"name": "cur_pose", "arg_names": [], "import_names": [], "rhs_call_name": "get_result", "annotation": ""}, "snippet": " cur_pose = self.table_move_client.get_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Try_L78_C16", "label": "try", "type": "try", "loc": [78, 82], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:Try_L74_C12", "vector": [7, 4, 0.8602, 0.0538, 4, 0.88, 1.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self.approach_table_srv()\n return ButtonActionResponse()\n except rospy.ROSInterruptException:\n print(\"Table approach failed\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L79_C20", "label": "approach_table_srv()", "type": "expression", "loc": [79, 79], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:Try_L78_C16", "vector": [8, 5, 0.8495, 0.0108, 5, 0.07, 0.0, 928, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "approach_table_srv", "arg_names": [], "import_names": [], "rhs_call_name": "approach_table_srv", "annotation": ""}, "snippet": " self.approach_table_srv()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Return_L80_C20", "label": "return", "type": "return", "loc": [80, 80], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:Try_L78_C16", "vector": [13, 5, 0.8602, 0.0108, 5, 0.07, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ButtonActionResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L82_C20", "label": "print()", "type": "expression", "loc": [82, 82], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:Try_L78_C16", "vector": [8, 5, 0.8817, 0.0108, 5, 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(\"Table approach failed\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L84_C16", "label": "print()", "type": "expression", "loc": [84, 84], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:Try_L74_C12", "vector": [8, 4, 0.9032, 0.0108, 4, 0.88, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Table move failed\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Return_L85_C8", "label": "return", "type": "return", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L61_C4", "vector": [13, 2, 0.914, 0.0108, 2, 0.05, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ButtonActionResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L87_C0", "label": "main", "type": "function", "loc": [87, 90], "level": 0, "parent": null, "vector": [2, 0, 0.9516, 0.043, 0, 0.66, 0.9375, 624, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n rospy.init_node('table_clickable')\n tc = TableClickable()\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L88_C4", "label": "init_node()", "type": "expression", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L87_C0", "vector": [8, 1, 0.9462, 0.0108, 1, 0.26, 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('table_clickable')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L89_C4", "label": "tc = TableClickable()", "type": "assigned_variable", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L87_C0", "vector": [14, 1, 0.957, 0.0108, 1, 0.26, 0.5, 375, 3, 0, 0, 0, 779, 10, 1], "semantic": {"name": "tc", "arg_names": [], "import_names": [], "rhs_call_name": "TableClickable", "annotation": ""}, "snippet": " tc = TableClickable()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L90_C4", "label": "spin()", "type": "expression", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L87_C0", "vector": [8, 1, 0.9677, 0.0108, 1, 0.26, 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_99351:If_L92_C0", "label": "if", "type": "if", "loc": [92, 93], "level": 0, "parent": null, "vector": [4, 0, 0.9946, 0.0215, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L93_C4", "label": "main()", "type": "expression", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99351:If_L92_C0", "vector": [8, 1, 1.0, 0.0108, 1, 0.96, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99351:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Return_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:For_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Try_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:Try_L74_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L75_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:Try_L74_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L76_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:Try_L74_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L77_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:Try_L74_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Try_L78_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:Try_L78_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L79_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:Try_L78_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Return_L80_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:Try_L78_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L82_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:Try_L74_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L84_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Return_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L87_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L87_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Assign_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:FunctionDef_L87_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99351:If_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99351:Expr_L93_C4"}]
#! /usr/bin/python import numpy as np import roslib; roslib.load_manifest('hrl_clickable_behaviors') import rospy import std_srvs.srv import actionlib from tf.listener import TransformListener from hrl_clickable_world.srv import PerceiveButtons, ButtonAction, DisplayButtons from hrl_clickable_world.srv import PerceiveButtonsResponse, ButtonActionResponse from geometry_msgs.msg import Point from visualization_msgs.msg import Marker from pr2_grasp_behaviors.msg import OverheadGraspSetupAction, OverheadGraspSetupGoal from pr2_grasp_behaviors.msg import OverheadGraspAction, OverheadGraspGoal from hrl_table_detect.srv import ObjectButtonDetect class GraspObjButton: def __init__(self): self.arm = rospy.get_param("arm", "r") self.tl = TransformListener() self.perception_srv = rospy.Service("/clickable_world/detect_objects", PerceiveButtons, self.do_perception) self.action_srv = rospy.Service("/clickable_world/grasp_object", ButtonAction, self.do_action) self.obj_seg_srv = rospy.ServiceProxy("/object_button_detect", ObjectButtonDetect) self.grasp_client = actionlib.SimpleActionClient(self.arm + '_overhead_grasp', OverheadGraspAction) self.grasp_client.wait_for_server() self.grasp_setup_client = actionlib.SimpleActionClient(self.arm + '_overhead_grasp_setup', OverheadGraspSetupAction) self.grasp_setup_client.wait_for_server() def do_perception(self, req): rospy.loginfo("[grasp_obj_button] Perceiving object buttons...") # perceive object on table self.objects = self.obj_seg_srv().objects for i in range(len(self.objects)): self.objects[i].color.r = 256 self.objects[i].color.g = 0 self.objects[i].color.b = 0 self.objects[i].color.a = 256 # return object buttons resp = PerceiveButtonsResponse() resp.buttons = self.objects return resp def do_action(self, req): rospy.loginfo("[grasp_obj_button] Table clicked, grasping object...") # put 3d pt in grasping frame req.pixel3d.header.stamp = rospy.Time(0) grasp_pt = self.tl.transformPoint("/torso_lift_link", req.pixel3d) # move to grasp setup position setup_goal = OverheadGraspSetupGoal() setup_goal.disable_head = False setup_goal.open_gripper = True self.grasp_setup_client.send_goal(setup_goal) self.grasp_setup_client.wait_for_result() ############################################################ # Creating grasp goal grasp_goal = OverheadGraspGoal() grasp_goal.is_grasp = True grasp_goal.disable_head = False grasp_goal.disable_coll = False grasp_goal.grasp_type=OverheadGraspGoal.VISION_GRASP grasp_goal.x = grasp_pt.point.x grasp_goal.y = grasp_pt.point.y grasp_goal.behavior_name = "overhead_grasp" grasp_goal.sig_level = 0.999 ############################################################ # grasp object self.grasp_client.send_goal(grasp_goal) self.grasp_client.wait_for_result() result = self.grasp_client.get_result() rospy.loginfo("[grasp_obj_button] Grasp result: %s" % result) obj_in_hand = result.grasp_result == "Object grasped" # go back to grasp setup setup_goal.open_gripper = False self.grasp_setup_client.send_goal(setup_goal) self.grasp_setup_client.wait_for_result() return ButtonActionResponse() def main(): rospy.init_node('grasp_obj_button') gob = GraspObjButton() rospy.spin() if __name__ == "__main__": main()
ajibawa-2023/Python-Code-Large/train/row_99352
69
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_99352:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0303, 0.0101, 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_99352:Import_L5_C0", "label": "roslib import roslib", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0505, 0.0101, 0, 0.66, 0.0625, 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_clickable_behaviors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L5_C15", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0505, 0.0101, 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('hrl_clickable_behaviors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Import_L6_C0", "label": "rospy import rospy", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0606, 0.0101, 0, 0.66, 0.1875, 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_99352:Import_L7_C0", "label": "std_srvs.srv import std_srvs.srv", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0707, 0.0101, 0, 0.66, 0.25, 261, 0, 1, 0, 0, 261, 0, 0], "semantic": {"name": "std_srvs.srv", "arg_names": [], "import_names": ["std_srvs.srv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import std_srvs.srv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Import_L8_C0", "label": "actionlib import actionlib", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0808, 0.0101, 0, 0.66, 0.3125, 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_99352:ImportFrom_L9_C0", "label": "from tf.listener import TransformListener", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0101, 0, 0.66, 0.375, 577, 0, 1, 0, 0, 577, 0, 0], "semantic": {"name": "tf.listener", "arg_names": [], "import_names": ["TransformListener"], "rhs_call_name": "", "annotation": ""}, "snippet": "from tf.listener import TransformListener"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:ImportFrom_L11_C0", "label": "from hrl_clickable_world.srv import PerceiveButtons, ButtonAction, DisplayButtons", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.0101, 0, 0.66, 0.4375, 612, 0, 3, 0, 0, 612, 0, 0], "semantic": {"name": "hrl_clickable_world.srv", "arg_names": [], "import_names": ["PerceiveButtons", "ButtonAction", "DisplayButtons"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_clickable_world.srv import PerceiveButtons, ButtonAction, DisplayButtons"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:ImportFrom_L12_C0", "label": "from hrl_clickable_world.srv import PerceiveButtonsResponse, ButtonActionResponse", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1212, 0.0101, 0, 0.66, 0.5, 612, 0, 2, 0, 0, 612, 0, 0], "semantic": {"name": "hrl_clickable_world.srv", "arg_names": [], "import_names": ["PerceiveButtonsResponse", "ButtonActionResponse"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_clickable_world.srv import PerceiveButtonsResponse, ButtonActionResponse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:ImportFrom_L13_C0", "label": "from geometry_msgs.msg import Point", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.1313, 0.0101, 0, 0.66, 0.5625, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Point"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:ImportFrom_L14_C0", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.1414, 0.0101, 0, 0.66, 0.625, 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_99352:ImportFrom_L16_C0", "label": "from pr2_grasp_behaviors.msg import OverheadGraspSetupAction, OverheadGraspSetupGoal", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1616, 0.0101, 0, 0.66, 0.6875, 212, 0, 2, 0, 0, 212, 0, 0], "semantic": {"name": "pr2_grasp_behaviors.msg", "arg_names": [], "import_names": ["OverheadGraspSetupAction", "OverheadGraspSetupGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_grasp_behaviors.msg import OverheadGraspSetupAction, OverheadGraspSetupGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:ImportFrom_L17_C0", "label": "from pr2_grasp_behaviors.msg import OverheadGraspAction, OverheadGraspGoal", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.1717, 0.0101, 0, 0.66, 0.75, 212, 0, 2, 0, 0, 212, 0, 0], "semantic": {"name": "pr2_grasp_behaviors.msg", "arg_names": [], "import_names": ["OverheadGraspAction", "OverheadGraspGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_grasp_behaviors.msg import OverheadGraspAction, OverheadGraspGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:ImportFrom_L18_C0", "label": "from hrl_table_detect.srv import ObjectButtonDetect", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1818, 0.0101, 0, 0.66, 0.8125, 778, 0, 1, 0, 0, 778, 0, 0], "semantic": {"name": "hrl_table_detect.srv", "arg_names": [], "import_names": ["ObjectButtonDetect"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_table_detect.srv import ObjectButtonDetect"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:ClassDef_L20_C0", "label": "GraspObjButton", "type": "class", "loc": [20, 91], "level": 0, "parent": null, "vector": [3, 0, 0.5606, 0.7273, 0, 0.66, 0.875, 858, 0, 3, 0, 0, 0, 0, 28], "semantic": {"name": "GraspObjButton", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class GraspObjButton:\n def __init__(self):\n self.arm = rospy.get_param(\"arm\", \"r\")\n self.tl = TransformListener()\n self.perception_srv = rospy.Service(\"/clickable_world/detect_objects\",\n PerceiveButtons,\n self.do_perception)\n self.action_srv = rospy.Service(\"/clickable_world/grasp_object\","}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L21_C4", "label": "__init__", "type": "function", "loc": [21, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:ClassDef_L20_C0", "vector": [2, 1, 0.2879, 0.1616, 1, 0.14, 0.0, 555, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.arm = rospy.get_param(\"arm\", \"r\")\n self.tl = TransformListener()\n self.perception_srv = rospy.Service(\"/clickable_world/detect_objects\",\n PerceiveButtons,\n self.do_perception)\n self.action_srv = rospy.Service(\"/clickable_world/grasp_object\",\n ButtonAction,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L22_C8", "label": "self.arm = get_param()", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L21_C4", "vector": [14, 2, 0.2222, 0.0101, 2, 0.39, 0.0, 720, 3, 2, 0, 0, 427, 10, 1], "semantic": {"name": "self.arm", "arg_names": [], "import_names": [], "rhs_call_name": "get_param", "annotation": ""}, "snippet": " self.arm = rospy.get_param(\"arm\", \"r\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L23_C8", "label": "self.tl = TransformListener()", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L21_C4", "vector": [14, 2, 0.2323, 0.0101, 2, 0.39, 0.125, 790, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.tl", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.tl = TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L24_C8", "label": "self.perception_srv = Service()", "type": "assigned_variable", "loc": [24, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L21_C4", "vector": [14, 2, 0.2525, 0.0303, 2, 0.39, 0.25, 432, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self.perception_srv", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self.perception_srv = rospy.Service(\"/clickable_world/detect_objects\",\n PerceiveButtons,\n self.do_perception)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L27_C8", "label": "self.action_srv = Service()", "type": "assigned_variable", "loc": [27, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L21_C4", "vector": [14, 2, 0.2828, 0.0303, 2, 0.39, 0.375, 932, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self.action_srv", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self.action_srv = rospy.Service(\"/clickable_world/grasp_object\",\n ButtonAction,\n self.do_action)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L31_C8", "label": "self.obj_seg_srv = ServiceProxy()", "type": "assigned_variable", "loc": [31, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L21_C4", "vector": [14, 2, 0.3182, 0.0202, 2, 0.39, 0.5, 760, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.obj_seg_srv", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.obj_seg_srv = rospy.ServiceProxy(\"/object_button_detect\",\n ObjectButtonDetect)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L33_C8", "label": "self.grasp_client = SimpleActionClient()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L21_C4", "vector": [14, 2, 0.3333, 0.0101, 2, 0.39, 0.625, 186, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "self.grasp_client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.grasp_client = actionlib.SimpleActionClient(self.arm + '_overhead_grasp', OverheadGraspAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L34_C8", "label": "wait_for_server()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L21_C4", "vector": [8, 2, 0.3434, 0.0101, 2, 0.39, 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.grasp_client.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L35_C8", "label": "self.grasp_setup_client = SimpleActionClient()", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L21_C4", "vector": [14, 2, 0.3535, 0.0101, 2, 0.39, 0.875, 872, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "self.grasp_setup_client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.grasp_setup_client = actionlib.SimpleActionClient(self.arm + '_overhead_grasp_setup', OverheadGraspSetupAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L36_C8", "label": "wait_for_server()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L21_C4", "vector": [8, 2, 0.3636, 0.0101, 2, 0.39, 1.0, 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.grasp_setup_client.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L38_C4", "label": "do_perception", "type": "function", "loc": [38, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:ClassDef_L20_C0", "vector": [2, 1, 0.4495, 0.1414, 1, 0.14, 0.5, 400, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "do_perception", "arg_names": ["self", "req"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def do_perception(self, req):\n rospy.loginfo(\"[grasp_obj_button] Perceiving object buttons...\")\n # perceive object on table\n self.objects = self.obj_seg_srv().objects\n for i in range(len(self.objects)):\n self.objects[i].color.r = 256\n self.objects[i].color.g = 0\n self.objects[i].color.b = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L39_C8", "label": "loginfo()", "type": "expression", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L38_C4", "vector": [8, 2, 0.3939, 0.0101, 2, 0.67, 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(\"[grasp_obj_button] Perceiving object buttons...\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L41_C8", "label": "self.objects =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L38_C4", "vector": [14, 2, 0.4141, 0.0101, 2, 0.67, 0.2, 350, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.objects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.objects = self.obj_seg_srv().objects"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:For_L42_C8", "label": "for i", "type": "for", "loc": [42, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L38_C4", "vector": [6, 2, 0.4444, 0.0505, 2, 0.67, 0.4, 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(self.objects)):\n self.objects[i].color.r = 256\n self.objects[i].color.g = 0\n self.objects[i].color.b = 0\n self.objects[i].color.a = 256"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L43_C12", "label": "self.objects[i].color.r =", "type": "assigned_variable", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:For_L42_C8", "vector": [14, 3, 0.4343, 0.0101, 3, 0.42, 0.0, 558, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.objects[i].color.r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.objects[i].color.r = 256"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L44_C12", "label": "self.objects[i].color.g =", "type": "assigned_variable", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:For_L42_C8", "vector": [14, 3, 0.4444, 0.0101, 3, 0.42, 0.3333, 353, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.objects[i].color.g", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.objects[i].color.g = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L45_C12", "label": "self.objects[i].color.b =", "type": "assigned_variable", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:For_L42_C8", "vector": [14, 3, 0.4545, 0.0101, 3, 0.42, 0.6667, 995, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.objects[i].color.b", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.objects[i].color.b = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L46_C12", "label": "self.objects[i].color.a =", "type": "assigned_variable", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:For_L42_C8", "vector": [14, 3, 0.4646, 0.0101, 3, 0.42, 1.0, 164, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.objects[i].color.a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.objects[i].color.a = 256"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L49_C8", "label": "resp = PerceiveButtonsResponse()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L38_C4", "vector": [14, 2, 0.4949, 0.0101, 2, 0.67, 0.6, 48, 3, 0, 0, 0, 110, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "PerceiveButtonsResponse", "annotation": ""}, "snippet": " resp = PerceiveButtonsResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L50_C8", "label": "resp.buttons =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L38_C4", "vector": [14, 2, 0.5051, 0.0101, 2, 0.67, 0.8, 461, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "resp.buttons", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resp.buttons = self.objects"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Return_L51_C8", "label": "return", "type": "return", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L38_C4", "vector": [13, 2, 0.5152, 0.0101, 2, 0.67, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return resp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "label": "do_action", "type": "function", "loc": [53, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:ClassDef_L20_C0", "vector": [2, 1, 0.7273, 0.3939, 1, 0.14, 1.0, 937, 0, 2, 1, 0, 0, 0, 14], "semantic": {"name": "do_action", "arg_names": ["self", "req"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def do_action(self, req):\n rospy.loginfo(\"[grasp_obj_button] Table clicked, grasping object...\")\n # put 3d pt in grasping frame\n req.pixel3d.header.stamp = rospy.Time(0)\n grasp_pt = self.tl.transformPoint(\"/torso_lift_link\", req.pixel3d)\n\n # move to grasp setup position\n setup_goal = OverheadGraspSetupGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L54_C8", "label": "loginfo()", "type": "expression", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [8, 2, 0.5455, 0.0101, 2, 0.35, 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(\"[grasp_obj_button] Table clicked, grasping object...\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L56_C8", "label": "req.pixel3d.header.stamp = Time()", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [14, 2, 0.5657, 0.0101, 2, 0.35, 0.04, 473, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "req.pixel3d.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " req.pixel3d.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L57_C8", "label": "grasp_pt = transformPoint()", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [14, 2, 0.5758, 0.0101, 2, 0.35, 0.08, 226, 3, 2, 0, 0, 987, 10, 1], "semantic": {"name": "grasp_pt", "arg_names": [], "import_names": [], "rhs_call_name": "transformPoint", "annotation": ""}, "snippet": " grasp_pt = self.tl.transformPoint(\"/torso_lift_link\", req.pixel3d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L60_C8", "label": "setup_goal = OverheadGraspSetupGoal()", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [14, 2, 0.6061, 0.0101, 2, 0.35, 0.12, 159, 3, 0, 0, 0, 532, 10, 1], "semantic": {"name": "setup_goal", "arg_names": [], "import_names": [], "rhs_call_name": "OverheadGraspSetupGoal", "annotation": ""}, "snippet": " setup_goal = OverheadGraspSetupGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L61_C8", "label": "setup_goal.disable_head =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [14, 2, 0.6162, 0.0101, 2, 0.35, 0.16, 470, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "setup_goal.disable_head", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " setup_goal.disable_head = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L62_C8", "label": "setup_goal.open_gripper =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [14, 2, 0.6263, 0.0101, 2, 0.35, 0.2, 891, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "setup_goal.open_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " setup_goal.open_gripper = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L63_C8", "label": "send_goal()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [8, 2, 0.6364, 0.0101, 2, 0.35, 0.24, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.grasp_setup_client.send_goal(setup_goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L64_C8", "label": "wait_for_result()", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [8, 2, 0.6465, 0.0101, 2, 0.35, 0.28, 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.grasp_setup_client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L68_C8", "label": "grasp_goal = OverheadGraspGoal()", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [14, 2, 0.6869, 0.0101, 2, 0.35, 0.32, 379, 3, 0, 0, 0, 708, 10, 1], "semantic": {"name": "grasp_goal", "arg_names": [], "import_names": [], "rhs_call_name": "OverheadGraspGoal", "annotation": ""}, "snippet": " grasp_goal = OverheadGraspGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L69_C8", "label": "grasp_goal.is_grasp =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [14, 2, 0.697, 0.0101, 2, 0.35, 0.36, 664, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "grasp_goal.is_grasp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_goal.is_grasp = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L70_C8", "label": "grasp_goal.disable_head =", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [14, 2, 0.7071, 0.0101, 2, 0.35, 0.4, 201, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "grasp_goal.disable_head", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_goal.disable_head = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L71_C8", "label": "grasp_goal.disable_coll =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [14, 2, 0.7172, 0.0101, 2, 0.35, 0.44, 986, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "grasp_goal.disable_coll", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_goal.disable_coll = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L72_C8", "label": "grasp_goal.grasp_type =", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [14, 2, 0.7273, 0.0101, 2, 0.35, 0.48, 872, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "grasp_goal.grasp_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_goal.grasp_type=OverheadGraspGoal.VISION_GRASP"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L73_C8", "label": "grasp_goal.x =", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [14, 2, 0.7374, 0.0101, 2, 0.35, 0.52, 218, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "grasp_goal.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_goal.x = grasp_pt.point.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L74_C8", "label": "grasp_goal.y =", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [14, 2, 0.7475, 0.0101, 2, 0.35, 0.56, 559, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "grasp_goal.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_goal.y = grasp_pt.point.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L75_C8", "label": "grasp_goal.behavior_name =", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [14, 2, 0.7576, 0.0101, 2, 0.35, 0.6, 681, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "grasp_goal.behavior_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_goal.behavior_name = \"overhead_grasp\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L76_C8", "label": "grasp_goal.sig_level =", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [14, 2, 0.7677, 0.0101, 2, 0.35, 0.64, 16, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "grasp_goal.sig_level", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_goal.sig_level = 0.999"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L80_C8", "label": "send_goal()", "type": "expression", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [8, 2, 0.8081, 0.0101, 2, 0.35, 0.68, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.grasp_client.send_goal(grasp_goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L81_C8", "label": "wait_for_result()", "type": "expression", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [8, 2, 0.8182, 0.0101, 2, 0.35, 0.72, 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.grasp_client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L82_C8", "label": "result = get_result()", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [14, 2, 0.8283, 0.0101, 2, 0.35, 0.76, 51, 3, 0, 0, 0, 569, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "get_result", "annotation": ""}, "snippet": " result = self.grasp_client.get_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L83_C8", "label": "loginfo()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [8, 2, 0.8384, 0.0101, 2, 0.35, 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(\"[grasp_obj_button] Grasp result: %s\" % result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L84_C8", "label": "obj_in_hand =", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [14, 2, 0.8485, 0.0101, 2, 0.35, 0.84, 843, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "obj_in_hand", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " obj_in_hand = result.grasp_result == \"Object grasped\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L87_C8", "label": "setup_goal.open_gripper =", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [14, 2, 0.8788, 0.0101, 2, 0.35, 0.88, 891, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "setup_goal.open_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " setup_goal.open_gripper = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L88_C8", "label": "send_goal()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [8, 2, 0.8889, 0.0101, 2, 0.35, 0.92, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.grasp_setup_client.send_goal(setup_goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L89_C8", "label": "wait_for_result()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [8, 2, 0.899, 0.0101, 2, 0.35, 0.96, 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.grasp_setup_client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Return_L91_C8", "label": "return", "type": "return", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "vector": [13, 2, 0.9192, 0.0101, 2, 0.35, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ButtonActionResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L93_C0", "label": "main", "type": "function", "loc": [93, 96], "level": 0, "parent": null, "vector": [2, 0, 0.9545, 0.0404, 0, 0.66, 0.9375, 624, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n rospy.init_node('grasp_obj_button')\n gob = GraspObjButton()\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L94_C4", "label": "init_node()", "type": "expression", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L93_C0", "vector": [8, 1, 0.9495, 0.0101, 1, 0.66, 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('grasp_obj_button')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L95_C4", "label": "gob = GraspObjButton()", "type": "assigned_variable", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L93_C0", "vector": [14, 1, 0.9596, 0.0101, 1, 0.66, 0.5, 903, 3, 0, 0, 0, 858, 10, 1], "semantic": {"name": "gob", "arg_names": [], "import_names": [], "rhs_call_name": "GraspObjButton", "annotation": ""}, "snippet": " gob = GraspObjButton()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L96_C4", "label": "spin()", "type": "expression", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L93_C0", "vector": [8, 1, 0.9697, 0.0101, 1, 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()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352: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 main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L99_C4", "label": "main()", "type": "expression", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99352:If_L98_C0", "vector": [8, 1, 1.0, 0.0101, 1, 0.21, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99352:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:For_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:For_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:For_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:For_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:For_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Return_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Return_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Assign_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:FunctionDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99352:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99352:Expr_L99_C4"}]
#!/usr/bin/python import roslib roslib.load_manifest('rfid_people_following') import rospy from std_msgs.msg import Float64 import tf import time import numpy as np, math import functools class tf_updater(): def __init__(self, name, right_pan = '/robotis/servo_right_pan', right_tilt = '/robotis/servo_right_tilt', left_pan = '/robotis/servo_left_pan', left_tilt = '/robotis/servo_left_tilt'): try: rospy.init_node( name ) except: pass # Right pan rospy.Subscriber( right_pan, Float64, functools.partial( self.rpan_cb, bc = tf.TransformBroadcaster() )) # Right tilt rospy.Subscriber( right_tilt, Float64, functools.partial( self.rtilt_cb, bc = tf.TransformBroadcaster() )) # Left pan rospy.Subscriber( left_pan, Float64, functools.partial( self.lpan_cb, bc = tf.TransformBroadcaster() )) # Left tilt rospy.Subscriber( left_tilt, Float64, functools.partial( self.ltilt_cb, bc = tf.TransformBroadcaster() )) def rpan_cb( self, ang_msg, bc ): # bc is a specific TransformBroadcaster bc.sendTransform( (-0.0655, -0.0510, 0.0675), tf.transformations.quaternion_from_euler( 0.0, 0.0, ang_msg.data - math.radians( 60.0 ) ), rospy.Time.now(), 'ear_pan_right', 'plate_right_base' ) def rtilt_cb( self, ang_msg, bc ): # bc is a specific TransformBroadcaster bc.sendTransform( (0.0673, 0.0, 0.0), tf.transformations.quaternion_from_euler( 0.0, ang_msg.data, 0.0 ), rospy.Time.now(), 'ear_tilt_right', 'ear_pan_right' ) def lpan_cb( self, ang_msg, bc ): # bc is a specific TransformBroadcaster bc.sendTransform( (-0.0655, +0.0510, 0.0675), tf.transformations.quaternion_from_euler( 0.0, 0.0, ang_msg.data + math.radians( 60.0 ) ), rospy.Time.now(), 'ear_pan_left', 'plate_left_base' ) def ltilt_cb( self, ang_msg, bc ): # bc is a specific TransformBroadcaster bc.sendTransform( (0.0673, 0.0, 0.0), tf.transformations.quaternion_from_euler( 0.0, -1.0 * ang_msg.data, 0.0 ), rospy.Time.now(), 'ear_tilt_left', 'ear_pan_left' ) if __name__ == '__main__': tfs = tf_updater('servo_tf_updater') rospy.spin()
ajibawa-2023/Python-Code-Large/train/row_99353
27
82
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99353:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0366, 0.0122, 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_99353:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0488, 0.0122, 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": "roslib.load_manifest('rfid_people_following')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99353:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.061, 0.0122, 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_99353:ImportFrom_L7_C0", "label": "from std_msgs.msg import Float64", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0854, 0.0122, 0, 0.66, 0.3333, 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_99353:Import_L8_C0", "label": "tf import tf", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0976, 0.0122, 0, 0.66, 0.4444, 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_99353:Import_L10_C0", "label": "time import time", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.122, 0.0122, 0, 0.66, 0.5556, 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_99353:Import_L11_C0", "label": "numpy import np, math", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1341, 0.0122, 0, 0.66, 0.6667, 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_99353:Import_L12_C0", "label": "functools import functools", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1463, 0.0122, 0, 0.66, 0.7778, 711, 0, 1, 0, 0, 711, 0, 0], "semantic": {"name": "functools", "arg_names": [], "import_names": ["functools"], "rhs_call_name": "", "annotation": ""}, "snippet": "import functools"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99353:ClassDef_L14_C0", "label": "tf_updater", "type": "class", "loc": [14, 74], "level": 0, "parent": null, "vector": [3, 0, 0.5366, 0.7439, 0, 0.66, 0.8889, 21, 0, 5, 0, 0, 0, 0, 27], "semantic": {"name": "tf_updater", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class tf_updater():\n def __init__(self, name, \n right_pan = '/robotis/servo_right_pan',\n right_tilt = '/robotis/servo_right_tilt',\n left_pan = '/robotis/servo_left_pan',\n left_tilt = '/robotis/servo_left_tilt'):\n try:\n rospy.init_node( name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L15_C4", "label": "__init__", "type": "function", "loc": [15, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99353:ClassDef_L14_C0", "vector": [2, 1, 0.3293, 0.3049, 1, 0.69, 0.0, 555, 0, 6, 0, 0, 0, 0, 13], "semantic": {"name": "__init__", "arg_names": ["self", "name", "right_pan", "right_tilt", "left_pan", "left_tilt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, name, \n right_pan = '/robotis/servo_right_pan',\n right_tilt = '/robotis/servo_right_tilt',\n left_pan = '/robotis/servo_left_pan',\n left_tilt = '/robotis/servo_left_tilt'):\n try:\n rospy.init_node( name )\n except:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99353:Try_L20_C8", "label": "try", "type": "try", "loc": [20, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L15_C4", "vector": [7, 2, 0.2622, 0.0488, 2, 0.03, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node( name )\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99353:Expr_L21_C12", "label": "init_node()", "type": "expression", "loc": [21, 21], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99353:Try_L20_C8", "vector": [8, 3, 0.2561, 0.0122, 3, 0.76, 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( name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99353:Expr_L26_C8", "label": "Subscriber()", "type": "expression", "loc": [26, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L15_C4", "vector": [8, 2, 0.3232, 0.0244, 2, 0.03, 0.25, 455, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber( right_pan, Float64, \n functools.partial( self.rpan_cb, bc = tf.TransformBroadcaster() ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99353:Expr_L30_C8", "label": "Subscriber()", "type": "expression", "loc": [30, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L15_C4", "vector": [8, 2, 0.372, 0.0244, 2, 0.03, 0.5, 455, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber( right_tilt, Float64, \n functools.partial( self.rtilt_cb, bc = tf.TransformBroadcaster() ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99353:Expr_L34_C8", "label": "Subscriber()", "type": "expression", "loc": [34, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L15_C4", "vector": [8, 2, 0.4207, 0.0244, 2, 0.03, 0.75, 455, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber( left_pan, Float64, \n functools.partial( self.lpan_cb, bc = tf.TransformBroadcaster() ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99353:Expr_L38_C8", "label": "Subscriber()", "type": "expression", "loc": [38, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L15_C4", "vector": [8, 2, 0.4695, 0.0244, 2, 0.03, 1.0, 455, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber( left_tilt, Float64, \n functools.partial( self.ltilt_cb, bc = tf.TransformBroadcaster() ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L44_C4", "label": "rpan_cb", "type": "function", "loc": [44, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99353:ClassDef_L14_C0", "vector": [2, 1, 0.5732, 0.0854, 1, 0.69, 0.25, 133, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "rpan_cb", "arg_names": ["self", "ang_msg", "bc"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def rpan_cb( self, ang_msg, bc ):\n # bc is a specific TransformBroadcaster\n bc.sendTransform( (-0.0655, -0.0510, 0.0675),\n tf.transformations.quaternion_from_euler( 0.0, 0.0, ang_msg.data - math.radians( 60.0 ) ),\n rospy.Time.now(),\n 'ear_pan_right',\n 'plate_right_base' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99353:Expr_L46_C8", "label": "sendTransform()", "type": "expression", "loc": [46, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L44_C4", "vector": [8, 2, 0.5854, 0.061, 2, 0.12, 0.0, 373, 3, 5, 0, 0, 0, 0, 4], "semantic": {"name": "sendTransform", "arg_names": [], "import_names": [], "rhs_call_name": "sendTransform", "annotation": ""}, "snippet": " bc.sendTransform( (-0.0655, -0.0510, 0.0675),\n tf.transformations.quaternion_from_euler( 0.0, 0.0, ang_msg.data - math.radians( 60.0 ) ),\n rospy.Time.now(),\n 'ear_pan_right',\n 'plate_right_base' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L52_C4", "label": "rtilt_cb", "type": "function", "loc": [52, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99353:ClassDef_L14_C0", "vector": [2, 1, 0.6707, 0.0854, 1, 0.69, 0.5, 638, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "rtilt_cb", "arg_names": ["self", "ang_msg", "bc"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def rtilt_cb( self, ang_msg, bc ):\n # bc is a specific TransformBroadcaster\n bc.sendTransform( (0.0673, 0.0, 0.0),\n tf.transformations.quaternion_from_euler( 0.0, ang_msg.data, 0.0 ),\n rospy.Time.now(),\n 'ear_tilt_right',\n 'ear_pan_right' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99353:Expr_L54_C8", "label": "sendTransform()", "type": "expression", "loc": [54, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L52_C4", "vector": [8, 2, 0.6829, 0.061, 2, 0.02, 0.0, 373, 3, 5, 0, 0, 0, 0, 3], "semantic": {"name": "sendTransform", "arg_names": [], "import_names": [], "rhs_call_name": "sendTransform", "annotation": ""}, "snippet": " bc.sendTransform( (0.0673, 0.0, 0.0),\n tf.transformations.quaternion_from_euler( 0.0, ang_msg.data, 0.0 ),\n rospy.Time.now(),\n 'ear_tilt_right',\n 'ear_pan_right' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L60_C4", "label": "lpan_cb", "type": "function", "loc": [60, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99353:ClassDef_L14_C0", "vector": [2, 1, 0.7683, 0.0854, 1, 0.69, 0.75, 833, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "lpan_cb", "arg_names": ["self", "ang_msg", "bc"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def lpan_cb( self, ang_msg, bc ):\n # bc is a specific TransformBroadcaster\n bc.sendTransform( (-0.0655, +0.0510, 0.0675),\n tf.transformations.quaternion_from_euler( 0.0, 0.0, ang_msg.data + math.radians( 60.0 ) ),\n rospy.Time.now(),\n 'ear_pan_left',\n 'plate_left_base' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99353:Expr_L62_C8", "label": "sendTransform()", "type": "expression", "loc": [62, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L60_C4", "vector": [8, 2, 0.7805, 0.061, 2, 0.81, 0.0, 373, 3, 5, 0, 0, 0, 0, 4], "semantic": {"name": "sendTransform", "arg_names": [], "import_names": [], "rhs_call_name": "sendTransform", "annotation": ""}, "snippet": " bc.sendTransform( (-0.0655, +0.0510, 0.0675),\n tf.transformations.quaternion_from_euler( 0.0, 0.0, ang_msg.data + math.radians( 60.0 ) ),\n rospy.Time.now(),\n 'ear_pan_left',\n 'plate_left_base' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L68_C4", "label": "ltilt_cb", "type": "function", "loc": [68, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99353:ClassDef_L14_C0", "vector": [2, 1, 0.8659, 0.0854, 1, 0.69, 1.0, 287, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "ltilt_cb", "arg_names": ["self", "ang_msg", "bc"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def ltilt_cb( self, ang_msg, bc ):\n # bc is a specific TransformBroadcaster\n bc.sendTransform( (0.0673, 0.0, 0.0),\n tf.transformations.quaternion_from_euler( 0.0, -1.0 * ang_msg.data, 0.0 ),\n rospy.Time.now(),\n 'ear_tilt_left',\n 'ear_pan_left' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99353:Expr_L70_C8", "label": "sendTransform()", "type": "expression", "loc": [70, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L68_C4", "vector": [8, 2, 0.878, 0.061, 2, 0.42, 0.0, 373, 3, 5, 0, 0, 0, 0, 3], "semantic": {"name": "sendTransform", "arg_names": [], "import_names": [], "rhs_call_name": "sendTransform", "annotation": ""}, "snippet": " bc.sendTransform( (0.0673, 0.0, 0.0),\n tf.transformations.quaternion_from_euler( 0.0, -1.0 * ang_msg.data, 0.0 ),\n rospy.Time.now(),\n 'ear_tilt_left',\n 'ear_pan_left' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99353:If_L80_C0", "label": "if", "type": "if", "loc": [80, 82], "level": 0, "parent": null, "vector": [4, 0, 0.9878, 0.0366, 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 tfs = tf_updater('servo_tf_updater')\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99353:Assign_L81_C4", "label": "tfs = tf_updater()", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99353:If_L80_C0", "vector": [14, 1, 0.9878, 0.0122, 1, 0.83, 0.0, 586, 3, 1, 0, 0, 21, 10, 1], "semantic": {"name": "tfs", "arg_names": [], "import_names": [], "rhs_call_name": "tf_updater", "annotation": ""}, "snippet": " tfs = tf_updater('servo_tf_updater')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99353:Expr_L82_C4", "label": "spin()", "type": "expression", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99353:If_L80_C0", "vector": [8, 1, 1.0, 0.0122, 1, 0.83, 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_99353:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99353:Try_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99353:Try_L20_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99353:Expr_L21_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99353:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99353:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99353:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99353:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99353:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99353:Expr_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99353:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99353:Expr_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99353:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99353:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99353:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99353:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99353:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99353:If_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99353:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99353:If_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99353:Expr_L82_C4"}]
#!/usr/bin/python import roslib roslib.load_manifest( 'rfid_people_following' ) import rospy from scipy.spatial import KDTree import numpy as np, math import pickle as pkl import markers import point_cloud_utils as pcu import time rospy.init_node( 'traj_pub' ) print 'Loading data' f = open( 'trajectory_caps/resutls.pkl' , 'r' ) dset = pkl.load( f ) f.close() captures = dset['captures'] def Linf_norm( arr ): # arr is (2,) rv = np.max( np.abs( arr - np.array([7.0, 3.0]) )) #print 'arr: ', arr, ' rv: ', rv return rv def filt( dist_min, dist_max ): # pts = 2xN array pts = np.array([]).reshape([4,0]) for i in range(len(captures)): lp = load_points( captures[i][3] ) if Linf_norm( lp[0:2,0] ) >= dist_min and Linf_norm( lp[0:2,0] ) <= dist_max: pts = np.column_stack([ pts, lp ]) fpts_3d = np.row_stack([ pts[0], pts[1], np.zeros(pts.shape[1]) ]) print fpts_3d.shape return np.matrix( fpts_3d ) def load_points( fname ): print 'Loading %s' % fname f = open( fname, 'r' ) d = pkl.load( f ) f.close() return np.array(d).T # 4xN # kd = KDTree( np.array([ [x,y] for x,y,ang,fname in captures ])) #ind = kd.query_ball_point( np.array([ 3.0, 3.0 ]), r=0.5 ) #pts = np.column_stack([ load_points( captures[i][3] ) for i in ind ]) # pts = np.column_stack([ load_points( captures[i][3] ) for i in range(len(captures)) ]) if __name__ == '__main__': import optparse p = optparse.OptionParser() p.add_option('-x', action='store', type='float', dest='dist_max', default='20.0', help='max distance') p.add_option('-n', action='store', type='float', dest='dist_min', default='0.0', help='min distance') opt, args = p.parse_args() pub = rospy.Publisher( 'traj_pub_pts', pcu.PointCloud ) # ros_pts = pcu.np_points_to_ros( np.matrix(fpts_3d) ) ros_pts = pcu.np_points_to_ros( filt( opt.dist_min, opt.dist_max )) ros_pts.header.frame_id = '/odom_combined' rate = rospy.Rate( 2 ) print 'Publishing PointCloud' while not rospy.is_shutdown(): ros_pts.header.stamp = rospy.Time.now() pub.publish( ros_pts ) rate.sleep() # arr = np.array( res ).T # kd = KDTree( arr[0:2].T ) # xy-only. # X,Y = np.meshgrid( range(0,11), range(0,7) ) # #xy = np.row_stack([ X.flatten(), Y.flatten() ]) # Z = np.zeros( X.shape ) # for i in xrange( X.shape[0] ): # for j in xrange( X.shape[1] ): # ind = kd.query_ball_point( np.array([ X[i,j], Y[i,j] ]), r=0.5 ) # if ind: # Z[i,j] = np.mean( arr[3,ind] ) # else: # #print i,j # Z[i,j] = np.nan
ajibawa-2023/Python-Code-Large/train/row_99354
48
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_99354:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0312, 0.0104, 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_99354:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0417, 0.0104, 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( 'rfid_people_following' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0521, 0.0104, 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_99354:ImportFrom_L7_C0", "label": "from scipy.spatial import KDTree", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0729, 0.0104, 0, 0.66, 0.1667, 384, 0, 1, 0, 0, 384, 0, 0], "semantic": {"name": "scipy.spatial", "arg_names": [], "import_names": ["KDTree"], "rhs_call_name": "", "annotation": ""}, "snippet": "from scipy.spatial import KDTree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Import_L8_C0", "label": "numpy import np, math", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0104, 0, 0.66, 0.2222, 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_99354:Import_L9_C0", "label": "pickle import pkl", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0938, 0.0104, 0, 0.66, 0.2778, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "pickle", "arg_names": [], "import_names": ["pkl"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pickle as pkl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Import_L10_C0", "label": "markers import markers", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1042, 0.0104, 0, 0.66, 0.3333, 586, 0, 1, 0, 0, 586, 0, 0], "semantic": {"name": "markers", "arg_names": [], "import_names": ["markers"], "rhs_call_name": "", "annotation": ""}, "snippet": "import markers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Import_L11_C0", "label": "point_cloud_utils import pcu", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1146, 0.0104, 0, 0.66, 0.3889, 539, 0, 1, 0, 0, 539, 0, 0], "semantic": {"name": "point_cloud_utils", "arg_names": [], "import_names": ["pcu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import point_cloud_utils as pcu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Import_L12_C0", "label": "time import time", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.0104, 0, 0.66, 0.4444, 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_99354:Expr_L14_C0", "label": "init_node()", "type": "expression", "loc": [14, 14], "level": 0, "parent": null, "vector": [8, 0, 0.1458, 0.0104, 0, 0.66, 0.5, 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_pub' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Expr_L16_C0", "label": "print()", "type": "expression", "loc": [16, 16], "level": 0, "parent": null, "vector": [8, 0, 0.1667, 0.0104, 0, 0.66, 0.5556, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('Loading data')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L18_C0", "label": "f = open()", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.1875, 0.0104, 0, 0.66, 0.6111, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "f = open( 'trajectory_caps/resutls.pkl' , 'r' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L19_C0", "label": "dset = load()", "type": "assigned_variable", "loc": [19, 19], "level": 0, "parent": null, "vector": [14, 0, 0.1979, 0.0104, 0, 0.66, 0.6667, 284, 3, 1, 0, 0, 37, 10, 1], "semantic": {"name": "dset", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "dset = pkl.load( f )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Expr_L20_C0", "label": "close()", "type": "expression", "loc": [20, 20], "level": 0, "parent": null, "vector": [8, 0, 0.2083, 0.0104, 0, 0.66, 0.7222, 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_99354:Assign_L22_C0", "label": "captures =", "type": "assigned_variable", "loc": [22, 22], "level": 0, "parent": null, "vector": [14, 0, 0.2292, 0.0104, 0, 0.66, 0.7778, 890, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "captures", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "captures = dset['captures']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L24_C0", "label": "Linf_norm", "type": "function", "loc": [24, 28], "level": 0, "parent": null, "vector": [2, 0, 0.2708, 0.0521, 0, 0.66, 0.8333, 529, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "Linf_norm", "arg_names": ["arr"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def Linf_norm( arr ):\n # arr is (2,)\n rv = np.max( np.abs( arr - np.array([7.0, 3.0]) ))\n #print 'arr: ', arr, ' rv: ', rv\n return rv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L26_C4", "label": "rv = max()", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L24_C0", "vector": [14, 1, 0.2708, 0.0104, 1, 0.89, 0.0, 222, 3, 1, 0, 0, 442, 10, 3], "semantic": {"name": "rv", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " rv = np.max( np.abs( arr - np.array([7.0, 3.0]) ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Return_L28_C4", "label": "return", "type": "return", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L24_C0", "vector": [13, 1, 0.2917, 0.0104, 1, 0.89, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L30_C0", "label": "filt", "type": "function", "loc": [30, 39], "level": 0, "parent": null, "vector": [2, 0, 0.3594, 0.1042, 0, 0.66, 0.8889, 519, 0, 2, 1, 0, 0, 0, 12], "semantic": {"name": "filt", "arg_names": ["dist_min", "dist_max"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def filt( dist_min, dist_max ):\n # pts = 2xN array\n pts = np.array([]).reshape([4,0])\n for i in range(len(captures)):\n lp = load_points( captures[i][3] )\n if Linf_norm( lp[0:2,0] ) >= dist_min and Linf_norm( lp[0:2,0] ) <= dist_max:\n pts = np.column_stack([ pts, lp ])\n fpts_3d = np.row_stack([ pts[0], pts[1], np.zeros(pts.shape[1]) ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L32_C4", "label": "pts = reshape()", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L30_C0", "vector": [14, 1, 0.3333, 0.0104, 1, 0.11, 0.0, 195, 3, 1, 0, 0, 276, 10, 2], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "reshape", "annotation": ""}, "snippet": " pts = np.array([]).reshape([4,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:For_L33_C4", "label": "for i", "type": "for", "loc": [33, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L30_C0", "vector": [6, 1, 0.3594, 0.0417, 1, 0.11, 0.25, 826, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(len(captures)):\n lp = load_points( captures[i][3] )\n if Linf_norm( lp[0:2,0] ) >= dist_min and Linf_norm( lp[0:2,0] ) <= dist_max:\n pts = np.column_stack([ pts, lp ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L34_C8", "label": "lp = load_points()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:For_L33_C4", "vector": [14, 2, 0.3542, 0.0104, 2, 0.02, 0.0, 721, 3, 1, 0, 0, 580, 10, 1], "semantic": {"name": "lp", "arg_names": [], "import_names": [], "rhs_call_name": "load_points", "annotation": ""}, "snippet": " lp = load_points( captures[i][3] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L35_C8", "label": "if", "type": "if", "loc": [35, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:For_L33_C4", "vector": [4, 2, 0.3698, 0.0208, 2, 0.02, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if Linf_norm( lp[0:2,0] ) >= dist_min and Linf_norm( lp[0:2,0] ) <= dist_max:\n pts = np.column_stack([ pts, lp ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L36_C12", "label": "pts = column_stack()", "type": "assigned_variable", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L35_C8", "vector": [14, 3, 0.375, 0.0104, 3, 0.82, 0.0, 195, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " pts = np.column_stack([ pts, lp ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L37_C4", "label": "fpts_3d = row_stack()", "type": "assigned_variable", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L30_C0", "vector": [14, 1, 0.3854, 0.0104, 1, 0.11, 0.5, 541, 3, 1, 0, 0, 612, 10, 2], "semantic": {"name": "fpts_3d", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " fpts_3d = np.row_stack([ pts[0], pts[1], np.zeros(pts.shape[1]) ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Expr_L38_C4", "label": "print()", "type": "expression", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L30_C0", "vector": [8, 1, 0.3958, 0.0104, 1, 0.11, 0.75, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(fpts_3d.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Return_L39_C4", "label": "return", "type": "return", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L30_C0", "vector": [13, 1, 0.4062, 0.0104, 1, 0.11, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix( fpts_3d )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L42_C0", "label": "load_points", "type": "function", "loc": [42, 47], "level": 0, "parent": null, "vector": [2, 0, 0.4635, 0.0625, 0, 0.66, 0.9444, 580, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "load_points", "arg_names": ["fname"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def load_points( fname ):\n print('Loading %s' % fname)\n f = open( fname, 'r' )\n d = pkl.load( f )\n f.close()\n return np.array(d).T # 4xN"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Expr_L43_C4", "label": "print()", "type": "expression", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L42_C0", "vector": [8, 1, 0.4479, 0.0104, 1, 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('Loading %s' % fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L44_C4", "label": "f = open()", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L42_C0", "vector": [14, 1, 0.4583, 0.0104, 1, 0.85, 0.25, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " f = open( fname, 'r' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L45_C4", "label": "d = load()", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L42_C0", "vector": [14, 1, 0.4688, 0.0104, 1, 0.85, 0.5, 355, 3, 1, 0, 0, 37, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": " d = pkl.load( f )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Expr_L46_C4", "label": "close()", "type": "expression", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L42_C0", "vector": [8, 1, 0.4792, 0.0104, 1, 0.85, 0.75, 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_99354:Return_L47_C4", "label": "return", "type": "return", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L42_C0", "vector": [13, 1, 0.4896, 0.0104, 1, 0.85, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.array(d).T # 4xN"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L57_C0", "label": "if", "type": "if", "loc": [57, 75], "level": 0, "parent": null, "vector": [4, 0, 0.6875, 0.1979, 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 import optparse\n p = optparse.OptionParser()\n p.add_option('-x', action='store', type='float', dest='dist_max', default='20.0', help='max distance')\n p.add_option('-n', action='store', type='float', dest='dist_min', default='0.0', help='min distance')\n opt, args = p.parse_args()\n \n pub = rospy.Publisher( 'traj_pub_pts', pcu.PointCloud )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Import_L58_C4", "label": "optparse import optparse", "type": "import", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L57_C0", "vector": [1, 1, 0.6042, 0.0104, 1, 0.94, 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_99354:Assign_L59_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L57_C0", "vector": [14, 1, 0.6146, 0.0104, 1, 0.94, 0.1, 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_99354:Expr_L60_C4", "label": "add_option()", "type": "expression", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L57_C0", "vector": [8, 1, 0.625, 0.0104, 1, 0.94, 0.2, 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('-x', action='store', type='float', dest='dist_max', default='20.0', help='max distance')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Expr_L61_C4", "label": "add_option()", "type": "expression", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L57_C0", "vector": [8, 1, 0.6354, 0.0104, 1, 0.94, 0.3, 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='float', dest='dist_min', default='0.0', help='min distance')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L62_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L57_C0", "vector": [14, 1, 0.6458, 0.0104, 1, 0.94, 0.4, 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_99354:Assign_L64_C4", "label": "pub = Publisher()", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L57_C0", "vector": [14, 1, 0.6667, 0.0104, 1, 0.94, 0.5, 41, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " pub = rospy.Publisher( 'traj_pub_pts', pcu.PointCloud )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L66_C4", "label": "ros_pts = np_points_to_ros()", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L57_C0", "vector": [14, 1, 0.6875, 0.0104, 1, 0.94, 0.6, 397, 3, 1, 0, 0, 955, 10, 2], "semantic": {"name": "ros_pts", "arg_names": [], "import_names": [], "rhs_call_name": "np_points_to_ros", "annotation": ""}, "snippet": " ros_pts = pcu.np_points_to_ros( filt( opt.dist_min, opt.dist_max ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L67_C4", "label": "ros_pts.header.frame_id =", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L57_C0", "vector": [14, 1, 0.6979, 0.0104, 1, 0.94, 0.7, 595, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ros_pts.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ros_pts.header.frame_id = '/odom_combined'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L69_C4", "label": "rate = Rate()", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L57_C0", "vector": [14, 1, 0.7188, 0.0104, 1, 0.94, 0.8, 477, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "rate", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " rate = rospy.Rate( 2 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Expr_L71_C4", "label": "print()", "type": "expression", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L57_C0", "vector": [8, 1, 0.7396, 0.0104, 1, 0.94, 0.9, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Publishing PointCloud')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:While_L72_C4", "label": "while", "type": "while", "loc": [72, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L57_C0", "vector": [5, 1, 0.7656, 0.0417, 1, 0.94, 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 ros_pts.header.stamp = rospy.Time.now()\n pub.publish( ros_pts )\n rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L73_C8", "label": "ros_pts.header.stamp = now()", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:While_L72_C4", "vector": [14, 2, 0.7604, 0.0104, 2, 0.94, 0.0, 747, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "ros_pts.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " ros_pts.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Expr_L74_C8", "label": "publish()", "type": "expression", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:While_L72_C4", "vector": [8, 2, 0.7708, 0.0104, 2, 0.94, 0.5, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " pub.publish( ros_pts )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99354:Expr_L75_C8", "label": "sleep()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99354:While_L72_C4", "vector": [8, 2, 0.7812, 0.0104, 2, 0.94, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rate.sleep()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Return_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:For_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:For_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:For_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L35_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Expr_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Return_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Expr_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Return_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Import_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Expr_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Expr_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Expr_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:If_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:While_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:While_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:While_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99354:While_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99354:Expr_L75_C8"}]
#! /usr/bin/python import roslib; roslib.load_manifest('hrl_pr2_kinematics_tutorials') roslib.load_manifest('rfid_people_following') roslib.load_manifest('std_srvs') roslib.load_manifest('joy') import rospy from rfid_people_following.srv import StringInt32_Int32 from rfid_people_following.srv import String_Int32 from rfid_people_following.srv import Int32_Int32 from rfid_people_following.srv import String_StringArr from rfid_people_following.srv import rfid_gui as gui_srv from rfid_people_following.srv import HandoffSrv from std_srvs.srv import Empty from joy.msg import Joy from cmd_process import CmdProcess import numpy as np, math import time class DemoNode(): def __init__( self ): rospy.init_node( 'rfid_demo', anonymous = True ) rospy.logout( 'demo_node: Initializing' ) rospy.logout( 'demo_node: Waiting for services' ) rospy.wait_for_service( '/rfid_servo/servo' ) rospy.wait_for_service( '/rfid_orient/orient' ) rospy.wait_for_service( '/rfid_orient/flap' ) rospy.wait_for_service( '/rfid_handoff/initialize' ) rospy.wait_for_service( '/rfid_handoff/handoff' ) rospy.wait_for_service( '/rfid_handoff/wave' ) #rospy.wait_for_service( '/rfid_gui/select' ) rospy.logout( 'demo_node: All services ready.' ) self.last_button = time.time() self.run_demo = False self.run_hoinit = False self.run_handoff = False self._joy_sub = rospy.Subscriber( 'joy', Joy, self.joy_process ) self._servo = rospy.ServiceProxy( '/rfid_servo/servo', StringInt32_Int32 ) self.follow1 = lambda : self._servo( 'person ', 1 ) # Stops at first obs self.follow = lambda : self._servo( 'person ', 0 ) # Runs forever self._servo_stop = rospy.ServiceProxy( '/rfid_servo/stop_next_obs', Int32_Int32 ) self.servo_toggle = lambda : self._servo_stop( 1 ) self._handoff = rospy.ServiceProxy( '/rfid_handoff/handoff', HandoffSrv ) self.handoff = lambda : self._handoff() self._hoinit = rospy.ServiceProxy( '/rfid_handoff/initialize', HandoffSrv ) self.hoinit = lambda : self._hoinit() self._howave = rospy.ServiceProxy( '/rfid_handoff/wave', HandoffSrv ) self.howave = lambda : self._howave() self._flap = rospy.ServiceProxy( '/rfid_orient/flap', String_StringArr ) self.flap = lambda : self._flap( '' ) self._orient = rospy.ServiceProxy( '/rfid_orient/orient', String_Int32 ) self.orient = lambda tagid: self._orient( tagid ) #self._gui = rospy.ServiceProxy( '/rfid_gui/select', gui_srv ) #self.gui = lambda tags: self._gui( tags ) self._service = rospy.Service( '/rfid_demo/demo', Empty, self.demo ) self._service = rospy.Service( '/rfid_demo/gui', Empty, self.gui_test ) rospy.logout( 'demo_node: Demo service ready!' ) def joy_process( self, msg ): if msg.buttons[11] == 1 and time.time() - self.last_button > 1.0: if msg.buttons[12] == 1: # tri + R1 rospy.logout( 'demo_node: joy_process: Calling demo service' ) p = CmdProcess( ['rosservice', 'call', '/rfid_demo/demo'] ) p.run() self.last_button = time.time() elif msg.buttons[13] == 1: # circle + R1 rospy.logout( 'demo_node: joy_process: Calling handoff service' ) p = CmdProcess( ['rosservice', 'call', '/rfid_handoff/handoff'] ) p.run() self.last_button = time.time() elif msg.buttons[14] == 1: # X + R1 rospy.logout( 'demo_node: joy_process: Calling servo toggle service' ) p = CmdProcess( ['rosservice', 'call', '/rfid_servo/stop_next_obs', '1'] ) p.run() self.last_button = time.time() elif msg.buttons[15] == 1: # square + R1 rospy.logout( 'demo_node: joy_process: Calling handoff initialization service' ) p = CmdProcess( ['rosservice', 'call', '/rfid_handoff/initialize'] ) p.run() self.last_button = time.time() elif msg.buttons[9] == 1: # R2 + R1 rospy.logout( 'demo_node: joy_process: Calling handoff wave service' ) p = CmdProcess( ['rosservice', 'call', '/rfid_handoff/wave'] ) p.run() self.last_button = time.time() def gui_test( self, msg = None ): tags = self.flap().value gui_resp = self.gui( tags ) def demo( self, msg = None ): tags = self.flap().value #gui_resp = self.gui( tags ) #self.orient( gui_resp.selection ) self.orient( 'person ' ) #self.follow1() self.follow() self.handoff() if __name__ == '__main__': dn = DemoNode() rospy.spin()
ajibawa-2023/Python-Code-Large/train/row_99355
90
121
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0248, 0.0083, 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_99355:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0331, 0.0083, 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('hrl_pr2_kinematics_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0413, 0.0083, 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": "roslib.load_manifest('rfid_people_following')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0496, 0.0083, 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('std_srvs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0579, 0.0083, 0, 0.66, 0.2222, 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('joy')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Import_L8_C0", "label": "rospy import rospy", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0661, 0.0083, 0, 0.66, 0.2778, 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_99355:ImportFrom_L10_C0", "label": "from rfid_people_following.srv import StringInt32_Int32", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0826, 0.0083, 0, 0.66, 0.3333, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["StringInt32_Int32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import StringInt32_Int32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:ImportFrom_L11_C0", "label": "from rfid_people_following.srv import String_Int32", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0083, 0, 0.66, 0.3889, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["String_Int32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import String_Int32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:ImportFrom_L12_C0", "label": "from rfid_people_following.srv import Int32_Int32", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0992, 0.0083, 0, 0.66, 0.4444, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["Int32_Int32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import Int32_Int32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:ImportFrom_L13_C0", "label": "from rfid_people_following.srv import String_StringArr", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.1074, 0.0083, 0, 0.66, 0.5, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["String_StringArr"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import String_StringArr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:ImportFrom_L14_C0", "label": "from rfid_people_following.srv import gui_srv", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.1157, 0.0083, 0, 0.66, 0.5556, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["gui_srv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import rfid_gui as gui_srv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:ImportFrom_L15_C0", "label": "from rfid_people_following.srv import HandoffSrv", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.124, 0.0083, 0, 0.66, 0.6111, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["HandoffSrv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import HandoffSrv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:ImportFrom_L16_C0", "label": "from std_srvs.srv import Empty", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1322, 0.0083, 0, 0.66, 0.6667, 261, 0, 1, 0, 0, 261, 0, 0], "semantic": {"name": "std_srvs.srv", "arg_names": [], "import_names": ["Empty"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_srvs.srv import Empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:ImportFrom_L17_C0", "label": "from joy.msg import Joy", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.1405, 0.0083, 0, 0.66, 0.7222, 242, 0, 1, 0, 0, 242, 0, 0], "semantic": {"name": "joy.msg", "arg_names": [], "import_names": ["Joy"], "rhs_call_name": "", "annotation": ""}, "snippet": "from joy.msg import Joy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:ImportFrom_L18_C0", "label": "from cmd_process import CmdProcess", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1488, 0.0083, 0, 0.66, 0.7778, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "cmd_process", "arg_names": [], "import_names": ["CmdProcess"], "rhs_call_name": "", "annotation": ""}, "snippet": "from cmd_process import CmdProcess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Import_L20_C0", "label": "numpy import np, math", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.1653, 0.0083, 0, 0.66, 0.8333, 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_99355:Import_L21_C0", "label": "time import time", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.1736, 0.0083, 0, 0.66, 0.8889, 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_99355:ClassDef_L23_C0", "label": "DemoNode", "type": "class", "loc": [23, 117], "level": 0, "parent": null, "vector": [3, 0, 0.5785, 0.7851, 0, 0.66, 0.9444, 960, 0, 4, 0, 0, 0, 0, 57], "semantic": {"name": "DemoNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DemoNode():\n def __init__( self ):\n rospy.init_node( 'rfid_demo', anonymous = True )\n rospy.logout( 'demo_node: Initializing' )\n\n rospy.logout( 'demo_node: Waiting for services' )\n rospy.wait_for_service( '/rfid_servo/servo' )\n rospy.wait_for_service( '/rfid_orient/orient' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "label": "__init__", "type": "function", "loc": [24, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:ClassDef_L23_C0", "vector": [2, 1, 0.405, 0.4215, 1, 0.36, 0.0, 555, 0, 1, 0, 0, 0, 0, 30], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self ):\n rospy.init_node( 'rfid_demo', anonymous = True )\n rospy.logout( 'demo_node: Initializing' )\n\n rospy.logout( 'demo_node: Waiting for services' )\n rospy.wait_for_service( '/rfid_servo/servo' )\n rospy.wait_for_service( '/rfid_orient/orient' )\n rospy.wait_for_service( '/rfid_orient/flap' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L25_C8", "label": "init_node()", "type": "expression", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [8, 2, 0.2066, 0.0083, 2, 0.29, 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( 'rfid_demo', anonymous = True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L26_C8", "label": "logout()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [8, 2, 0.2149, 0.0083, 2, 0.29, 0.0312, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'demo_node: Initializing' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L28_C8", "label": "logout()", "type": "expression", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [8, 2, 0.2314, 0.0083, 2, 0.29, 0.0625, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'demo_node: Waiting for services' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L29_C8", "label": "wait_for_service()", "type": "expression", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [8, 2, 0.2397, 0.0083, 2, 0.29, 0.0938, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service( '/rfid_servo/servo' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L30_C8", "label": "wait_for_service()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [8, 2, 0.2479, 0.0083, 2, 0.29, 0.125, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service( '/rfid_orient/orient' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L31_C8", "label": "wait_for_service()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [8, 2, 0.2562, 0.0083, 2, 0.29, 0.1562, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service( '/rfid_orient/flap' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L32_C8", "label": "wait_for_service()", "type": "expression", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [8, 2, 0.2645, 0.0083, 2, 0.29, 0.1875, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service( '/rfid_handoff/initialize' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L33_C8", "label": "wait_for_service()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [8, 2, 0.2727, 0.0083, 2, 0.29, 0.2188, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service( '/rfid_handoff/handoff' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L34_C8", "label": "wait_for_service()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [8, 2, 0.281, 0.0083, 2, 0.29, 0.25, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service( '/rfid_handoff/wave' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L36_C8", "label": "logout()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [8, 2, 0.2975, 0.0083, 2, 0.29, 0.2812, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'demo_node: All services ready.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L38_C8", "label": "self.last_button = time()", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [14, 2, 0.314, 0.0083, 2, 0.29, 0.3125, 456, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "self.last_button", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " self.last_button = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L39_C8", "label": "self.run_demo =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [14, 2, 0.3223, 0.0083, 2, 0.29, 0.3438, 464, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.run_demo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.run_demo = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L40_C8", "label": "self.run_hoinit =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [14, 2, 0.3306, 0.0083, 2, 0.29, 0.375, 338, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.run_hoinit", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.run_hoinit = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L41_C8", "label": "self.run_handoff =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [14, 2, 0.3388, 0.0083, 2, 0.29, 0.4062, 979, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.run_handoff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.run_handoff = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L43_C8", "label": "self._joy_sub = Subscriber()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [14, 2, 0.3554, 0.0083, 2, 0.29, 0.4375, 562, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "self._joy_sub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " self._joy_sub = rospy.Subscriber( 'joy', Joy, self.joy_process )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L45_C8", "label": "self._servo = ServiceProxy()", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [14, 2, 0.3719, 0.0083, 2, 0.29, 0.4688, 631, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._servo", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._servo = rospy.ServiceProxy( '/rfid_servo/servo', StringInt32_Int32 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L46_C8", "label": "self.follow1 =", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [14, 2, 0.3802, 0.0083, 2, 0.29, 0.5, 595, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.follow1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.follow1 = lambda : self._servo( 'person ', 1 ) # Stops at first obs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L47_C8", "label": "self.follow =", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [14, 2, 0.3884, 0.0083, 2, 0.29, 0.5312, 949, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.follow", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.follow = lambda : self._servo( 'person ', 0 ) # Runs forever"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L49_C8", "label": "self._servo_stop = ServiceProxy()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [14, 2, 0.405, 0.0083, 2, 0.29, 0.5625, 505, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._servo_stop", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._servo_stop = rospy.ServiceProxy( '/rfid_servo/stop_next_obs', Int32_Int32 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L50_C8", "label": "self.servo_toggle =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [14, 2, 0.4132, 0.0083, 2, 0.29, 0.5938, 613, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.servo_toggle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.servo_toggle = lambda : self._servo_stop( 1 ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L52_C8", "label": "self._handoff = ServiceProxy()", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [14, 2, 0.4298, 0.0083, 2, 0.29, 0.625, 138, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._handoff", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._handoff = rospy.ServiceProxy( '/rfid_handoff/handoff', HandoffSrv )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L53_C8", "label": "self.handoff =", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [14, 2, 0.438, 0.0083, 2, 0.29, 0.6562, 434, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.handoff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.handoff = lambda : self._handoff()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L55_C8", "label": "self._hoinit = ServiceProxy()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [14, 2, 0.4545, 0.0083, 2, 0.29, 0.6875, 326, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._hoinit", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._hoinit = rospy.ServiceProxy( '/rfid_handoff/initialize', HandoffSrv )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L56_C8", "label": "self.hoinit =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [14, 2, 0.4628, 0.0083, 2, 0.29, 0.7188, 941, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.hoinit", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.hoinit = lambda : self._hoinit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L58_C8", "label": "self._howave = ServiceProxy()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [14, 2, 0.4793, 0.0083, 2, 0.29, 0.75, 667, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._howave", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._howave = rospy.ServiceProxy( '/rfid_handoff/wave', HandoffSrv )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L59_C8", "label": "self.howave =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [14, 2, 0.4876, 0.0083, 2, 0.29, 0.7812, 631, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.howave", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.howave = lambda : self._howave()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L61_C8", "label": "self._flap = ServiceProxy()", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [14, 2, 0.5041, 0.0083, 2, 0.29, 0.8125, 835, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._flap", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._flap = rospy.ServiceProxy( '/rfid_orient/flap', String_StringArr )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L62_C8", "label": "self.flap =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [14, 2, 0.5124, 0.0083, 2, 0.29, 0.8438, 124, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.flap", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.flap = lambda : self._flap( '' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L64_C8", "label": "self._orient = ServiceProxy()", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [14, 2, 0.5289, 0.0083, 2, 0.29, 0.875, 142, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._orient", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._orient = rospy.ServiceProxy( '/rfid_orient/orient', String_Int32 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L65_C8", "label": "self.orient =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [14, 2, 0.5372, 0.0083, 2, 0.29, 0.9062, 883, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.orient", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.orient = lambda tagid: self._orient( tagid )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L70_C8", "label": "self._service = Service()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [14, 2, 0.5785, 0.0083, 2, 0.29, 0.9375, 143, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self._service", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self._service = rospy.Service( '/rfid_demo/demo', Empty, self.demo )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L71_C8", "label": "self._service = Service()", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [14, 2, 0.5868, 0.0083, 2, 0.29, 0.9688, 143, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self._service", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self._service = rospy.Service( '/rfid_demo/gui', Empty, self.gui_test )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L74_C8", "label": "logout()", "type": "expression", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "vector": [8, 2, 0.6116, 0.0083, 2, 0.29, 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( 'demo_node: Demo service ready!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L76_C4", "label": "joy_process", "type": "function", "loc": [76, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:ClassDef_L23_C0", "vector": [2, 1, 0.7355, 0.2231, 1, 0.36, 0.3333, 715, 0, 2, 0, 0, 0, 0, 21], "semantic": {"name": "joy_process", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def joy_process( self, msg ):\n if msg.buttons[11] == 1 and time.time() - self.last_button > 1.0:\n if msg.buttons[12] == 1: # tri + R1\n rospy.logout( 'demo_node: joy_process: Calling demo service' )\n p = CmdProcess( ['rosservice', 'call', '/rfid_demo/demo'] )\n p.run()\n self.last_button = time.time()\n elif msg.buttons[13] == 1: # circle + R1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L77_C8", "label": "if", "type": "if", "loc": [77, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L76_C4", "vector": [4, 2, 0.7397, 0.2149, 2, 0.01, 0.0, 0, 0, 0, 0, 0, 0, 0, 21], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg.buttons[11] == 1 and time.time() - self.last_button > 1.0:\n if msg.buttons[12] == 1: # tri + R1\n rospy.logout( 'demo_node: joy_process: Calling demo service' )\n p = CmdProcess( ['rosservice', 'call', '/rfid_demo/demo'] )\n p.run()\n self.last_button = time.time()\n elif msg.buttons[13] == 1: # circle + R1\n rospy.logout( 'demo_node: joy_process: Calling handoff service' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L78_C12", "label": "if", "type": "if", "loc": [78, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L77_C8", "vector": [4, 3, 0.7438, 0.2066, 3, 0.97, 0.0, 0, 0, 0, 0, 0, 0, 0, 20], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg.buttons[12] == 1: # tri + R1\n rospy.logout( 'demo_node: joy_process: Calling demo service' )\n p = CmdProcess( ['rosservice', 'call', '/rfid_demo/demo'] )\n p.run()\n self.last_button = time.time()\n elif msg.buttons[13] == 1: # circle + R1\n rospy.logout( 'demo_node: joy_process: Calling handoff service' )\n p = CmdProcess( ['rosservice', 'call', '/rfid_handoff/handoff'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L79_C16", "label": "logout()", "type": "expression", "loc": [79, 79], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L78_C12", "vector": [8, 4, 0.6529, 0.0083, 4, 0.92, 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( 'demo_node: joy_process: Calling demo service' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L80_C16", "label": "p = CmdProcess()", "type": "assigned_variable", "loc": [80, 80], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L78_C12", "vector": [14, 4, 0.6612, 0.0083, 4, 0.92, 0.25, 491, 3, 1, 0, 0, 248, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "CmdProcess", "annotation": ""}, "snippet": " p = CmdProcess( ['rosservice', 'call', '/rfid_demo/demo'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L81_C16", "label": "run()", "type": "expression", "loc": [81, 81], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L78_C12", "vector": [8, 4, 0.6694, 0.0083, 4, 0.92, 0.5, 679, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " p.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L82_C16", "label": "self.last_button = time()", "type": "assigned_variable", "loc": [82, 82], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L78_C12", "vector": [14, 4, 0.6777, 0.0083, 4, 0.92, 0.75, 456, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "self.last_button", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " self.last_button = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L83_C12", "label": "if", "type": "if", "loc": [83, 102], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L78_C12", "vector": [4, 4, 0.7645, 0.1653, 4, 0.92, 1.0, 0, 0, 0, 0, 0, 0, 0, 16], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif msg.buttons[13] == 1: # circle + R1\n rospy.logout( 'demo_node: joy_process: Calling handoff service' )\n p = CmdProcess( ['rosservice', 'call', '/rfid_handoff/handoff'] )\n p.run()\n self.last_button = time.time()\n elif msg.buttons[14] == 1: # X + R1\n rospy.logout( 'demo_node: joy_process: Calling servo toggle service' )\n p = CmdProcess( ['rosservice', 'call', '/rfid_servo/stop_next_obs', '1'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L84_C16", "label": "logout()", "type": "expression", "loc": [84, 84], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L83_C12", "vector": [8, 5, 0.6942, 0.0083, 5, 0.83, 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( 'demo_node: joy_process: Calling handoff service' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L85_C16", "label": "p = CmdProcess()", "type": "assigned_variable", "loc": [85, 85], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L83_C12", "vector": [14, 5, 0.7025, 0.0083, 5, 0.83, 0.25, 491, 3, 1, 0, 0, 248, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "CmdProcess", "annotation": ""}, "snippet": " p = CmdProcess( ['rosservice', 'call', '/rfid_handoff/handoff'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L86_C16", "label": "run()", "type": "expression", "loc": [86, 86], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L83_C12", "vector": [8, 5, 0.7107, 0.0083, 5, 0.83, 0.5, 679, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " p.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L87_C16", "label": "self.last_button = time()", "type": "assigned_variable", "loc": [87, 87], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L83_C12", "vector": [14, 5, 0.719, 0.0083, 5, 0.83, 0.75, 456, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "self.last_button", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " self.last_button = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L88_C12", "label": "if", "type": "if", "loc": [88, 102], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L83_C12", "vector": [4, 5, 0.7851, 0.124, 5, 0.83, 1.0, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif msg.buttons[14] == 1: # X + R1\n rospy.logout( 'demo_node: joy_process: Calling servo toggle service' )\n p = CmdProcess( ['rosservice', 'call', '/rfid_servo/stop_next_obs', '1'] )\n p.run()\n self.last_button = time.time()\n elif msg.buttons[15] == 1: # square + R1\n rospy.logout( 'demo_node: joy_process: Calling handoff initialization service' )\n p = CmdProcess( ['rosservice', 'call', '/rfid_handoff/initialize'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L89_C16", "label": "logout()", "type": "expression", "loc": [89, 89], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L88_C12", "vector": [8, 6, 0.7355, 0.0083, 6, 0.03, 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( 'demo_node: joy_process: Calling servo toggle service' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L90_C16", "label": "p = CmdProcess()", "type": "assigned_variable", "loc": [90, 90], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L88_C12", "vector": [14, 6, 0.7438, 0.0083, 6, 0.03, 0.25, 491, 3, 1, 0, 0, 248, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "CmdProcess", "annotation": ""}, "snippet": " p = CmdProcess( ['rosservice', 'call', '/rfid_servo/stop_next_obs', '1'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L91_C16", "label": "run()", "type": "expression", "loc": [91, 91], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L88_C12", "vector": [8, 6, 0.7521, 0.0083, 6, 0.03, 0.5, 679, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " p.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L92_C16", "label": "self.last_button = time()", "type": "assigned_variable", "loc": [92, 92], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L88_C12", "vector": [14, 6, 0.7603, 0.0083, 6, 0.03, 0.75, 456, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "self.last_button", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " self.last_button = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L93_C12", "label": "if", "type": "if", "loc": [93, 102], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L88_C12", "vector": [4, 6, 0.8058, 0.0826, 6, 0.03, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif msg.buttons[15] == 1: # square + R1\n rospy.logout( 'demo_node: joy_process: Calling handoff initialization service' )\n p = CmdProcess( ['rosservice', 'call', '/rfid_handoff/initialize'] )\n p.run()\n self.last_button = time.time()\n elif msg.buttons[9] == 1: # R2 + R1\n rospy.logout( 'demo_node: joy_process: Calling handoff wave service' )\n p = CmdProcess( ['rosservice', 'call', '/rfid_handoff/wave'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L94_C16", "label": "logout()", "type": "expression", "loc": [94, 94], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L93_C12", "vector": [8, 7, 0.7769, 0.0083, 7, 0.72, 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( 'demo_node: joy_process: Calling handoff initialization service' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L95_C16", "label": "p = CmdProcess()", "type": "assigned_variable", "loc": [95, 95], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L93_C12", "vector": [14, 7, 0.7851, 0.0083, 7, 0.72, 0.25, 491, 3, 1, 0, 0, 248, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "CmdProcess", "annotation": ""}, "snippet": " p = CmdProcess( ['rosservice', 'call', '/rfid_handoff/initialize'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L96_C16", "label": "run()", "type": "expression", "loc": [96, 96], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L93_C12", "vector": [8, 7, 0.7934, 0.0083, 7, 0.72, 0.5, 679, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " p.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L97_C16", "label": "self.last_button = time()", "type": "assigned_variable", "loc": [97, 97], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L93_C12", "vector": [14, 7, 0.8017, 0.0083, 7, 0.72, 0.75, 456, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "self.last_button", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " self.last_button = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L98_C12", "label": "if", "type": "if", "loc": [98, 102], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L93_C12", "vector": [4, 7, 0.8264, 0.0413, 7, 0.72, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif msg.buttons[9] == 1: # R2 + R1\n rospy.logout( 'demo_node: joy_process: Calling handoff wave service' )\n p = CmdProcess( ['rosservice', 'call', '/rfid_handoff/wave'] )\n p.run()\n self.last_button = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L99_C16", "label": "logout()", "type": "expression", "loc": [99, 99], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L98_C12", "vector": [8, 8, 0.8182, 0.0083, 8, 0.78, 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( 'demo_node: joy_process: Calling handoff wave service' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L100_C16", "label": "p = CmdProcess()", "type": "assigned_variable", "loc": [100, 100], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L98_C12", "vector": [14, 8, 0.8264, 0.0083, 8, 0.78, 0.3333, 491, 3, 1, 0, 0, 248, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "CmdProcess", "annotation": ""}, "snippet": " p = CmdProcess( ['rosservice', 'call', '/rfid_handoff/wave'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L101_C16", "label": "run()", "type": "expression", "loc": [101, 101], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L98_C12", "vector": [8, 8, 0.8347, 0.0083, 8, 0.78, 0.6667, 679, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " p.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L102_C16", "label": "self.last_button = time()", "type": "assigned_variable", "loc": [102, 102], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L98_C12", "vector": [14, 8, 0.843, 0.0083, 8, 0.78, 1.0, 456, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "self.last_button", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " self.last_button = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L104_C4", "label": "gui_test", "type": "function", "loc": [104, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:ClassDef_L23_C0", "vector": [2, 1, 0.8678, 0.0248, 1, 0.36, 0.6667, 824, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "gui_test", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def gui_test( self, msg = None ):\n tags = self.flap().value\n gui_resp = self.gui( tags )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L105_C8", "label": "tags =", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L104_C4", "vector": [14, 2, 0.8678, 0.0083, 2, 0.32, 0.0, 487, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tags", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tags = self.flap().value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L106_C8", "label": "gui_resp = gui()", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L104_C4", "vector": [14, 2, 0.876, 0.0083, 2, 0.32, 1.0, 689, 3, 1, 0, 0, 22, 10, 1], "semantic": {"name": "gui_resp", "arg_names": [], "import_names": [], "rhs_call_name": "gui", "annotation": ""}, "snippet": " gui_resp = self.gui( tags )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L108_C4", "label": "demo", "type": "function", "loc": [108, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:ClassDef_L23_C0", "vector": [2, 1, 0.9298, 0.0826, 1, 0.36, 1.0, 886, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "demo", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def demo( self, msg = None ):\n tags = self.flap().value\n #gui_resp = self.gui( tags )\n\n #self.orient( gui_resp.selection )\n self.orient( 'person ' )\n \n #self.follow1()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L109_C8", "label": "tags =", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L108_C4", "vector": [14, 2, 0.9008, 0.0083, 2, 0.67, 0.0, 487, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tags", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tags = self.flap().value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L113_C8", "label": "orient()", "type": "expression", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L108_C4", "vector": [8, 2, 0.9339, 0.0083, 2, 0.67, 0.3333, 295, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "orient", "arg_names": [], "import_names": [], "rhs_call_name": "orient", "annotation": ""}, "snippet": " self.orient( 'person ' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L116_C8", "label": "follow()", "type": "expression", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L108_C4", "vector": [8, 2, 0.9587, 0.0083, 2, 0.67, 0.6667, 392, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "follow", "arg_names": [], "import_names": [], "rhs_call_name": "follow", "annotation": ""}, "snippet": " self.follow()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L117_C8", "label": "handoff()", "type": "expression", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L108_C4", "vector": [8, 2, 0.9669, 0.0083, 2, 0.67, 1.0, 798, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "handoff", "arg_names": [], "import_names": [], "rhs_call_name": "handoff", "annotation": ""}, "snippet": " self.handoff()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L119_C0", "label": "if", "type": "if", "loc": [119, 121], "level": 0, "parent": null, "vector": [4, 0, 0.9917, 0.0248, 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 dn = DemoNode()\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L120_C4", "label": "dn = DemoNode()", "type": "assigned_variable", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L119_C0", "vector": [14, 1, 0.9917, 0.0083, 1, 0.34, 0.0, 105, 3, 0, 0, 0, 960, 10, 1], "semantic": {"name": "dn", "arg_names": [], "import_names": [], "rhs_call_name": "DemoNode", "annotation": ""}, "snippet": " dn = DemoNode()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L121_C4", "label": "spin()", "type": "expression", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L119_C0", "vector": [8, 1, 1.0, 0.0083, 1, 0.34, 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_99355:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L78_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L79_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L78_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L80_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L78_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L81_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L78_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L82_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L78_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L83_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L84_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L83_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L85_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L83_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L86_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L83_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L87_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L83_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L88_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L89_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L88_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L90_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L88_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L91_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L88_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L92_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L88_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L93_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L94_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L93_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L95_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L93_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L96_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L93_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L97_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L93_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L98_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L99_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L98_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L100_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L98_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L101_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L98_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L102_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Assign_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99355:If_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99355:Expr_L121_C4"}]
#! /usr/bin/python import time import roslib roslib.load_manifest('rospy') roslib.load_manifest('tf') roslib.load_manifest('geometry_msgs') roslib.load_manifest('std_msgs') roslib.load_manifest('hrl_rfid') roslib.load_manifest('robotis') roslib.load_manifest('rfid_people_following') import rospy import tf import tf.transformations as tft from geometry_msgs.msg import Twist from geometry_msgs.msg import PointStamped from geometry_msgs.msg import Point from geometry_msgs.msg import PoseStamped from geometry_msgs.msg import Quaternion from geometry_msgs.msg import PoseWithCovarianceStamped from std_msgs.msg import Float64 import hrl_rfid.ros_M5e_client as rmc import robotis.ros_robotis as rr from hrl_rfid.msg import RFIDreadArr import rfid_people_following.rotate_backup_node as rb from rfid_people_following.cmd_process import CmdProcess from rfid_people_following.srv import String_Int32 from rfid_people_following.srv import String_Int32Response from rfid_people_following.srv import String_StringArr from rfid_people_following.srv import StringArr_Int32 import numpy as np, math import time from threading import Thread from collections import deque from functools import reduce PAN_RATE = 30.0 #PAN_RATE = 10.0 # Used for datacapture. #PAN_RATE = 3.0 def calculate_angle( pt1 ): return np.arctan2( pt1.point.y, pt1.point.x ) def standard_rad(t): if t > 0: return ((t + np.pi) % (np.pi * 2)) - np.pi else: return ((t - np.pi) % (np.pi * -2)) + np.pi class OrientNode( ): def __init__( self ): rospy.logout('orient_node: Initializing') rospy.init_node('orient_node') # After calling "flap ears", data will look something like this: # { 'TagID1': [[ang,rssi], [ang,rssi], ...] # 'TagID2': ... } # * All angles are in /base_link and rssi's from both antennas self.data = {} # Will be transformed into base frame to determine best turn angle -- results in approximately 5-degrees (max) error for small angle assumption self.tag_gt = { 'EleLeftEar': PointStamped(), 'EleRightEar': PointStamped() } self.tag_gt[ 'EleLeftEar' ].header.frame_id = '/ear_antenna_left' self.tag_gt[ 'EleLeftEar' ].header.stamp = rospy.Time.now() self.tag_gt[ 'EleLeftEar' ].point.x = 10.0 self.tag_gt[ 'EleRightEar' ].header.frame_id = '/ear_antenna_right' self.tag_gt[ 'EleRightEar' ].header.stamp = rospy.Time.now() self.tag_gt[ 'EleRightEar' ].point.x = 10.0 self.listener = tf.TransformListener() self.listener.waitForTransform('/base_link', '/ear_antenna_left', rospy.Time(0), timeout = rospy.Duration(100) ) self.listener.waitForTransform('/base_link', '/ear_antenna_right', rospy.Time(0), timeout = rospy.Duration(100) ) rospy.logout('orient_node: Transforms ready') # For movement... self.rotate_backup_client = rb.RotateBackupClient() # "Ears" Setup self.p_left = rr.ROS_Robotis_Client( 'left_pan' ) self.t_left = rr.ROS_Robotis_Client( 'left_tilt' ) self.p_right = rr.ROS_Robotis_Client( 'right_pan' ) self.t_right = rr.ROS_Robotis_Client( 'right_tilt' ) self.EX_1 = 1.350 self.EX_2 = 0.920 self.p_left.move_angle( self.EX_1, math.radians(10), blocking = False ) self.p_right.move_angle( -1.0 * self.EX_1, math.radians(10), blocking = True ) self.t_left.move_angle( 0.0, math.radians(10), blocking = False ) self.t_right.move_angle( 0.0, math.radians(10), blocking = True ) while self.p_left.is_moving() or self.p_right.is_moving(): time.sleep( 0.01 ) self.bag_pid = None self.r = rmc.ROS_M5e_Client('ears') self.__service_flap = rospy.Service( '/rfid_orient/flap', String_StringArr, self.flap_ears ) self.__service_bag = rospy.Service( '/rfid_orient/bag', StringArr_Int32, self.bag_cap ) self.__service_orient = rospy.Service( '/rfid_orient/orient', String_Int32, self.orient ) self.tag_arr_sub = rospy.Subscriber( '/rfid/ears_reader_arr', RFIDreadArr, self.add_tags ) rospy.logout( 'orient_node: Waiting for service calls.' ) def bag_cap( self, request ): # request.data => String array # sample args: ['rosbag', 'record', '/tf', '/rfid/ears_reader_arr', '-o', 'data/data'] if (request.data == [] or request.data[0] == 'kill'): if self.bag_pid == None: rospy.logout( 'orient_node: No open bag to kill.' ) else: rospy.logout( 'orient_node: Killing open bag.' ) self.bag_pid.kill() self.bag_pid = None return int( True ) s = reduce( lambda x,y: x+' '+y, request.data ) rospy.logout( 'orient_node: Calling CmdProcess with args: %s' % s ) self.bag_pid = CmdProcess( request.data ) self.bag_pid.run() return int( True ) def orient( self, request ): tagid = request.data if not self.data.has_key( tagid ): rospy.logout( 'Tag id \'%s\' not found during last scan.' % tagid ) return String_Int32Response( int( False )) arr = np.array( self.data[ tagid ]).T arr = arr[:,np.argsort( arr[0] )] h, bins = np.histogram( arr[0], 36, ( -np.pi, np.pi )) ind = np.sum(arr[0][:, np.newaxis] > bins, axis = 1) - 1 # Gives indices for data into bins bin_centers = (bins[:-1] + bins[1:]) / 2.0 best_dir = 0.0 best_rssi = 0.0 for i in np.unique( ind ): avg_rssi = np.mean(arr[1,np.argwhere( ind == i )]) if avg_rssi > best_rssi: best_rssi = avg_rssi best_dir = bin_centers[i] rospy.logout( 'orient_node: Best dir (deg): %2.2f with avg rssi: %2.1f' % ( math.degrees(best_dir), best_rssi )) self.rotate_backup_client.rotate_backup( best_dir, 0.0 ) return String_Int32Response( int( True )) def add_tags( self, msg ): for read in msg.arr: if read.rssi == -1: return False self.tag_gt[ read.antenna_name ].header.stamp = rospy.Time(0) try: pt = self.listener.transformPoint( '/base_link', self.tag_gt[ read.antenna_name ]) except: rospy.logout( 'orient_node: Transform failed' ) return False if not self.data.has_key( read.tagID ): self.data[ read.tagID ] = [] self.data[ read.tagID ].append([ calculate_angle( pt ), 1.0 * read.rssi ]) return True def flap_ears( self, request ): self.data = {} tagid = request.data if tagid == '': rospy.logout( 'orient_node: capture for tagid: \'\' requested. Using QueryEnv.' ) self.r.query_mode( ) else: rospy.logout( 'orient_node: capture for tagid: \'%s\' requested' % tagid ) self.r.track_mode( tagid ) forward = False tilt_angs = [ math.radians( 0.0 ), math.radians( 0.0 ) ] for ta in tilt_angs: # Tilt self.t_left.move_angle( ta, math.radians( 30.0 ), blocking = False ) self.t_right.move_angle( -1.0 * ta, math.radians( 30.0 ), blocking = False ) while self.t_left.is_moving() or self.t_right.is_moving(): time.sleep(0.01) # Pan if forward: self.p_left.move_angle( self.EX_1, math.radians( PAN_RATE ), blocking = False ) self.p_right.move_angle( -1.0 * self.EX_1, math.radians( PAN_RATE ), blocking = True ) forward = False else: self.p_left.move_angle( -1.0 * self.EX_2, math.radians( PAN_RATE ), blocking = False ) self.p_right.move_angle( self.EX_2, math.radians( PAN_RATE ), blocking = True ) forward = True while self.p_left.is_moving() or self.p_right.is_moving(): time.sleep(0.01) time.sleep(0.1) self.r.stop() print self.data.keys() # Reset / Stow self.p_left.move_angle( self.EX_1, math.radians(10), blocking = False ) self.t_left.move_angle( 0.0, math.radians(10), blocking = False ) self.p_right.move_angle( -1.0 * self.EX_1, math.radians(10), blocking = False ) self.t_right.move_angle( 0.0, math.radians(10), blocking = False ) rospy.logout( 'orient_node: capture completed' ) # print self.data return [self.data.keys()] if __name__ == '__main__': on = OrientNode() rospy.spin()
ajibawa-2023/Python-Code-Large/train/row_99356
158
234
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Import_L2_C0", "label": "time import time", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0085, 0.0043, 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_99356:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0128, 0.0043, 0, 0.66, 0.027, 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_99356:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0171, 0.0043, 0, 0.66, 0.0541, 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_99356:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0214, 0.0043, 0, 0.66, 0.0811, 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_99356:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0256, 0.0043, 0, 0.66, 0.1081, 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_99356:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0299, 0.0043, 0, 0.66, 0.1351, 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_99356:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0342, 0.0043, 0, 0.66, 0.1622, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('hrl_rfid')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L9_C0", "label": "load_manifest()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0385, 0.0043, 0, 0.66, 0.1892, 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('robotis')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L10_C0", "label": "load_manifest()", "type": "expression", "loc": [10, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0427, 0.0043, 0, 0.66, 0.2162, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('rfid_people_following')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Import_L11_C0", "label": "rospy import rospy", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.047, 0.0043, 0, 0.66, 0.2432, 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_99356:Import_L13_C0", "label": "tf import tf", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0556, 0.0043, 0, 0.66, 0.2703, 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_99356:Import_L14_C0", "label": "tf.transformations import tft", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0598, 0.0043, 0, 0.66, 0.2973, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tft"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tft"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:ImportFrom_L15_C0", "label": "from geometry_msgs.msg import Twist", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0641, 0.0043, 0, 0.66, 0.3243, 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_99356:ImportFrom_L16_C0", "label": "from geometry_msgs.msg import PointStamped", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0684, 0.0043, 0, 0.66, 0.3514, 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_99356:ImportFrom_L17_C0", "label": "from geometry_msgs.msg import Point", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0726, 0.0043, 0, 0.66, 0.3784, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Point"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:ImportFrom_L18_C0", "label": "from geometry_msgs.msg import PoseStamped", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0043, 0, 0.66, 0.4054, 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_99356:ImportFrom_L19_C0", "label": "from geometry_msgs.msg import Quaternion", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0812, 0.0043, 0, 0.66, 0.4324, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Quaternion"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Quaternion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:ImportFrom_L20_C0", "label": "from geometry_msgs.msg import PoseWithCovarianceStamped", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0855, 0.0043, 0, 0.66, 0.4595, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["PoseWithCovarianceStamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import PoseWithCovarianceStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:ImportFrom_L21_C0", "label": "from std_msgs.msg import Float64", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0897, 0.0043, 0, 0.66, 0.4865, 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_99356:Import_L23_C0", "label": "hrl_rfid.ros_M5e_client import rmc", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.0983, 0.0043, 0, 0.66, 0.5135, 460, 0, 1, 0, 0, 460, 0, 0], "semantic": {"name": "hrl_rfid.ros_M5e_client", "arg_names": [], "import_names": ["rmc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_rfid.ros_M5e_client as rmc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Import_L24_C0", "label": "robotis.ros_robotis import rr", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.1026, 0.0043, 0, 0.66, 0.5405, 570, 0, 1, 0, 0, 570, 0, 0], "semantic": {"name": "robotis.ros_robotis", "arg_names": [], "import_names": ["rr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import robotis.ros_robotis as rr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:ImportFrom_L25_C0", "label": "from hrl_rfid.msg import RFIDreadArr", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.1068, 0.0043, 0, 0.66, 0.5676, 328, 0, 1, 0, 0, 328, 0, 0], "semantic": {"name": "hrl_rfid.msg", "arg_names": [], "import_names": ["RFIDreadArr"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_rfid.msg import RFIDreadArr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Import_L26_C0", "label": "rfid_people_following.rotate_backup_node import rb", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.0043, 0, 0.66, 0.5946, 620, 0, 1, 0, 0, 620, 0, 0], "semantic": {"name": "rfid_people_following.rotate_backup_node", "arg_names": [], "import_names": ["rb"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rfid_people_following.rotate_backup_node as rb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:ImportFrom_L27_C0", "label": "from rfid_people_following.cmd_process import CmdProcess", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.1154, 0.0043, 0, 0.66, 0.6216, 482, 0, 1, 0, 0, 482, 0, 0], "semantic": {"name": "rfid_people_following.cmd_process", "arg_names": [], "import_names": ["CmdProcess"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.cmd_process import CmdProcess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:ImportFrom_L28_C0", "label": "from rfid_people_following.srv import String_Int32", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.1197, 0.0043, 0, 0.66, 0.6486, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["String_Int32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import String_Int32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:ImportFrom_L29_C0", "label": "from rfid_people_following.srv import String_Int32Response", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.1239, 0.0043, 0, 0.66, 0.6757, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["String_Int32Response"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import String_Int32Response"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:ImportFrom_L30_C0", "label": "from rfid_people_following.srv import String_StringArr", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.1282, 0.0043, 0, 0.66, 0.7027, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["String_StringArr"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import String_StringArr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:ImportFrom_L31_C0", "label": "from rfid_people_following.srv import StringArr_Int32", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.1325, 0.0043, 0, 0.66, 0.7297, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["StringArr_Int32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import StringArr_Int32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Import_L33_C0", "label": "numpy import np, math", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.141, 0.0043, 0, 0.66, 0.7568, 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_99356:Import_L34_C0", "label": "time import time", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.1453, 0.0043, 0, 0.66, 0.7838, 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_99356:ImportFrom_L35_C0", "label": "from threading import Thread", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.1496, 0.0043, 0, 0.66, 0.8108, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["Thread"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import Thread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:ImportFrom_L36_C0", "label": "from collections import deque", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.1538, 0.0043, 0, 0.66, 0.8378, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "collections", "arg_names": [], "import_names": ["deque"], "rhs_call_name": "", "annotation": ""}, "snippet": "from collections import deque"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:ImportFrom_L37_C0", "label": "from functools import reduce", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.1581, 0.0043, 0, 0.66, 0.8649, 711, 0, 1, 0, 0, 711, 0, 0], "semantic": {"name": "functools", "arg_names": [], "import_names": ["reduce"], "rhs_call_name": "", "annotation": ""}, "snippet": "from functools import reduce"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L39_C0", "label": "PAN_RATE =", "type": "assigned_variable", "loc": [39, 39], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.0043, 0, 0.66, 0.8919, 499, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "PAN_RATE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "PAN_RATE = 30.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L43_C0", "label": "calculate_angle", "type": "function", "loc": [43, 44], "level": 0, "parent": null, "vector": [2, 0, 0.1859, 0.0085, 0, 0.66, 0.9189, 793, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "calculate_angle", "arg_names": ["pt1"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def calculate_angle( pt1 ):\n return np.arctan2( pt1.point.y, pt1.point.x )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Return_L44_C4", "label": "return", "type": "return", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L43_C0", "vector": [13, 1, 0.188, 0.0043, 1, 0.89, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.arctan2( pt1.point.y, pt1.point.x )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L46_C0", "label": "standard_rad", "type": "function", "loc": [46, 50], "level": 0, "parent": null, "vector": [2, 0, 0.2051, 0.0214, 0, 0.66, 0.9459, 54, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "standard_rad", "arg_names": ["t"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def standard_rad(t):\n if t > 0:\n return ((t + np.pi) % (np.pi * 2)) - np.pi\n else:\n return ((t - np.pi) % (np.pi * -2)) + np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L47_C4", "label": "if", "type": "if", "loc": [47, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L46_C0", "vector": [4, 1, 0.2073, 0.0171, 1, 0.12, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if t > 0:\n return ((t + np.pi) % (np.pi * 2)) - np.pi\n else:\n return ((t - np.pi) % (np.pi * -2)) + np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Return_L48_C8", "label": "return", "type": "return", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L47_C4", "vector": [13, 2, 0.2051, 0.0043, 2, 0.45, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ((t + np.pi) % (np.pi * 2)) - np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Return_L50_C8", "label": "return", "type": "return", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L47_C4", "vector": [13, 2, 0.2137, 0.0043, 2, 0.45, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ((t - np.pi) % (np.pi * -2)) + np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:ClassDef_L53_C0", "label": "OrientNode", "type": "class", "loc": [53, 227], "level": 0, "parent": null, "vector": [3, 0, 0.5983, 0.7479, 0, 0.66, 0.973, 913, 0, 5, 0, 0, 0, 0, 99], "semantic": {"name": "OrientNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class OrientNode( ):\n def __init__( self ):\n rospy.logout('orient_node: Initializing')\n rospy.init_node('orient_node')\n\n # After calling \"flap ears\", data will look something like this:\n # { 'TagID1': [[ang,rssi], [ang,rssi], ...]\n # 'TagID2': ... }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "label": "__init__", "type": "function", "loc": [54, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:ClassDef_L53_C0", "vector": [2, 1, 0.359, 0.2607, 1, 0.33, 0.0, 555, 0, 1, 0, 0, 0, 0, 36], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self ):\n rospy.logout('orient_node: Initializing')\n rospy.init_node('orient_node')\n\n # After calling \"flap ears\", data will look something like this:\n # { 'TagID1': [[ang,rssi], [ang,rssi], ...]\n # 'TagID2': ... }\n # * All angles are in /base_link and rssi's from both antennas"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L55_C8", "label": "logout()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [8, 2, 0.235, 0.0043, 2, 0.54, 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('orient_node: Initializing')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L56_C8", "label": "init_node()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [8, 2, 0.2393, 0.0043, 2, 0.54, 0.0312, 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('orient_node')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L62_C8", "label": "self.data =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [14, 2, 0.265, 0.0043, 2, 0.54, 0.0625, 838, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.data = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L65_C8", "label": "self.tag_gt =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [14, 2, 0.2778, 0.0043, 2, 0.54, 0.0938, 443, 0, 0, 0, 0, 0, 6, 2], "semantic": {"name": "self.tag_gt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tag_gt = { 'EleLeftEar': PointStamped(), 'EleRightEar': PointStamped() }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L66_C8", "label": "self.tag_gt['EleLeftEar'].header.frame_id =", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [14, 2, 0.2821, 0.0043, 2, 0.54, 0.125, 141, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.tag_gt['EleLeftEar'].header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tag_gt[ 'EleLeftEar' ].header.frame_id = '/ear_antenna_left'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L67_C8", "label": "self.tag_gt['EleLeftEar'].header.stamp = now()", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [14, 2, 0.2863, 0.0043, 2, 0.54, 0.1562, 727, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "self.tag_gt['EleLeftEar'].header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " self.tag_gt[ 'EleLeftEar' ].header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L68_C8", "label": "self.tag_gt['EleLeftEar'].point.x =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [14, 2, 0.2906, 0.0043, 2, 0.54, 0.1875, 906, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.tag_gt['EleLeftEar'].point.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tag_gt[ 'EleLeftEar' ].point.x = 10.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L69_C8", "label": "self.tag_gt['EleRightEar'].header.frame_id =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [14, 2, 0.2949, 0.0043, 2, 0.54, 0.2188, 530, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.tag_gt['EleRightEar'].header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tag_gt[ 'EleRightEar' ].header.frame_id = '/ear_antenna_right'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L70_C8", "label": "self.tag_gt['EleRightEar'].header.stamp = now()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [14, 2, 0.2991, 0.0043, 2, 0.54, 0.25, 58, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "self.tag_gt['EleRightEar'].header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " self.tag_gt[ 'EleRightEar' ].header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L71_C8", "label": "self.tag_gt['EleRightEar'].point.x =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [14, 2, 0.3034, 0.0043, 2, 0.54, 0.2812, 614, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.tag_gt['EleRightEar'].point.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tag_gt[ 'EleRightEar' ].point.x = 10.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L73_C8", "label": "self.listener = TransformListener()", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [14, 2, 0.312, 0.0043, 2, 0.54, 0.3125, 686, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.listener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L74_C8", "label": "waitForTransform()", "type": "expression", "loc": [74, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [8, 2, 0.3184, 0.0085, 2, 0.54, 0.3438, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.listener.waitForTransform('/base_link', '/ear_antenna_left',\n rospy.Time(0), timeout = rospy.Duration(100) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L76_C8", "label": "waitForTransform()", "type": "expression", "loc": [76, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [8, 2, 0.3269, 0.0085, 2, 0.54, 0.375, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.listener.waitForTransform('/base_link', '/ear_antenna_right',\n rospy.Time(0), timeout = rospy.Duration(100) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L78_C8", "label": "logout()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [8, 2, 0.3333, 0.0043, 2, 0.54, 0.4062, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('orient_node: Transforms ready')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L81_C8", "label": "self.rotate_backup_client = RotateBackupClient()", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [14, 2, 0.3462, 0.0043, 2, 0.54, 0.4375, 812, 3, 0, 0, 0, 481, 10, 1], "semantic": {"name": "self.rotate_backup_client", "arg_names": [], "import_names": [], "rhs_call_name": "RotateBackupClient", "annotation": ""}, "snippet": " self.rotate_backup_client = rb.RotateBackupClient()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L84_C8", "label": "self.p_left = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [14, 2, 0.359, 0.0043, 2, 0.54, 0.4688, 577, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "self.p_left", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " self.p_left = rr.ROS_Robotis_Client( 'left_pan' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L85_C8", "label": "self.t_left = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [14, 2, 0.3632, 0.0043, 2, 0.54, 0.5, 624, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "self.t_left", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " self.t_left = rr.ROS_Robotis_Client( 'left_tilt' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L86_C8", "label": "self.p_right = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [14, 2, 0.3675, 0.0043, 2, 0.54, 0.5312, 972, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "self.p_right", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " self.p_right = rr.ROS_Robotis_Client( 'right_pan' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L87_C8", "label": "self.t_right = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [14, 2, 0.3718, 0.0043, 2, 0.54, 0.5625, 359, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "self.t_right", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " self.t_right = rr.ROS_Robotis_Client( 'right_tilt' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L89_C8", "label": "self.EX_1 =", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [14, 2, 0.3803, 0.0043, 2, 0.54, 0.5938, 791, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.EX_1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.EX_1 = 1.350"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L90_C8", "label": "self.EX_2 =", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [14, 2, 0.3846, 0.0043, 2, 0.54, 0.625, 851, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.EX_2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.EX_2 = 0.920 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L92_C8", "label": "move_angle()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [8, 2, 0.3932, 0.0043, 2, 0.54, 0.6562, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.p_left.move_angle( self.EX_1, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L93_C8", "label": "move_angle()", "type": "expression", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [8, 2, 0.3974, 0.0043, 2, 0.54, 0.6875, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.p_right.move_angle( -1.0 * self.EX_1, math.radians(10), blocking = True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L94_C8", "label": "move_angle()", "type": "expression", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [8, 2, 0.4017, 0.0043, 2, 0.54, 0.7188, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.t_left.move_angle( 0.0, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L95_C8", "label": "move_angle()", "type": "expression", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [8, 2, 0.406, 0.0043, 2, 0.54, 0.75, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.t_right.move_angle( 0.0, math.radians(10), blocking = True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:While_L96_C8", "label": "while", "type": "while", "loc": [96, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [5, 2, 0.4124, 0.0085, 2, 0.54, 0.7812, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.p_left.is_moving() or self.p_right.is_moving():\n time.sleep( 0.01 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L97_C12", "label": "sleep()", "type": "expression", "loc": [97, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:While_L96_C8", "vector": [8, 3, 0.4145, 0.0043, 3, 0.99, 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.01 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L99_C8", "label": "self.bag_pid =", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [14, 2, 0.4231, 0.0043, 2, 0.54, 0.8125, 386, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.bag_pid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.bag_pid = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L101_C8", "label": "self.r = ROS_M5e_Client()", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [14, 2, 0.4316, 0.0043, 2, 0.54, 0.8438, 173, 3, 1, 0, 0, 479, 10, 1], "semantic": {"name": "self.r", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_M5e_Client", "annotation": ""}, "snippet": " self.r = rmc.ROS_M5e_Client('ears')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L102_C8", "label": "self.__service_flap = Service()", "type": "assigned_variable", "loc": [102, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [14, 2, 0.4402, 0.0128, 2, 0.54, 0.875, 183, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self.__service_flap", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self.__service_flap = rospy.Service( '/rfid_orient/flap',\n String_StringArr,\n self.flap_ears )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L105_C8", "label": "self.__service_bag = Service()", "type": "assigned_variable", "loc": [105, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [14, 2, 0.453, 0.0128, 2, 0.54, 0.9062, 630, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self.__service_bag", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self.__service_bag = rospy.Service( '/rfid_orient/bag',\n StringArr_Int32,\n self.bag_cap )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L108_C8", "label": "self.__service_orient = Service()", "type": "assigned_variable", "loc": [108, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [14, 2, 0.4658, 0.0128, 2, 0.54, 0.9375, 945, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self.__service_orient", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self.__service_orient = rospy.Service( '/rfid_orient/orient',\n String_Int32,\n self.orient )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L111_C8", "label": "self.tag_arr_sub = Subscriber()", "type": "assigned_variable", "loc": [111, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [14, 2, 0.4786, 0.0128, 2, 0.54, 0.9688, 505, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "self.tag_arr_sub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " self.tag_arr_sub = rospy.Subscriber( '/rfid/ears_reader_arr', \n RFIDreadArr, \n self.add_tags )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L114_C8", "label": "logout()", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "vector": [8, 2, 0.4872, 0.0043, 2, 0.54, 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( 'orient_node: Waiting for service calls.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L116_C4", "label": "bag_cap", "type": "function", "loc": [116, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:ClassDef_L53_C0", "vector": [2, 1, 0.5299, 0.0726, 1, 0.33, 0.25, 137, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "bag_cap", "arg_names": ["self", "request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def bag_cap( self, request ):\n # request.data => String array\n # sample args: ['rosbag', 'record', '/tf', '/rfid/ears_reader_arr', '-o', 'data/data']\n if (request.data == [] or request.data[0] == 'kill'):\n if self.bag_pid == None:\n rospy.logout( 'orient_node: No open bag to kill.' )\n else:\n rospy.logout( 'orient_node: Killing open bag.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L119_C8", "label": "if", "type": "if", "loc": [119, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L116_C4", "vector": [4, 2, 0.5235, 0.0342, 2, 0.49, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (request.data == [] or request.data[0] == 'kill'):\n if self.bag_pid == None:\n rospy.logout( 'orient_node: No open bag to kill.' )\n else:\n rospy.logout( 'orient_node: Killing open bag.' )\n self.bag_pid.kill()\n self.bag_pid = None\n return int( True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L120_C12", "label": "if", "type": "if", "loc": [120, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L119_C8", "vector": [4, 3, 0.5235, 0.0256, 3, 0.49, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.bag_pid == None:\n rospy.logout( 'orient_node: No open bag to kill.' )\n else:\n rospy.logout( 'orient_node: Killing open bag.' )\n self.bag_pid.kill()\n self.bag_pid = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L121_C16", "label": "logout()", "type": "expression", "loc": [121, 121], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L120_C12", "vector": [8, 4, 0.5171, 0.0043, 4, 0.28, 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( 'orient_node: No open bag to kill.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L123_C16", "label": "logout()", "type": "expression", "loc": [123, 123], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L120_C12", "vector": [8, 4, 0.5256, 0.0043, 4, 0.28, 0.3333, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'orient_node: Killing open bag.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L124_C16", "label": "kill()", "type": "expression", "loc": [124, 124], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L120_C12", "vector": [8, 4, 0.5299, 0.0043, 4, 0.28, 0.6667, 173, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "kill", "arg_names": [], "import_names": [], "rhs_call_name": "kill", "annotation": ""}, "snippet": " self.bag_pid.kill()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L125_C16", "label": "self.bag_pid =", "type": "assigned_variable", "loc": [125, 125], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L120_C12", "vector": [14, 4, 0.5342, 0.0043, 4, 0.28, 1.0, 386, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.bag_pid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.bag_pid = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Return_L126_C12", "label": "return", "type": "return", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L119_C8", "vector": [13, 3, 0.5385, 0.0043, 3, 0.49, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return int( True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L128_C8", "label": "s = reduce()", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L116_C4", "vector": [14, 2, 0.547, 0.0043, 2, 0.49, 0.2, 553, 3, 2, 0, 0, 622, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "reduce", "annotation": ""}, "snippet": " s = reduce( lambda x,y: x+' '+y, request.data )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L129_C8", "label": "logout()", "type": "expression", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L116_C4", "vector": [8, 2, 0.5513, 0.0043, 2, 0.49, 0.4, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'orient_node: Calling CmdProcess with args: %s' % s )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L130_C8", "label": "self.bag_pid = CmdProcess()", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L116_C4", "vector": [14, 2, 0.5556, 0.0043, 2, 0.49, 0.6, 386, 3, 1, 0, 0, 248, 10, 1], "semantic": {"name": "self.bag_pid", "arg_names": [], "import_names": [], "rhs_call_name": "CmdProcess", "annotation": ""}, "snippet": " self.bag_pid = CmdProcess( request.data )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L131_C8", "label": "run()", "type": "expression", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L116_C4", "vector": [8, 2, 0.5598, 0.0043, 2, 0.49, 0.8, 679, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " self.bag_pid.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Return_L132_C8", "label": "return", "type": "return", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L116_C4", "vector": [13, 2, 0.5641, 0.0043, 2, 0.49, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return int( True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "label": "orient", "type": "function", "loc": [134, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:ClassDef_L53_C0", "vector": [2, 1, 0.6218, 0.1026, 1, 0.33, 0.5, 295, 0, 2, 1, 0, 0, 0, 16], "semantic": {"name": "orient", "arg_names": ["self", "request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def orient( self, request ):\n tagid = request.data\n if not self.data.has_key( tagid ):\n rospy.logout( 'Tag id \\'%s\\' not found during last scan.' % tagid )\n return String_Int32Response( int( False ))\n arr = np.array( self.data[ tagid ]).T\n arr = arr[:,np.argsort( arr[0] )]\n h, bins = np.histogram( arr[0], 36, ( -np.pi, np.pi ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L135_C8", "label": "tagid =", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "vector": [14, 2, 0.5769, 0.0043, 2, 0.41, 0.0, 538, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tagid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tagid = request.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L136_C8", "label": "if", "type": "if", "loc": [136, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "vector": [4, 2, 0.5855, 0.0128, 2, 0.41, 0.0833, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.data.has_key( tagid ):\n rospy.logout( 'Tag id \\'%s\\' not found during last scan.' % tagid )\n return String_Int32Response( int( False ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L137_C12", "label": "logout()", "type": "expression", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L136_C8", "vector": [8, 3, 0.5855, 0.0043, 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( 'Tag id \\'%s\\' not found during last scan.' % tagid )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Return_L138_C12", "label": "return", "type": "return", "loc": [138, 138], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L136_C8", "vector": [13, 3, 0.5897, 0.0043, 3, 0.3, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return String_Int32Response( int( False ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L139_C8", "label": "arr =", "type": "assigned_variable", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "vector": [14, 2, 0.594, 0.0043, 2, 0.41, 0.1667, 395, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arr = np.array( self.data[ tagid ]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L140_C8", "label": "arr =", "type": "assigned_variable", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "vector": [14, 2, 0.5983, 0.0043, 2, 0.41, 0.25, 395, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arr = arr[:,np.argsort( arr[0] )]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L141_C8", "label": "h, bins = histogram()", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "vector": [14, 2, 0.6026, 0.0043, 2, 0.41, 0.3333, 474, 3, 3, 0, 0, 428, 10, 1], "semantic": {"name": "h, bins", "arg_names": [], "import_names": [], "rhs_call_name": "histogram", "annotation": ""}, "snippet": " h, bins = np.histogram( arr[0], 36, ( -np.pi, np.pi ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L142_C8", "label": "ind =", "type": "assigned_variable", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "vector": [14, 2, 0.6068, 0.0043, 2, 0.41, 0.4167, 680, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ind", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ind = np.sum(arr[0][:, np.newaxis] > bins, axis = 1) - 1 # Gives indices for data into bins"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L143_C8", "label": "bin_centers =", "type": "assigned_variable", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "vector": [14, 2, 0.6111, 0.0043, 2, 0.41, 0.5, 545, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "bin_centers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bin_centers = (bins[:-1] + bins[1:]) / 2.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L145_C8", "label": "best_dir =", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "vector": [14, 2, 0.6197, 0.0043, 2, 0.41, 0.5833, 541, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "best_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " best_dir = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L146_C8", "label": "best_rssi =", "type": "assigned_variable", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "vector": [14, 2, 0.6239, 0.0043, 2, 0.41, 0.6667, 643, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "best_rssi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " best_rssi = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L147_C8", "label": "for i", "type": "for", "loc": [147, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "vector": [6, 2, 0.6368, 0.0214, 2, 0.41, 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 np.unique( ind ):\n avg_rssi = np.mean(arr[1,np.argwhere( ind == i )])\n if avg_rssi > best_rssi:\n best_rssi = avg_rssi\n best_dir = bin_centers[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L148_C12", "label": "avg_rssi = mean()", "type": "assigned_variable", "loc": [148, 148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L147_C8", "vector": [14, 3, 0.6325, 0.0043, 3, 0.4, 0.0, 605, 3, 1, 0, 0, 856, 10, 2], "semantic": {"name": "avg_rssi", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " avg_rssi = np.mean(arr[1,np.argwhere( ind == i )])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L149_C12", "label": "if", "type": "if", "loc": [149, 151], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L147_C8", "vector": [4, 3, 0.641, 0.0128, 3, 0.4, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if avg_rssi > best_rssi:\n best_rssi = avg_rssi\n best_dir = bin_centers[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L150_C16", "label": "best_rssi =", "type": "assigned_variable", "loc": [150, 150], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L149_C12", "vector": [14, 4, 0.641, 0.0043, 4, 0.88, 0.0, 643, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "best_rssi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " best_rssi = avg_rssi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L151_C16", "label": "best_dir =", "type": "assigned_variable", "loc": [151, 151], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L149_C12", "vector": [14, 4, 0.6453, 0.0043, 4, 0.88, 1.0, 541, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "best_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " best_dir = bin_centers[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L153_C8", "label": "logout()", "type": "expression", "loc": [153, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "vector": [8, 2, 0.656, 0.0085, 2, 0.41, 0.8333, 525, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'orient_node: Best dir (deg): %2.2f with avg rssi: %2.1f' %\n ( math.degrees(best_dir), best_rssi ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L156_C8", "label": "rotate_backup()", "type": "expression", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "vector": [8, 2, 0.6667, 0.0043, 2, 0.41, 0.9167, 878, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "rotate_backup", "arg_names": [], "import_names": [], "rhs_call_name": "rotate_backup", "annotation": ""}, "snippet": " self.rotate_backup_client.rotate_backup( best_dir, 0.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Return_L157_C8", "label": "return", "type": "return", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "vector": [13, 2, 0.6709, 0.0043, 2, 0.41, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return String_Int32Response( int( True ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L160_C4", "label": "add_tags", "type": "function", "loc": [160, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:ClassDef_L53_C0", "vector": [2, 1, 0.7179, 0.0726, 1, 0.33, 0.75, 806, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "add_tags", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_tags( self, msg ):\n for read in msg.arr:\n if read.rssi == -1:\n return False\n\n self.tag_gt[ read.antenna_name ].header.stamp = rospy.Time(0)\n try:\n pt = self.listener.transformPoint( '/base_link', "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L161_C8", "label": "for read", "type": "for", "loc": [161, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L160_C4", "vector": [6, 2, 0.7179, 0.0641, 2, 0.19, 0.0, 453, 7, 0, 0, 0, 0, 0, 6], "semantic": {"name": "read", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for read in msg.arr:\n if read.rssi == -1:\n return False\n\n self.tag_gt[ read.antenna_name ].header.stamp = rospy.Time(0)\n try:\n pt = self.listener.transformPoint( '/base_link', \n self.tag_gt[ read.antenna_name ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L162_C12", "label": "if", "type": "if", "loc": [162, 163], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L161_C8", "vector": [4, 3, 0.6944, 0.0085, 3, 0.95, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if read.rssi == -1:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Return_L163_C16", "label": "return", "type": "return", "loc": [163, 163], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L162_C12", "vector": [13, 4, 0.6966, 0.0043, 4, 0.25, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L165_C12", "label": "self.tag_gt[read.antenna_name].header.stamp = Time()", "type": "assigned_variable", "loc": [165, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L161_C8", "vector": [14, 3, 0.7051, 0.0043, 3, 0.95, 0.25, 355, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "self.tag_gt[read.antenna_name].header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " self.tag_gt[ read.antenna_name ].header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Try_L166_C12", "label": "try", "type": "try", "loc": [166, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L161_C8", "vector": [7, 3, 0.7201, 0.0256, 3, 0.95, 0.5, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n pt = self.listener.transformPoint( '/base_link', \n self.tag_gt[ read.antenna_name ])\n except:\n rospy.logout( 'orient_node: Transform failed' )\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L167_C16", "label": "pt = transformPoint()", "type": "assigned_variable", "loc": [167, 168], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:Try_L166_C12", "vector": [14, 4, 0.7158, 0.0085, 4, 0.45, 0.0, 989, 3, 2, 0, 0, 987, 10, 1], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "transformPoint", "annotation": ""}, "snippet": " pt = self.listener.transformPoint( '/base_link', \n self.tag_gt[ read.antenna_name ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L170_C16", "label": "logout()", "type": "expression", "loc": [170, 170], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:Try_L166_C12", "vector": [8, 4, 0.7265, 0.0043, 4, 0.45, 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( 'orient_node: Transform failed' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Return_L171_C16", "label": "return", "type": "return", "loc": [171, 171], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:Try_L166_C12", "vector": [13, 4, 0.7308, 0.0043, 4, 0.45, 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_99356:If_L173_C12", "label": "if", "type": "if", "loc": [173, 174], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L161_C8", "vector": [4, 3, 0.7415, 0.0085, 3, 0.95, 0.75, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.data.has_key( read.tagID ):\n self.data[ read.tagID ] = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L174_C16", "label": "assign", "type": "assigned_variable", "loc": [174, 174], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L173_C12", "vector": [14, 4, 0.7436, 0.0043, 4, 0.74, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.data[ read.tagID ] = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L175_C12", "label": "append()", "type": "expression", "loc": [175, 175], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L161_C8", "vector": [8, 3, 0.7479, 0.0043, 3, 0.95, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.data[ read.tagID ].append([ calculate_angle( pt ), 1.0 * read.rssi ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Return_L176_C8", "label": "return", "type": "return", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L160_C4", "vector": [13, 2, 0.7521, 0.0043, 2, 0.19, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "label": "flap_ears", "type": "function", "loc": [178, 227], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:ClassDef_L53_C0", "vector": [2, 1, 0.8654, 0.2137, 1, 0.33, 1.0, 590, 0, 2, 1, 0, 0, 0, 38], "semantic": {"name": "flap_ears", "arg_names": ["self", "request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def flap_ears( self, request ):\n self.data = {}\n tagid = request.data\n if tagid == '':\n rospy.logout( 'orient_node: capture for tagid: \\'\\' requested. Using QueryEnv.' )\n self.r.query_mode( )\n else:\n rospy.logout( 'orient_node: capture for tagid: \\'%s\\' requested' % tagid )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L179_C8", "label": "self.data =", "type": "assigned_variable", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "vector": [14, 2, 0.765, 0.0043, 2, 0.39, 0.0, 838, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.data = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L180_C8", "label": "tagid =", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "vector": [14, 2, 0.7692, 0.0043, 2, 0.39, 0.0714, 538, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tagid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tagid = request.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L181_C8", "label": "if", "type": "if", "loc": [181, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "vector": [4, 2, 0.7842, 0.0256, 2, 0.39, 0.1429, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tagid == '':\n rospy.logout( 'orient_node: capture for tagid: \\'\\' requested. Using QueryEnv.' )\n self.r.query_mode( )\n else:\n rospy.logout( 'orient_node: capture for tagid: \\'%s\\' requested' % tagid )\n self.r.track_mode( tagid )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L182_C12", "label": "logout()", "type": "expression", "loc": [182, 182], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L181_C8", "vector": [8, 3, 0.7778, 0.0043, 3, 0.43, 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( 'orient_node: capture for tagid: \\'\\' requested. Using QueryEnv.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L183_C12", "label": "query_mode()", "type": "expression", "loc": [183, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L181_C8", "vector": [8, 3, 0.7821, 0.0043, 3, 0.43, 0.3333, 130, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "query_mode", "arg_names": [], "import_names": [], "rhs_call_name": "query_mode", "annotation": ""}, "snippet": " self.r.query_mode( )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L185_C12", "label": "logout()", "type": "expression", "loc": [185, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L181_C8", "vector": [8, 3, 0.7906, 0.0043, 3, 0.43, 0.6667, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'orient_node: capture for tagid: \\'%s\\' requested' % tagid )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L186_C12", "label": "track_mode()", "type": "expression", "loc": [186, 186], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L181_C8", "vector": [8, 3, 0.7949, 0.0043, 3, 0.43, 1.0, 884, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "track_mode", "arg_names": [], "import_names": [], "rhs_call_name": "track_mode", "annotation": ""}, "snippet": " self.r.track_mode( tagid )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L188_C8", "label": "forward =", "type": "assigned_variable", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "vector": [14, 2, 0.8034, 0.0043, 2, 0.39, 0.2143, 194, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "forward", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " forward = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L189_C8", "label": "tilt_angs =", "type": "assigned_variable", "loc": [189, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "vector": [14, 2, 0.8098, 0.0085, 2, 0.39, 0.2857, 405, 0, 0, 0, 0, 0, 5, 2], "semantic": {"name": "tilt_angs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tilt_angs = [ math.radians( 0.0 ),\n math.radians( 0.0 ) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L192_C8", "label": "for ta", "type": "for", "loc": [192, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "vector": [6, 2, 0.859, 0.0812, 2, 0.39, 0.3571, 280, 2, 0, 0, 0, 0, 0, 18], "semantic": {"name": "ta", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for ta in tilt_angs:\n # Tilt\n self.t_left.move_angle( ta, math.radians( 30.0 ), blocking = False )\n self.t_right.move_angle( -1.0 * ta, math.radians( 30.0 ), blocking = False )\n while self.t_left.is_moving() or self.t_right.is_moving():\n time.sleep(0.01)\n\n # Pan"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L194_C12", "label": "move_angle()", "type": "expression", "loc": [194, 194], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L192_C8", "vector": [8, 3, 0.8291, 0.0043, 3, 0.59, 0.0, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.t_left.move_angle( ta, math.radians( 30.0 ), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L195_C12", "label": "move_angle()", "type": "expression", "loc": [195, 195], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L192_C8", "vector": [8, 3, 0.8333, 0.0043, 3, 0.59, 0.25, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.t_right.move_angle( -1.0 * ta, math.radians( 30.0 ), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:While_L196_C12", "label": "while", "type": "while", "loc": [196, 197], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L192_C8", "vector": [5, 3, 0.8397, 0.0085, 3, 0.59, 0.5, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.t_left.is_moving() or self.t_right.is_moving():\n time.sleep(0.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L197_C16", "label": "sleep()", "type": "expression", "loc": [197, 197], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:While_L196_C12", "vector": [8, 4, 0.8419, 0.0043, 4, 0.83, 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.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L200_C12", "label": "if", "type": "if", "loc": [200, 207], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L192_C8", "vector": [4, 3, 0.8697, 0.0342, 3, 0.59, 0.75, 0, 2, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if forward:\n self.p_left.move_angle( self.EX_1, math.radians( PAN_RATE ), blocking = False )\n self.p_right.move_angle( -1.0 * self.EX_1, math.radians( PAN_RATE ), blocking = True )\n forward = False\n else:\n self.p_left.move_angle( -1.0 * self.EX_2, math.radians( PAN_RATE ), blocking = False )\n self.p_right.move_angle( self.EX_2, math.radians( PAN_RATE ), blocking = True )\n forward = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L201_C16", "label": "move_angle()", "type": "expression", "loc": [201, 201], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L200_C12", "vector": [8, 4, 0.859, 0.0043, 4, 0.26, 0.0, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.p_left.move_angle( self.EX_1, math.radians( PAN_RATE ), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L202_C16", "label": "move_angle()", "type": "expression", "loc": [202, 202], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L200_C12", "vector": [8, 4, 0.8632, 0.0043, 4, 0.26, 0.2, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.p_right.move_angle( -1.0 * self.EX_1, math.radians( PAN_RATE ), blocking = True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L203_C16", "label": "forward =", "type": "assigned_variable", "loc": [203, 203], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L200_C12", "vector": [14, 4, 0.8675, 0.0043, 4, 0.26, 0.4, 194, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "forward", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " forward = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L205_C16", "label": "move_angle()", "type": "expression", "loc": [205, 205], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L200_C12", "vector": [8, 4, 0.8761, 0.0043, 4, 0.26, 0.6, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.p_left.move_angle( -1.0 * self.EX_2, math.radians( PAN_RATE ), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L206_C16", "label": "move_angle()", "type": "expression", "loc": [206, 206], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L200_C12", "vector": [8, 4, 0.8803, 0.0043, 4, 0.26, 0.8, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.p_right.move_angle( self.EX_2, math.radians( PAN_RATE ), blocking = True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L207_C16", "label": "forward =", "type": "assigned_variable", "loc": [207, 207], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L200_C12", "vector": [14, 4, 0.8846, 0.0043, 4, 0.26, 1.0, 194, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "forward", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " forward = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:While_L209_C12", "label": "while", "type": "while", "loc": [209, 210], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L192_C8", "vector": [5, 3, 0.8953, 0.0085, 3, 0.59, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.p_left.is_moving() or self.p_right.is_moving():\n time.sleep(0.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L210_C16", "label": "sleep()", "type": "expression", "loc": [210, 210], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:While_L209_C12", "vector": [8, 4, 0.8974, 0.0043, 4, 0.38, 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.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L212_C8", "label": "sleep()", "type": "expression", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "vector": [8, 2, 0.906, 0.0043, 2, 0.39, 0.4286, 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_99356:Expr_L214_C8", "label": "stop()", "type": "expression", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "vector": [8, 2, 0.9145, 0.0043, 2, 0.39, 0.5, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " self.r.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L215_C8", "label": "print()", "type": "expression", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "vector": [8, 2, 0.9188, 0.0043, 2, 0.39, 0.5714, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(self.data.keys())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L218_C8", "label": "move_angle()", "type": "expression", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "vector": [8, 2, 0.9316, 0.0043, 2, 0.39, 0.6429, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.p_left.move_angle( self.EX_1, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L219_C8", "label": "move_angle()", "type": "expression", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "vector": [8, 2, 0.9359, 0.0043, 2, 0.39, 0.7143, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.t_left.move_angle( 0.0, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L221_C8", "label": "move_angle()", "type": "expression", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "vector": [8, 2, 0.9444, 0.0043, 2, 0.39, 0.7857, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.p_right.move_angle( -1.0 * self.EX_1, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L222_C8", "label": "move_angle()", "type": "expression", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "vector": [8, 2, 0.9487, 0.0043, 2, 0.39, 0.8571, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.t_right.move_angle( 0.0, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L224_C8", "label": "logout()", "type": "expression", "loc": [224, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "vector": [8, 2, 0.9573, 0.0043, 2, 0.39, 0.9286, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'orient_node: capture completed' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Return_L227_C8", "label": "return", "type": "return", "loc": [227, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "vector": [13, 2, 0.9701, 0.0043, 2, 0.39, 1.0, 0, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [self.data.keys()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L232_C0", "label": "if", "type": "if", "loc": [232, 234], "level": 0, "parent": null, "vector": [4, 0, 0.9957, 0.0128, 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 on = OrientNode()\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L233_C4", "label": "on = OrientNode()", "type": "assigned_variable", "loc": [233, 233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L232_C0", "vector": [14, 1, 0.9957, 0.0043, 1, 0.71, 0.0, 876, 3, 0, 0, 0, 913, 10, 1], "semantic": {"name": "on", "arg_names": [], "import_names": [], "rhs_call_name": "OrientNode", "annotation": ""}, "snippet": " on = OrientNode()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L234_C4", "label": "spin()", "type": "expression", "loc": [234, 234], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L232_C0", "vector": [8, 1, 1.0, 0.0043, 1, 0.71, 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_99356:FunctionDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Return_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Return_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Return_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:ClassDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:While_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:While_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L97_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:ClassDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L120_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L120_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L121_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L120_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L123_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L120_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L124_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L120_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L125_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Return_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Return_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:ClassDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Return_L138_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L147_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L148_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L147_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L149_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L149_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L150_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L149_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L151_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Return_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:ClassDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L160_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L162_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L162_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Return_L163_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L165_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Try_L166_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:Try_L166_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L167_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:Try_L166_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L170_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:Try_L166_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Return_L171_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L173_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L173_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L174_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L175_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L160_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Return_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:ClassDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L181_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L182_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L181_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L183_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L181_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L185_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L181_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L186_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L192_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L194_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L192_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L195_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L192_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:While_L196_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:While_L196_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L197_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L192_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L200_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L200_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L201_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L200_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L202_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L200_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L203_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L200_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L205_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L200_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L206_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L200_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L207_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:For_L192_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:While_L209_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:While_L209_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L210_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L224_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Return_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Assign_L233_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99356:If_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99356:Expr_L234_C4"}]
#! /usr/bin/python import time import roslib roslib.load_manifest('rospy') roslib.load_manifest('actionlib') roslib.load_manifest( 'move_base_msgs' ) roslib.load_manifest('tf') roslib.load_manifest('std_srvs') roslib.load_manifest('geometry_msgs') roslib.load_manifest('std_msgs') roslib.load_manifest('hrl_rfid') roslib.load_manifest('robotis') roslib.load_manifest('rfid_people_following') import rospy import tf import tf.transformations as tft import actionlib from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal from geometry_msgs.msg import Twist from geometry_msgs.msg import PointStamped from geometry_msgs.msg import Point from geometry_msgs.msg import PoseStamped from geometry_msgs.msg import Quaternion from geometry_msgs.msg import PoseWithCovarianceStamped from std_msgs.msg import Float64 from std_srvs.srv import Empty from rfid_people_following.srv import * import numpy as np, math import os import time import pickle as pkl from threading import Thread from collections import deque class BasePose( Thread ): def __init__( self ): self.should_run = True Thread.__init__( self ) self.listener = tf.TransformListener() self.listener.waitForTransform('/base_link', '/map', rospy.Time(0), timeout = rospy.Duration(100) ) self.ps = PointStamped() self.ps.header.frame_id = '/base_link' self.pts = [] self.start() def run( self ): rate = rospy.Rate( 5 ) while self.should_run and not rospy.is_shutdown(): try: self.ps.header.stamp = rospy.Time(0) ps_map = self.listener.transformPoint( '/odom_combined', self.ps ) x = ps_map.point.x y = ps_map.point.y self.pts.append([ x, y ]) except: rospy.logout( 'base_pose: Failed transform.' ) pass rate.sleep() def stop(self): self.should_run = False self.join(3) if (self.isAlive()): raise RuntimeError("ServoMode: unable to stop thread") # sm = ServoMode( self.follow1 ) class ServoMode( Thread ): def __init__( self, func ): self.done = False self.should_run = True Thread.__init__( self ) self.func = func self.start() def run( self ): self.func() self.done = True while self.should_run and not rospy.is_shutdown(): rospy.sleep(0.1) def stop(self): self.should_run = False self.join(3) if (self.isAlive()): raise RuntimeError("ServoMode: unable to stop thread") class SimCapture(): def __init__( self ): try: rospy.init_node( 'sim_capture' ) except: pass rospy.logout( 'sim_capture: Initializing' ) self.listener = tf.TransformListener() self.listener.waitForTransform('/base_link', '/map', rospy.Time(0), timeout = rospy.Duration(100) ) rospy.logout( 'sim_capture: Waiting for services' ) self._sh = rospy.Service( '/sim_capture/capture' , FloatFloatFloatFloat_Int32, self.capture ) rospy.wait_for_service( '/rfid_servo/servo' ) rospy.wait_for_service( '/rfid_servo/abort' ) rospy.wait_for_service( '/rotate_backup/navstack' ) self._servo = rospy.ServiceProxy( '/rfid_servo/servo', StringInt32_Int32 ) self.follow1 = lambda : self._servo( 'person ', 1 ) # Stops at first obs self._abort = rospy.ServiceProxy( '/rfid_servo/abort', Empty ) self.abort = lambda : self._abort( ) # Kill current servoing self._navstack = rospy.ServiceProxy( '/rotate_backup/navstack' , FloatFloatFloatFloat_Int32 ) self.navstack = lambda x,y,z,theta: self._navstack( x,y,z,theta ) rospy.logout( 'sim_capture: Services ready' ) def capture( self, request, fname = None ): rospy.logout( 'sim_capture: New capture initiated @ %3.2f.' % rospy.Time.now().to_sec() ) rospy.logout( 'sim_capture: Moving to <%3.2f, %3.2f, %3.2f> %3.2f-deg' % ( request.x, request.y, request.z, math.degrees( request.ang ))) self.navstack( request.x, request.y, request.z, request.ang ) rospy.logout( 'sim_capture: Arrived at location.' ) rospy.logout( 'sim_capture: Initializing recorder and servoing.' ) ps = PointStamped() ps.header.frame_id = '/base_link' ps2 = PointStamped() ps2.header.frame_id = '/base_link' ps2.point.x = 0.1 # Begin Servoing. Warning: Hack! sm = ServoMode( self.follow1 ) #bp = BasePose( ) pts = [] t0 = rospy.Time.now().to_sec() while sm.done == False: if rospy.Time.now().to_sec() - t0 > 180: rospy.logout( 'sim_capture: Time up. Aborting.' ) self.abort() try: ps.header.stamp = rospy.Time(0) ps_map = self.listener.transformPoint( '/map', ps ) x = ps_map.point.x y = ps_map.point.y ps2.header.stamp = rospy.Time(0) ps2_map = self.listener.transformPoint( '/map', ps2 ) pts.append([ x, y, ps2_map.point.x, ps2_map.point.y ]) inside = x > -0.5 and x < 10.5 and y > -0.5 and y < 6.5 if not inside: self.abort() except: rospy.logout( 'sim_capture: Failed transform.' ) pass rospy.sleep( 0.2 ) rospy.logout( 'sim_capture: Done servoing.' ) #pts = list( bp.pts ) sm.stop() #bp.stop() # Stop recorder and shuttle to disk. if fname: f = open( fname, 'w' ) else: f = open( 'trajectory_caps/' + str(int(time.time())) + '_cap.pkl', 'w' ) pkl.dump( pts, f ) f.close() rospy.logout( 'sim_capture: Capture complete' ) return int( True ) if __name__ == '__main__': sc = SimCapture() rospy.spin()
ajibawa-2023/Python-Code-Large/train/row_99357
135
201
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Import_L2_C0", "label": "time import time", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.01, 0.005, 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_99357:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0149, 0.005, 0, 0.66, 0.0286, 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_99357:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0199, 0.005, 0, 0.66, 0.0571, 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_99357:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0249, 0.005, 0, 0.66, 0.0857, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('actionlib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0299, 0.005, 0, 0.66, 0.1143, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'move_base_msgs' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0348, 0.005, 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": "roslib.load_manifest('tf')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0398, 0.005, 0, 0.66, 0.1714, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('std_srvs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L9_C0", "label": "load_manifest()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0448, 0.005, 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_99357:Expr_L10_C0", "label": "load_manifest()", "type": "expression", "loc": [10, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0498, 0.005, 0, 0.66, 0.2286, 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_99357:Expr_L11_C0", "label": "load_manifest()", "type": "expression", "loc": [11, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0547, 0.005, 0, 0.66, 0.2571, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('hrl_rfid')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L12_C0", "label": "load_manifest()", "type": "expression", "loc": [12, 12], "level": 0, "parent": null, "vector": [8, 0, 0.0597, 0.005, 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": "roslib.load_manifest('robotis')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L13_C0", "label": "load_manifest()", "type": "expression", "loc": [13, 13], "level": 0, "parent": null, "vector": [8, 0, 0.0647, 0.005, 0, 0.66, 0.3143, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('rfid_people_following')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Import_L14_C0", "label": "rospy import rospy", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0697, 0.005, 0, 0.66, 0.3429, 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_99357:Import_L16_C0", "label": "tf import tf", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0796, 0.005, 0, 0.66, 0.3714, 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_99357:Import_L17_C0", "label": "tf.transformations import tft", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0846, 0.005, 0, 0.66, 0.4, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tft"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tft"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Import_L18_C0", "label": "actionlib import actionlib", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0896, 0.005, 0, 0.66, 0.4286, 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_99357:ImportFrom_L19_C0", "label": "from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0945, 0.005, 0, 0.66, 0.4571, 440, 0, 2, 0, 0, 440, 0, 0], "semantic": {"name": "move_base_msgs.msg", "arg_names": [], "import_names": ["MoveBaseAction", "MoveBaseGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:ImportFrom_L20_C0", "label": "from geometry_msgs.msg import Twist", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0995, 0.005, 0, 0.66, 0.4857, 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_99357:ImportFrom_L21_C0", "label": "from geometry_msgs.msg import PointStamped", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.1045, 0.005, 0, 0.66, 0.5143, 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_99357:ImportFrom_L22_C0", "label": "from geometry_msgs.msg import Point", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.1095, 0.005, 0, 0.66, 0.5429, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Point"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:ImportFrom_L23_C0", "label": "from geometry_msgs.msg import PoseStamped", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.1144, 0.005, 0, 0.66, 0.5714, 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_99357:ImportFrom_L24_C0", "label": "from geometry_msgs.msg import Quaternion", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.1194, 0.005, 0, 0.66, 0.6, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Quaternion"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Quaternion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:ImportFrom_L25_C0", "label": "from geometry_msgs.msg import PoseWithCovarianceStamped", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.1244, 0.005, 0, 0.66, 0.6286, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["PoseWithCovarianceStamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import PoseWithCovarianceStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:ImportFrom_L26_C0", "label": "from std_msgs.msg import Float64", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.1294, 0.005, 0, 0.66, 0.6571, 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_99357:ImportFrom_L27_C0", "label": "from std_srvs.srv import Empty", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.1343, 0.005, 0, 0.66, 0.6857, 261, 0, 1, 0, 0, 261, 0, 0], "semantic": {"name": "std_srvs.srv", "arg_names": [], "import_names": ["Empty"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_srvs.srv import Empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:ImportFrom_L29_C0", "label": "from rfid_people_following.srv import *", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.1443, 0.005, 0, 0.66, 0.7143, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Import_L31_C0", "label": "numpy import np, math", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.1542, 0.005, 0, 0.66, 0.7429, 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_99357:Import_L32_C0", "label": "os import os", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.1592, 0.005, 0, 0.66, 0.7714, 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_99357:Import_L33_C0", "label": "time import time", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.1642, 0.005, 0, 0.66, 0.8, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Import_L34_C0", "label": "pickle import pkl", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.1692, 0.005, 0, 0.66, 0.8286, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "pickle", "arg_names": [], "import_names": ["pkl"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pickle as pkl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:ImportFrom_L35_C0", "label": "from threading import Thread", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.1741, 0.005, 0, 0.66, 0.8571, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["Thread"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import Thread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:ImportFrom_L36_C0", "label": "from collections import deque", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.1791, 0.005, 0, 0.66, 0.8857, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "collections", "arg_names": [], "import_names": ["deque"], "rhs_call_name": "", "annotation": ""}, "snippet": "from collections import deque"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:ClassDef_L39_C0", "label": "BasePose", "type": "class", "loc": [39, 73], "level": 0, "parent": null, "vector": [3, 0, 0.2786, 0.1741, 0, 0.66, 0.9143, 540, 0, 3, 0, 0, 134, 0, 17], "semantic": {"name": "BasePose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class BasePose( Thread ):\n def __init__( self ):\n self.should_run = True\n Thread.__init__( self )\n\n self.listener = tf.TransformListener()\n self.listener.waitForTransform('/base_link', '/map',\n rospy.Time(0), timeout = rospy.Duration(100) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L40_C4", "label": "__init__", "type": "function", "loc": [40, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:ClassDef_L39_C0", "vector": [2, 1, 0.2239, 0.0547, 1, 0.42, 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 self.should_run = True\n Thread.__init__( self )\n\n self.listener = tf.TransformListener()\n self.listener.waitForTransform('/base_link', '/map',\n rospy.Time(0), timeout = rospy.Duration(100) )\n self.ps = PointStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L41_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L40_C4", "vector": [14, 2, 0.204, 0.005, 2, 0.16, 0.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L42_C8", "label": "__init__()", "type": "expression", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L40_C4", "vector": [8, 2, 0.209, 0.005, 2, 0.16, 0.1429, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Thread.__init__( self )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L44_C8", "label": "self.listener = TransformListener()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L40_C4", "vector": [14, 2, 0.2189, 0.005, 2, 0.16, 0.2857, 686, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.listener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L45_C8", "label": "waitForTransform()", "type": "expression", "loc": [45, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L40_C4", "vector": [8, 2, 0.2264, 0.01, 2, 0.16, 0.4286, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.listener.waitForTransform('/base_link', '/map',\n rospy.Time(0), timeout = rospy.Duration(100) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L47_C8", "label": "self.ps = PointStamped()", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L40_C4", "vector": [14, 2, 0.2338, 0.005, 2, 0.16, 0.5714, 780, 3, 0, 0, 0, 969, 10, 1], "semantic": {"name": "self.ps", "arg_names": [], "import_names": [], "rhs_call_name": "PointStamped", "annotation": ""}, "snippet": " self.ps = PointStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L48_C8", "label": "self.ps.header.frame_id =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L40_C4", "vector": [14, 2, 0.2388, 0.005, 2, 0.16, 0.7143, 206, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.ps.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ps.header.frame_id = '/base_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L49_C8", "label": "self.pts =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L40_C4", "vector": [14, 2, 0.2438, 0.005, 2, 0.16, 0.8571, 137, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pts = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L50_C8", "label": "start()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L40_C4", "vector": [8, 2, 0.2488, 0.005, 2, 0.16, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L52_C4", "label": "run", "type": "function", "loc": [52, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:ClassDef_L39_C0", "vector": [2, 1, 0.2935, 0.0746, 1, 0.42, 0.5, 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 rate = rospy.Rate( 5 )\n while self.should_run and not rospy.is_shutdown():\n try:\n self.ps.header.stamp = rospy.Time(0)\n ps_map = self.listener.transformPoint( '/odom_combined', self.ps )\n x = ps_map.point.x\n y = ps_map.point.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L53_C8", "label": "rate = Rate()", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L52_C4", "vector": [14, 2, 0.2637, 0.005, 2, 0.27, 0.0, 477, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "rate", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " rate = rospy.Rate( 5 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:While_L54_C8", "label": "while", "type": "while", "loc": [54, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L52_C4", "vector": [5, 2, 0.2985, 0.0647, 2, 0.27, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.should_run and not rospy.is_shutdown():\n try:\n self.ps.header.stamp = rospy.Time(0)\n ps_map = self.listener.transformPoint( '/odom_combined', self.ps )\n x = ps_map.point.x\n y = ps_map.point.y\n self.pts.append([ x, y ])\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L55_C12", "label": "try", "type": "try", "loc": [55, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:While_L54_C8", "vector": [7, 3, 0.2985, 0.0547, 3, 0.38, 0.0, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self.ps.header.stamp = rospy.Time(0)\n ps_map = self.listener.transformPoint( '/odom_combined', self.ps )\n x = ps_map.point.x\n y = ps_map.point.y\n self.pts.append([ x, y ])\n\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L56_C16", "label": "self.ps.header.stamp = Time()", "type": "assigned_variable", "loc": [56, 56], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L55_C12", "vector": [14, 4, 0.2786, 0.005, 4, 0.38, 0.0, 297, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "self.ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " self.ps.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L57_C16", "label": "ps_map = transformPoint()", "type": "assigned_variable", "loc": [57, 57], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L55_C12", "vector": [14, 4, 0.2836, 0.005, 4, 0.38, 0.25, 938, 3, 2, 0, 0, 987, 10, 1], "semantic": {"name": "ps_map", "arg_names": [], "import_names": [], "rhs_call_name": "transformPoint", "annotation": ""}, "snippet": " ps_map = self.listener.transformPoint( '/odom_combined', self.ps )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L58_C16", "label": "x =", "type": "assigned_variable", "loc": [58, 58], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L55_C12", "vector": [14, 4, 0.2886, 0.005, 4, 0.38, 0.5, 190, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = ps_map.point.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L59_C16", "label": "y =", "type": "assigned_variable", "loc": [59, 59], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L55_C12", "vector": [14, 4, 0.2935, 0.005, 4, 0.38, 0.75, 304, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = ps_map.point.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L60_C16", "label": "append()", "type": "expression", "loc": [60, 60], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L55_C12", "vector": [8, 4, 0.2985, 0.005, 4, 0.38, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.pts.append([ x, y ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L64_C16", "label": "logout()", "type": "expression", "loc": [64, 64], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L55_C12", "vector": [8, 4, 0.3184, 0.005, 4, 0.38, 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( 'base_pose: Failed transform.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L66_C12", "label": "sleep()", "type": "expression", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:While_L54_C8", "vector": [8, 3, 0.3284, 0.005, 3, 0.38, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L69_C4", "label": "stop", "type": "function", "loc": [69, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:ClassDef_L39_C0", "vector": [2, 1, 0.3532, 0.0249, 1, 0.42, 1.0, 343, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "stop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop(self):\n self.should_run = False\n self.join(3)\n if (self.isAlive()):\n raise RuntimeError(\"ServoMode: unable to stop thread\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L70_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L69_C4", "vector": [14, 2, 0.3483, 0.005, 2, 0.34, 0.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L71_C8", "label": "join()", "type": "expression", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L69_C4", "vector": [8, 2, 0.3532, 0.005, 2, 0.34, 0.5, 933, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.join(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L72_C8", "label": "if", "type": "if", "loc": [72, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L69_C4", "vector": [4, 2, 0.3607, 0.01, 2, 0.34, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.isAlive()):\n raise RuntimeError(\"ServoMode: unable to stop thread\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:ClassDef_L79_C0", "label": "ServoMode", "type": "class", "loc": [79, 97], "level": 0, "parent": null, "vector": [3, 0, 0.4378, 0.0945, 0, 0.66, 0.9429, 602, 0, 3, 0, 0, 134, 0, 8], "semantic": {"name": "ServoMode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ServoMode( Thread ):\n def __init__( self, func ):\n self.done = False\n self.should_run = True\n Thread.__init__( self )\n self.func = func\n self.start()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L80_C4", "label": "__init__", "type": "function", "loc": [80, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:ClassDef_L79_C0", "vector": [2, 1, 0.4104, 0.0299, 1, 0.01, 0.0, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, func ):\n self.done = False\n self.should_run = True\n Thread.__init__( self )\n self.func = func\n self.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L81_C8", "label": "self.done =", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L80_C4", "vector": [14, 2, 0.403, 0.005, 2, 0.77, 0.0, 904, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.done", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.done = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L82_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L80_C4", "vector": [14, 2, 0.408, 0.005, 2, 0.77, 0.25, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L83_C8", "label": "__init__()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L80_C4", "vector": [8, 2, 0.4129, 0.005, 2, 0.77, 0.5, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Thread.__init__( self )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L84_C8", "label": "self.func =", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L80_C4", "vector": [14, 2, 0.4179, 0.005, 2, 0.77, 0.75, 558, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.func", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.func = func"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L85_C8", "label": "start()", "type": "expression", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L80_C4", "vector": [8, 2, 0.4229, 0.005, 2, 0.77, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L87_C4", "label": "run", "type": "function", "loc": [87, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:ClassDef_L79_C0", "vector": [2, 1, 0.4428, 0.0249, 1, 0.01, 0.5, 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 self.func()\n self.done = True\n while self.should_run and not rospy.is_shutdown():\n rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L88_C8", "label": "func()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L87_C4", "vector": [8, 2, 0.4378, 0.005, 2, 0.11, 0.0, 856, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "func", "arg_names": [], "import_names": [], "rhs_call_name": "func", "annotation": ""}, "snippet": " self.func()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L89_C8", "label": "self.done =", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L87_C4", "vector": [14, 2, 0.4428, 0.005, 2, 0.11, 0.5, 904, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.done", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.done = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:While_L90_C8", "label": "while", "type": "while", "loc": [90, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L87_C4", "vector": [5, 2, 0.4502, 0.01, 2, 0.11, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.should_run and not rospy.is_shutdown():\n rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L91_C12", "label": "sleep()", "type": "expression", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:While_L90_C8", "vector": [8, 3, 0.4527, 0.005, 3, 0.48, 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_99357:FunctionDef_L93_C4", "label": "stop", "type": "function", "loc": [93, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:ClassDef_L79_C0", "vector": [2, 1, 0.4726, 0.0249, 1, 0.01, 1.0, 343, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "stop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop(self):\n self.should_run = False\n self.join(3)\n if (self.isAlive()):\n raise RuntimeError(\"ServoMode: unable to stop thread\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L94_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L93_C4", "vector": [14, 2, 0.4677, 0.005, 2, 0.65, 0.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L95_C8", "label": "join()", "type": "expression", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L93_C4", "vector": [8, 2, 0.4726, 0.005, 2, 0.65, 0.5, 933, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.join(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L96_C8", "label": "if", "type": "if", "loc": [96, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L93_C4", "vector": [4, 2, 0.4801, 0.01, 2, 0.65, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.isAlive()):\n raise RuntimeError(\"ServoMode: unable to stop thread\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:ClassDef_L100_C0", "label": "SimCapture", "type": "class", "loc": [100, 194], "level": 0, "parent": null, "vector": [3, 0, 0.7313, 0.4726, 0, 0.66, 0.9714, 216, 0, 2, 0, 0, 0, 0, 54], "semantic": {"name": "SimCapture", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SimCapture():\n def __init__( self ):\n try:\n rospy.init_node( 'sim_capture' )\n except:\n pass\n\n rospy.logout( 'sim_capture: Initializing' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "label": "__init__", "type": "function", "loc": [101, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:ClassDef_L100_C0", "vector": [2, 1, 0.5697, 0.1393, 1, 0.35, 0.0, 555, 0, 1, 0, 0, 0, 0, 18], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self ):\n try:\n rospy.init_node( 'sim_capture' )\n except:\n pass\n\n rospy.logout( 'sim_capture: Initializing' )\n self.listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L102_C8", "label": "try", "type": "try", "loc": [102, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "vector": [7, 2, 0.5149, 0.0199, 2, 0.79, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node( 'sim_capture' )\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L103_C12", "label": "init_node()", "type": "expression", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L102_C8", "vector": [8, 3, 0.5124, 0.005, 3, 0.28, 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( 'sim_capture' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L107_C8", "label": "logout()", "type": "expression", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "vector": [8, 2, 0.5323, 0.005, 2, 0.79, 0.0667, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'sim_capture: Initializing' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L108_C8", "label": "self.listener = TransformListener()", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "vector": [14, 2, 0.5373, 0.005, 2, 0.79, 0.1333, 686, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.listener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L109_C8", "label": "waitForTransform()", "type": "expression", "loc": [109, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "vector": [8, 2, 0.5448, 0.01, 2, 0.79, 0.2, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.listener.waitForTransform('/base_link', '/map',\n rospy.Time(0), timeout = rospy.Duration(100) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L112_C8", "label": "logout()", "type": "expression", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "vector": [8, 2, 0.5572, 0.005, 2, 0.79, 0.2667, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'sim_capture: Waiting for services' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L113_C8", "label": "self._sh = Service()", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "vector": [14, 2, 0.5622, 0.005, 2, 0.79, 0.3333, 573, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self._sh", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self._sh = rospy.Service( '/sim_capture/capture' , FloatFloatFloatFloat_Int32, self.capture )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L114_C8", "label": "wait_for_service()", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "vector": [8, 2, 0.5672, 0.005, 2, 0.79, 0.4, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service( '/rfid_servo/servo' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L115_C8", "label": "wait_for_service()", "type": "expression", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "vector": [8, 2, 0.5721, 0.005, 2, 0.79, 0.4667, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service( '/rfid_servo/abort' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L116_C8", "label": "wait_for_service()", "type": "expression", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "vector": [8, 2, 0.5771, 0.005, 2, 0.79, 0.5333, 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( '/rotate_backup/navstack' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L118_C8", "label": "self._servo = ServiceProxy()", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "vector": [14, 2, 0.5871, 0.005, 2, 0.79, 0.6, 631, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._servo", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._servo = rospy.ServiceProxy( '/rfid_servo/servo', StringInt32_Int32 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L119_C8", "label": "self.follow1 =", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "vector": [14, 2, 0.592, 0.005, 2, 0.79, 0.6667, 595, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.follow1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.follow1 = lambda : self._servo( 'person ', 1 ) # Stops at first obs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L121_C8", "label": "self._abort = ServiceProxy()", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "vector": [14, 2, 0.602, 0.005, 2, 0.79, 0.7333, 688, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._abort", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._abort = rospy.ServiceProxy( '/rfid_servo/abort', Empty )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L122_C8", "label": "self.abort =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "vector": [14, 2, 0.607, 0.005, 2, 0.79, 0.8, 665, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.abort", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.abort = lambda : self._abort( ) # Kill current servoing"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L124_C8", "label": "self._navstack = ServiceProxy()", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "vector": [14, 2, 0.6169, 0.005, 2, 0.79, 0.8667, 868, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._navstack", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._navstack = rospy.ServiceProxy( '/rotate_backup/navstack' , FloatFloatFloatFloat_Int32 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L125_C8", "label": "self.navstack =", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "vector": [14, 2, 0.6219, 0.005, 2, 0.79, 0.9333, 439, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.navstack", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.navstack = lambda x,y,z,theta: self._navstack( x,y,z,theta )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L128_C8", "label": "logout()", "type": "expression", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "vector": [8, 2, 0.6368, 0.005, 2, 0.79, 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( 'sim_capture: Services ready' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "label": "capture", "type": "function", "loc": [130, 194], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:ClassDef_L100_C0", "vector": [2, 1, 0.806, 0.3234, 1, 0.35, 1.0, 547, 0, 3, 1, 0, 0, 0, 36], "semantic": {"name": "capture", "arg_names": ["self", "request", "fname"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def capture( self, request, fname = None ):\n rospy.logout( 'sim_capture: New capture initiated @ %3.2f.' % rospy.Time.now().to_sec() )\n rospy.logout( 'sim_capture: Moving to <%3.2f, %3.2f, %3.2f> %3.2f-deg' % ( request.x,\n request.y,\n request.z,\n math.degrees( request.ang )))\n self.navstack( request.x, request.y, request.z, request.ang )\n rospy.logout( 'sim_capture: Arrived at location.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L131_C8", "label": "logout()", "type": "expression", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "vector": [8, 2, 0.6517, 0.005, 2, 0.41, 0.0, 525, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'sim_capture: New capture initiated @ %3.2f.' % rospy.Time.now().to_sec() )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L132_C8", "label": "logout()", "type": "expression", "loc": [132, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "vector": [8, 2, 0.6642, 0.0199, 2, 0.41, 0.05, 525, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'sim_capture: Moving to <%3.2f, %3.2f, %3.2f> %3.2f-deg' % ( request.x,\n request.y,\n request.z,\n math.degrees( request.ang )))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L136_C8", "label": "navstack()", "type": "expression", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "vector": [8, 2, 0.6766, 0.005, 2, 0.41, 0.1, 791, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "navstack", "arg_names": [], "import_names": [], "rhs_call_name": "navstack", "annotation": ""}, "snippet": " self.navstack( request.x, request.y, request.z, request.ang )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L137_C8", "label": "logout()", "type": "expression", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "vector": [8, 2, 0.6816, 0.005, 2, 0.41, 0.15, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'sim_capture: Arrived at location.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L138_C8", "label": "logout()", "type": "expression", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "vector": [8, 2, 0.6866, 0.005, 2, 0.41, 0.2, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'sim_capture: Initializing recorder and servoing.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L141_C8", "label": "ps = PointStamped()", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "vector": [14, 2, 0.7015, 0.005, 2, 0.41, 0.25, 232, 3, 0, 0, 0, 969, 10, 1], "semantic": {"name": "ps", "arg_names": [], "import_names": [], "rhs_call_name": "PointStamped", "annotation": ""}, "snippet": " ps = PointStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L142_C8", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "vector": [14, 2, 0.7065, 0.005, 2, 0.41, 0.3, 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_99357:Assign_L144_C8", "label": "ps2 = PointStamped()", "type": "assigned_variable", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "vector": [14, 2, 0.7164, 0.005, 2, 0.41, 0.35, 298, 3, 0, 0, 0, 969, 10, 1], "semantic": {"name": "ps2", "arg_names": [], "import_names": [], "rhs_call_name": "PointStamped", "annotation": ""}, "snippet": " ps2 = PointStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L145_C8", "label": "ps2.header.frame_id =", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "vector": [14, 2, 0.7214, 0.005, 2, 0.41, 0.4, 869, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ps2.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps2.header.frame_id = '/base_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L146_C8", "label": "ps2.point.x =", "type": "assigned_variable", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "vector": [14, 2, 0.7264, 0.005, 2, 0.41, 0.45, 634, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "ps2.point.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps2.point.x = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L149_C8", "label": "sm = ServoMode()", "type": "assigned_variable", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "vector": [14, 2, 0.7413, 0.005, 2, 0.41, 0.5, 21, 3, 1, 0, 0, 602, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "ServoMode", "annotation": ""}, "snippet": " sm = ServoMode( self.follow1 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L151_C8", "label": "pts =", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "vector": [14, 2, 0.7512, 0.005, 2, 0.41, 0.55, 195, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L153_C8", "label": "t0 = to_sec()", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "vector": [14, 2, 0.7612, 0.005, 2, 0.41, 0.6, 573, 3, 0, 0, 0, 750, 10, 2], "semantic": {"name": "t0", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " t0 = rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:While_L154_C8", "label": "while", "type": "while", "loc": [154, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "vector": [5, 2, 0.8259, 0.1244, 2, 0.41, 0.65, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while sm.done == False:\n if rospy.Time.now().to_sec() - t0 > 180:\n rospy.logout( 'sim_capture: Time up. Aborting.' )\n self.abort()\n\n try:\n ps.header.stamp = rospy.Time(0)\n ps_map = self.listener.transformPoint( '/map', ps )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L155_C12", "label": "if", "type": "if", "loc": [155, 157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:While_L154_C8", "vector": [4, 3, 0.7761, 0.0149, 3, 0.6, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rospy.Time.now().to_sec() - t0 > 180:\n rospy.logout( 'sim_capture: Time up. Aborting.' )\n self.abort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L156_C16", "label": "logout()", "type": "expression", "loc": [156, 156], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L155_C12", "vector": [8, 4, 0.7761, 0.005, 4, 0.16, 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( 'sim_capture: Time up. Aborting.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L157_C16", "label": "abort()", "type": "expression", "loc": [157, 157], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L155_C12", "vector": [8, 4, 0.7811, 0.005, 4, 0.16, 1.0, 299, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "abort", "arg_names": [], "import_names": [], "rhs_call_name": "abort", "annotation": ""}, "snippet": " self.abort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L159_C12", "label": "try", "type": "try", "loc": [159, 176], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:While_L154_C8", "vector": [7, 3, 0.8333, 0.0896, 3, 0.6, 0.5, 0, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n ps.header.stamp = rospy.Time(0)\n ps_map = self.listener.transformPoint( '/map', ps )\n x = ps_map.point.x\n y = ps_map.point.y\n\n ps2.header.stamp = rospy.Time(0)\n ps2_map = self.listener.transformPoint( '/map', ps2 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L160_C16", "label": "ps.header.stamp = Time()", "type": "assigned_variable", "loc": [160, 160], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L159_C12", "vector": [14, 4, 0.796, 0.005, 4, 0.54, 0.0, 161, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " ps.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L161_C16", "label": "ps_map = transformPoint()", "type": "assigned_variable", "loc": [161, 161], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L159_C12", "vector": [14, 4, 0.801, 0.005, 4, 0.54, 0.125, 938, 3, 2, 0, 0, 987, 10, 1], "semantic": {"name": "ps_map", "arg_names": [], "import_names": [], "rhs_call_name": "transformPoint", "annotation": ""}, "snippet": " ps_map = self.listener.transformPoint( '/map', ps )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L162_C16", "label": "x =", "type": "assigned_variable", "loc": [162, 162], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L159_C12", "vector": [14, 4, 0.806, 0.005, 4, 0.54, 0.25, 190, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = ps_map.point.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L163_C16", "label": "y =", "type": "assigned_variable", "loc": [163, 163], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L159_C12", "vector": [14, 4, 0.8109, 0.005, 4, 0.54, 0.375, 304, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = ps_map.point.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L165_C16", "label": "ps2.header.stamp = Time()", "type": "assigned_variable", "loc": [165, 165], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L159_C12", "vector": [14, 4, 0.8209, 0.005, 4, 0.54, 0.5, 334, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "ps2.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " ps2.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L166_C16", "label": "ps2_map = transformPoint()", "type": "assigned_variable", "loc": [166, 166], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L159_C12", "vector": [14, 4, 0.8259, 0.005, 4, 0.54, 0.625, 537, 3, 2, 0, 0, 987, 10, 1], "semantic": {"name": "ps2_map", "arg_names": [], "import_names": [], "rhs_call_name": "transformPoint", "annotation": ""}, "snippet": " ps2_map = self.listener.transformPoint( '/map', ps2 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L168_C16", "label": "append()", "type": "expression", "loc": [168, 168], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L159_C12", "vector": [8, 4, 0.8358, 0.005, 4, 0.54, 0.75, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " pts.append([ x, y, ps2_map.point.x, ps2_map.point.y ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L170_C16", "label": "inside =", "type": "assigned_variable", "loc": [170, 170], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L159_C12", "vector": [14, 4, 0.8458, 0.005, 4, 0.54, 0.875, 95, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "inside", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " inside = x > -0.5 and x < 10.5 and y > -0.5 and y < 6.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L171_C16", "label": "if", "type": "if", "loc": [171, 172], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L159_C12", "vector": [4, 4, 0.8532, 0.01, 4, 0.54, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not inside:\n self.abort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L172_C20", "label": "abort()", "type": "expression", "loc": [172, 172], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L171_C16", "vector": [8, 5, 0.8557, 0.005, 5, 0.7, 0.0, 299, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "abort", "arg_names": [], "import_names": [], "rhs_call_name": "abort", "annotation": ""}, "snippet": " self.abort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L175_C16", "label": "logout()", "type": "expression", "loc": [175, 175], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L159_C12", "vector": [8, 4, 0.8706, 0.005, 4, 0.54, 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( 'sim_capture: Failed transform.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L178_C12", "label": "sleep()", "type": "expression", "loc": [178, 178], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:While_L154_C8", "vector": [8, 3, 0.8856, 0.005, 3, 0.6, 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.2 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L179_C8", "label": "logout()", "type": "expression", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "vector": [8, 2, 0.8905, 0.005, 2, 0.41, 0.7, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'sim_capture: Done servoing.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L182_C8", "label": "stop()", "type": "expression", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "vector": [8, 2, 0.9055, 0.005, 2, 0.41, 0.75, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " sm.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L186_C8", "label": "if", "type": "if", "loc": [186, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "vector": [4, 2, 0.9328, 0.0199, 2, 0.41, 0.8, 0, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if fname:\n f = open( fname, 'w' )\n else:\n f = open( 'trajectory_caps/' + str(int(time.time())) + '_cap.pkl', 'w' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L187_C12", "label": "f = open()", "type": "assigned_variable", "loc": [187, 187], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L186_C8", "vector": [14, 3, 0.9303, 0.005, 3, 0.61, 0.0, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " f = open( fname, 'w' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L189_C12", "label": "f = open()", "type": "assigned_variable", "loc": [189, 189], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L186_C8", "vector": [14, 3, 0.9403, 0.005, 3, 0.61, 1.0, 899, 3, 2, 0, 0, 693, 10, 4], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " f = open( 'trajectory_caps/' + str(int(time.time())) + '_cap.pkl', 'w' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L190_C8", "label": "dump()", "type": "expression", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "vector": [8, 2, 0.9453, 0.005, 2, 0.41, 0.85, 952, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "dump", "arg_names": [], "import_names": [], "rhs_call_name": "dump", "annotation": ""}, "snippet": " pkl.dump( pts, f )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L191_C8", "label": "close()", "type": "expression", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "vector": [8, 2, 0.9502, 0.005, 2, 0.41, 0.9, 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_99357:Expr_L193_C8", "label": "logout()", "type": "expression", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "vector": [8, 2, 0.9602, 0.005, 2, 0.41, 0.95, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'sim_capture: Capture complete' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Return_L194_C8", "label": "return", "type": "return", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "vector": [13, 2, 0.9652, 0.005, 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 int( True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L199_C0", "label": "if", "type": "if", "loc": [199, 201], "level": 0, "parent": null, "vector": [4, 0, 0.995, 0.0149, 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 sc = SimCapture()\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L200_C4", "label": "sc = SimCapture()", "type": "assigned_variable", "loc": [200, 200], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L199_C0", "vector": [14, 1, 0.995, 0.005, 1, 0.45, 0.0, 356, 3, 0, 0, 0, 216, 10, 1], "semantic": {"name": "sc", "arg_names": [], "import_names": [], "rhs_call_name": "SimCapture", "annotation": ""}, "snippet": " sc = SimCapture()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L201_C4", "label": "spin()", "type": "expression", "loc": [201, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L199_C0", "vector": [8, 1, 1.0, 0.005, 1, 0.45, 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_99357:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:While_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:While_L54_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L55_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L56_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L55_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L57_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L55_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L58_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L55_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L59_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L55_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L60_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L55_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L64_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:While_L54_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:ClassDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:ClassDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:While_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:While_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:ClassDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:ClassDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L102_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:ClassDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:While_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:While_L154_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L155_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L155_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L156_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L155_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L157_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:While_L154_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L159_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L159_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L160_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L159_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L161_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L159_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L162_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L159_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L163_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L159_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L165_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L159_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L166_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L159_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L168_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L159_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L170_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L159_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L171_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L171_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L172_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:Try_L159_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L175_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:While_L154_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L178_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L186_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L187_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L186_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L189_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Return_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L199_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Assign_L200_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99357:If_L199_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99357:Expr_L201_C4"}]
#! /usr/bin/python import time import roslib roslib.load_manifest('rospy') roslib.load_manifest('actionlib') roslib.load_manifest( 'move_base_msgs' ) roslib.load_manifest('tf') roslib.load_manifest('geometry_msgs') roslib.load_manifest('std_msgs') roslib.load_manifest('hrl_rfid') roslib.load_manifest('robotis') roslib.load_manifest('rfid_people_following') import rospy import tf import tf.transformations as tft import actionlib from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal from geometry_msgs.msg import Twist from geometry_msgs.msg import PointStamped from geometry_msgs.msg import Point from geometry_msgs.msg import PoseStamped from geometry_msgs.msg import Quaternion from geometry_msgs.msg import PoseWithCovarianceStamped from std_msgs.msg import Float64 from rfid_people_following.srv import FloatFloat_Int32 from rfid_people_following.srv import FloatFloat_Int32Response from rfid_people_following.srv import FloatFloatFloatFloat_Int32 import numpy as np, math import time from threading import Thread from collections import deque def standard_rad(t): if t > 0: return ((t + np.pi) % (np.pi * 2)) - np.pi else: return ((t - np.pi) % (np.pi * -2)) + np.pi class RotateBackup(): def __init__( self, service_name = '/rotate_backup' ): try: rospy.init_node( 'rotater' ) except: pass rospy.logout( 'rotate_backup: Initializing service: \'%s\'' % service_name ) self.pub = rospy.Publisher( '/move_base_simple/goal', PoseStamped ) self.pub_direct = rospy.Publisher( '/navigation/cmd_vel', Twist ) self.listener = tf.TransformListener() self.listener.waitForTransform('/odom_combined', '/base_link', rospy.Time(0), timeout = rospy.Duration(100) ) self._service_rb = rospy.Service( service_name, FloatFloat_Int32, self.move) self._service_rb_navstack = rospy.Service( service_name+'/navstack', FloatFloatFloatFloat_Int32, self.navstack) rospy.logout( 'rotate_backup: Service ready' ) def non_nav_rotate( self, r ): success, pose, orient = self.get_pose() # orient = rx, ry, rz if not success: rospy.logout( 'rotate_backup: Rotate transform fail. Exiting.' ) return t_rz = standard_rad( orient[-1] + r ) mov = Twist() mov.linear.x = 0.05 mov.angular.z = 0.6 * np.sign( r ) rate = rospy.Rate( 10 ) while not np.allclose( [t_rz], [orient[-1]], atol=[0.08] ): # Not within 5deg of target success, pose, orient = self.get_pose() # orient = rx, ry, rz orient[-1] = standard_rad( orient[-1] ) if not success: rospy.logout( 'rotate_backup: Rotate transform fail. Exiting.' ) return self.pub_direct.publish( mov ) rate.sleep() def non_nav_backup( self, d ): # Hacky way to backup without relying on nav_stack's bizarre circling. mov = Twist() mov.linear.x = 0.1 * np.sign( d ) t0 = time.time() rate = rospy.Rate( 10.0 ) while time.time() - t0 < np.abs(d) / 0.1: self.pub_direct.publish( mov ) rate.sleep() def get_pose( self ): ps = PoseStamped() ps.header.stamp = rospy.Time(0) ps.header.frame_id = '/base_link' #ps.pose.position.x = d try: ps_odom = self.listener.transformPose( '/odom_combined', ps ) except: rospy.logout( 'rotate_backup: Failed transform #1.' ) time.sleep( 2.0 ) return False, [0.0, 0.0, 0.0], [0.0, 0.0, 0.0] orient = ps_odom.pose.orientation rx, ry, rz = tft.euler_from_quaternion([ orient.x, orient.y, orient.z, orient.w ]) pose = [ ps_odom.pose.position.x, ps_odom.pose.position.y, ps_odom.pose.position.z ] return True, pose, [rx, ry, rz] # Hacky version not using actionlib # def wait_for_stop( self, duration = 0.5 ): # rospy.logout( 'rotate_backup: Waiting for movement to stop.' ) # t0 = time.time() # rate = rospy.Rate( 10 ) # success, pose, orient = self.get_pose() # if not success: # rospy.logout( 'rotate_backup: Waiting 2 sec.' ) # time.sleep( 2.0 ) # return # sp = np.array([ pose[0], pose[1], pose[2], orient[-1] ]) # while time.time() - t0 < duration: # success, pose, orient = self.get_pose() # if not success: # rospy.logout( 'rotate_backup: Waiting 2 sec.' ) # time.sleep( 2.0 ) # return # qp = np.array([ pose[0], pose[1], pose[2], orient[-1] ]) # if not np.allclose( sp, qp, atol=[0.01, 0.01, 0.01, 0.005] ): # t0 = time.time() # sp = qp # rate.sleep() # return def move( self, request ): r = request.rotate d = request.displace rospy.logout( 'rotate_backup: Asked to rotate: %3.2f (deg)' % math.degrees(r)) rospy.logout( 'rotate_backup: Asked to translate (forward-backward): %3.2f (m)' % d) self.non_nav_backup( d ) self.non_nav_rotate( r ) # success, pose, orient = self.get_pose() # if not success: # return FloatFloat_Int32Response( int(False) ) # new_point = Point( pose[0], pose[1], pose[2] ) # old_rx, old_ry, old_rz = orient # new_orient = tft.quaternion_from_euler( old_rx, old_ry, old_rz + r ) # new_quat = Quaternion( *new_orient ) # new_ps = PoseStamped() # new_ps.header.stamp = rospy.Time(0) # new_ps.header.frame_id = '/odom_combined' # new_ps.pose.position = new_point # new_ps.pose.orientation = new_quat # self.pub.publish( new_ps ) # self.wait_for_stop() # rospy.logout( 'rotate_backup: Done with call.' ) return FloatFloat_Int32Response( int(True) ) # Hacky version not using actionlib # def navstack( self, request ): # new_orient = tft.quaternion_from_euler( 0.0, 0.0, request.ang ) # rx, ry, rz # new_quat = Quaternion( *new_orient ) # new_ps = PoseStamped() # new_ps.header.stamp = rospy.Time(0) # new_ps.header.frame_id = '/map' # new_ps.pose.position.x = request.x # new_ps.pose.position.y = request.y # new_ps.pose.orientation = new_quat # rospy.logout( 'rotate_backup: Requesting navstack move to <x,y,ang-deg> %3.3f %3.3f %3.3f.' % (request.x, request.y, math.degrees(request.ang)) ) # self.pub.publish( new_ps ) # rospy.logout( 'rotate_backup: Waiting for base to stop moving.' ) # self.wait_for_stop( 7.0 ) # return int( True ) def navstack( self, request ): rospy.logout( 'rotate_backup: Requesting navstack move to <x,y,ang-deg> %3.3f %3.3f %3.3f.' % (request.x, request.y, math.degrees(request.ang)) ) client = actionlib.SimpleActionClient( 'move_base', MoveBaseAction ) client.wait_for_server() ps = PoseStamped() ps.header.frame_id = '/map' ps.header.stamp = rospy.Time(0) ps.pose.position.x = request.x ps.pose.position.y = request.y ps.pose.orientation = Quaternion( *tft.quaternion_from_euler( 0.0, 0.0, request.ang )) goal = MoveBaseGoal( ps ) client.send_goal( goal ) rospy.logout( 'rotate_backup: Waiting for base to stop moving.' ) client.wait_for_result() return int( True ) class RotateBackupClient(): def __init__( self, service_name = '/rotate_backup' ): rospy.logout( 'rotate_backup_client: Waiting for service: \'%s\'' % service_name ) rospy.wait_for_service( service_name ) rospy.logout( 'rotate_backup_client: Service ready.' ) self._rb_service = rospy.ServiceProxy( service_name, FloatFloat_Int32 ) def rotate_backup( self, rotate, displace ): return self._rb_service( rotate, displace ) if __name__ == '__main__': rb = RotateBackup() rospy.spin()
ajibawa-2023/Python-Code-Large/train/row_99358
119
217
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Import_L2_C0", "label": "time import time", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0092, 0.0046, 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_99358:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0138, 0.0046, 0, 0.66, 0.0303, 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_99358:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0184, 0.0046, 0, 0.66, 0.0606, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('rospy')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.023, 0.0046, 0, 0.66, 0.0909, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('actionlib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0276, 0.0046, 0, 0.66, 0.1212, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'move_base_msgs' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0323, 0.0046, 0, 0.66, 0.1515, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('tf')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0369, 0.0046, 0, 0.66, 0.1818, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('geometry_msgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L9_C0", "label": "load_manifest()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0415, 0.0046, 0, 0.66, 0.2121, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('std_msgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L10_C0", "label": "load_manifest()", "type": "expression", "loc": [10, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0461, 0.0046, 0, 0.66, 0.2424, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('hrl_rfid')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L11_C0", "label": "load_manifest()", "type": "expression", "loc": [11, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0507, 0.0046, 0, 0.66, 0.2727, 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('robotis')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L12_C0", "label": "load_manifest()", "type": "expression", "loc": [12, 12], "level": 0, "parent": null, "vector": [8, 0, 0.0553, 0.0046, 0, 0.66, 0.303, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('rfid_people_following')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Import_L13_C0", "label": "rospy import rospy", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0599, 0.0046, 0, 0.66, 0.3333, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Import_L15_C0", "label": "tf import tf", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0691, 0.0046, 0, 0.66, 0.3636, 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_99358:Import_L16_C0", "label": "tf.transformations import tft", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0737, 0.0046, 0, 0.66, 0.3939, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tft"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tft"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Import_L17_C0", "label": "actionlib import actionlib", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0783, 0.0046, 0, 0.66, 0.4242, 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_99358:ImportFrom_L18_C0", "label": "from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0829, 0.0046, 0, 0.66, 0.4545, 440, 0, 2, 0, 0, 440, 0, 0], "semantic": {"name": "move_base_msgs.msg", "arg_names": [], "import_names": ["MoveBaseAction", "MoveBaseGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:ImportFrom_L19_C0", "label": "from geometry_msgs.msg import Twist", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0876, 0.0046, 0, 0.66, 0.4848, 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_99358:ImportFrom_L20_C0", "label": "from geometry_msgs.msg import PointStamped", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0922, 0.0046, 0, 0.66, 0.5152, 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_99358:ImportFrom_L21_C0", "label": "from geometry_msgs.msg import Point", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0968, 0.0046, 0, 0.66, 0.5455, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Point"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:ImportFrom_L22_C0", "label": "from geometry_msgs.msg import PoseStamped", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.1014, 0.0046, 0, 0.66, 0.5758, 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_99358:ImportFrom_L23_C0", "label": "from geometry_msgs.msg import Quaternion", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.106, 0.0046, 0, 0.66, 0.6061, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Quaternion"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Quaternion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:ImportFrom_L24_C0", "label": "from geometry_msgs.msg import PoseWithCovarianceStamped", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.1106, 0.0046, 0, 0.66, 0.6364, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["PoseWithCovarianceStamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import PoseWithCovarianceStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:ImportFrom_L25_C0", "label": "from std_msgs.msg import Float64", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.1152, 0.0046, 0, 0.66, 0.6667, 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_99358:ImportFrom_L27_C0", "label": "from rfid_people_following.srv import FloatFloat_Int32", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.1244, 0.0046, 0, 0.66, 0.697, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["FloatFloat_Int32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import FloatFloat_Int32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:ImportFrom_L28_C0", "label": "from rfid_people_following.srv import FloatFloat_Int32Response", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.129, 0.0046, 0, 0.66, 0.7273, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["FloatFloat_Int32Response"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import FloatFloat_Int32Response"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:ImportFrom_L29_C0", "label": "from rfid_people_following.srv import FloatFloatFloatFloat_Int32", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.1336, 0.0046, 0, 0.66, 0.7576, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["FloatFloatFloatFloat_Int32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import FloatFloatFloatFloat_Int32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Import_L31_C0", "label": "numpy import np, math", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0046, 0, 0.66, 0.7879, 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_99358:Import_L32_C0", "label": "time import time", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.1475, 0.0046, 0, 0.66, 0.8182, 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_99358:ImportFrom_L33_C0", "label": "from threading import Thread", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.1521, 0.0046, 0, 0.66, 0.8485, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["Thread"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import Thread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:ImportFrom_L34_C0", "label": "from collections import deque", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.1567, 0.0046, 0, 0.66, 0.8788, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "collections", "arg_names": [], "import_names": ["deque"], "rhs_call_name": "", "annotation": ""}, "snippet": "from collections import deque"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L36_C0", "label": "standard_rad", "type": "function", "loc": [36, 40], "level": 0, "parent": null, "vector": [2, 0, 0.1751, 0.023, 0, 0.66, 0.9091, 54, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "standard_rad", "arg_names": ["t"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def standard_rad(t):\n if t > 0:\n return ((t + np.pi) % (np.pi * 2)) - np.pi\n else:\n return ((t - np.pi) % (np.pi * -2)) + np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:If_L37_C4", "label": "if", "type": "if", "loc": [37, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L36_C0", "vector": [4, 1, 0.1774, 0.0184, 1, 0.41, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if t > 0:\n return ((t + np.pi) % (np.pi * 2)) - np.pi\n else:\n return ((t - np.pi) % (np.pi * -2)) + np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Return_L38_C8", "label": "return", "type": "return", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:If_L37_C4", "vector": [13, 2, 0.1751, 0.0046, 2, 0.14, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ((t + np.pi) % (np.pi * 2)) - np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Return_L40_C8", "label": "return", "type": "return", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:If_L37_C4", "vector": [13, 2, 0.1843, 0.0046, 2, 0.14, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ((t - np.pi) % (np.pi * -2)) + np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:ClassDef_L43_C0", "label": "RotateBackup", "type": "class", "loc": [43, 201], "level": 0, "parent": null, "vector": [3, 0, 0.5622, 0.7327, 0, 0.66, 0.9394, 827, 0, 6, 0, 0, 0, 0, 57], "semantic": {"name": "RotateBackup", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RotateBackup():\n def __init__( self, service_name = '/rotate_backup' ):\n try:\n rospy.init_node( 'rotater' )\n except:\n pass\n rospy.logout( 'rotate_backup: Initializing service: \\'%s\\'' % service_name )\n self.pub = rospy.Publisher( '/move_base_simple/goal', PoseStamped )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L44_C4", "label": "__init__", "type": "function", "loc": [44, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:ClassDef_L43_C0", "vector": [2, 1, 0.2327, 0.0645, 1, 0.09, 0.0, 555, 0, 2, 0, 0, 0, 0, 11], "semantic": {"name": "__init__", "arg_names": ["self", "service_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, service_name = '/rotate_backup' ):\n try:\n rospy.init_node( 'rotater' )\n except:\n pass\n rospy.logout( 'rotate_backup: Initializing service: \\'%s\\'' % service_name )\n self.pub = rospy.Publisher( '/move_base_simple/goal', PoseStamped )\n self.pub_direct = rospy.Publisher( '/navigation/cmd_vel', Twist )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Try_L45_C8", "label": "try", "type": "try", "loc": [45, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L44_C4", "vector": [7, 2, 0.2143, 0.0184, 2, 0.01, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node( 'rotater' )\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L46_C12", "label": "init_node()", "type": "expression", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:Try_L45_C8", "vector": [8, 3, 0.212, 0.0046, 3, 0.03, 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( 'rotater' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L49_C8", "label": "logout()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L44_C4", "vector": [8, 2, 0.2258, 0.0046, 2, 0.01, 0.125, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'rotate_backup: Initializing service: \\'%s\\'' % service_name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L50_C8", "label": "self.pub = Publisher()", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L44_C4", "vector": [14, 2, 0.2304, 0.0046, 2, 0.01, 0.25, 86, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.pub = rospy.Publisher( '/move_base_simple/goal', PoseStamped )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L51_C8", "label": "self.pub_direct = Publisher()", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L44_C4", "vector": [14, 2, 0.235, 0.0046, 2, 0.01, 0.375, 432, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.pub_direct", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.pub_direct = rospy.Publisher( '/navigation/cmd_vel', Twist )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L52_C8", "label": "self.listener = TransformListener()", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L44_C4", "vector": [14, 2, 0.2396, 0.0046, 2, 0.01, 0.5, 686, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.listener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L53_C8", "label": "waitForTransform()", "type": "expression", "loc": [53, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L44_C4", "vector": [8, 2, 0.2465, 0.0092, 2, 0.01, 0.625, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.listener.waitForTransform('/odom_combined', '/base_link',\n rospy.Time(0), timeout = rospy.Duration(100) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L55_C8", "label": "self._service_rb = Service()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L44_C4", "vector": [14, 2, 0.2535, 0.0046, 2, 0.01, 0.75, 456, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self._service_rb", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self._service_rb = rospy.Service( service_name, FloatFloat_Int32, self.move)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L56_C8", "label": "self._service_rb_navstack = Service()", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L44_C4", "vector": [14, 2, 0.2581, 0.0046, 2, 0.01, 0.875, 229, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self._service_rb_navstack", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self._service_rb_navstack = rospy.Service( service_name+'/navstack', FloatFloatFloatFloat_Int32, self.navstack)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L57_C8", "label": "logout()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L44_C4", "vector": [8, 2, 0.2627, 0.0046, 2, 0.01, 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( 'rotate_backup: Service ready' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L59_C4", "label": "non_nav_rotate", "type": "function", "loc": [59, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:ClassDef_L43_C0", "vector": [2, 1, 0.3157, 0.0922, 1, 0.09, 0.2, 213, 0, 2, 0, 0, 0, 0, 12], "semantic": {"name": "non_nav_rotate", "arg_names": ["self", "r"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def non_nav_rotate( self, r ):\n success, pose, orient = self.get_pose() # orient = rx, ry, rz\n if not success:\n rospy.logout( 'rotate_backup: Rotate transform fail. Exiting.' )\n return\n \n t_rz = standard_rad( orient[-1] + r )\n mov = Twist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L60_C8", "label": "success, pose, orient = get_pose()", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L59_C4", "vector": [14, 2, 0.2765, 0.0046, 2, 0.47, 0.0, 507, 3, 0, 0, 0, 876, 10, 1], "semantic": {"name": "success, pose, orient", "arg_names": [], "import_names": [], "rhs_call_name": "get_pose", "annotation": ""}, "snippet": " success, pose, orient = self.get_pose() # orient = rx, ry, rz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:If_L61_C8", "label": "if", "type": "if", "loc": [61, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L59_C4", "vector": [4, 2, 0.2857, 0.0138, 2, 0.47, 0.1429, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not success:\n rospy.logout( 'rotate_backup: Rotate transform fail. Exiting.' )\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L62_C12", "label": "logout()", "type": "expression", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:If_L61_C8", "vector": [8, 3, 0.2857, 0.0046, 3, 0.79, 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( 'rotate_backup: Rotate transform fail. Exiting.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Return_L63_C12", "label": "return", "type": "return", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:If_L61_C8", "vector": [13, 3, 0.2903, 0.0046, 3, 0.79, 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_99358:Assign_L65_C8", "label": "t_rz = standard_rad()", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L59_C4", "vector": [14, 2, 0.2995, 0.0046, 2, 0.47, 0.2857, 81, 3, 1, 0, 0, 54, 10, 1], "semantic": {"name": "t_rz", "arg_names": [], "import_names": [], "rhs_call_name": "standard_rad", "annotation": ""}, "snippet": " t_rz = standard_rad( orient[-1] + r )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L66_C8", "label": "mov = Twist()", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L59_C4", "vector": [14, 2, 0.3041, 0.0046, 2, 0.47, 0.4286, 202, 3, 0, 0, 0, 9, 10, 1], "semantic": {"name": "mov", "arg_names": [], "import_names": [], "rhs_call_name": "Twist", "annotation": ""}, "snippet": " mov = Twist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L67_C8", "label": "mov.linear.x =", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L59_C4", "vector": [14, 2, 0.3088, 0.0046, 2, 0.47, 0.5714, 583, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "mov.linear.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mov.linear.x = 0.05"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L68_C8", "label": "mov.angular.z =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L59_C4", "vector": [14, 2, 0.3134, 0.0046, 2, 0.47, 0.7143, 177, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "mov.angular.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mov.angular.z = 0.6 * np.sign( r )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L70_C8", "label": "rate = Rate()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L59_C4", "vector": [14, 2, 0.3226, 0.0046, 2, 0.47, 0.8571, 477, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "rate", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " rate = rospy.Rate( 10 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:While_L71_C8", "label": "while", "type": "while", "loc": [71, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L59_C4", "vector": [5, 2, 0.3433, 0.0369, 2, 0.47, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not np.allclose( [t_rz], [orient[-1]], atol=[0.08] ): # Not within 5deg of target\n success, pose, orient = self.get_pose() # orient = rx, ry, rz\n orient[-1] = standard_rad( orient[-1] )\n if not success:\n rospy.logout( 'rotate_backup: Rotate transform fail. Exiting.' )\n return\n self.pub_direct.publish( mov )\n rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L72_C12", "label": "success, pose, orient = get_pose()", "type": "assigned_variable", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:While_L71_C8", "vector": [14, 3, 0.3318, 0.0046, 3, 0.97, 0.0, 507, 3, 0, 0, 0, 876, 10, 1], "semantic": {"name": "success, pose, orient", "arg_names": [], "import_names": [], "rhs_call_name": "get_pose", "annotation": ""}, "snippet": " success, pose, orient = self.get_pose() # orient = rx, ry, rz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L73_C12", "label": " = standard_rad()", "type": "assigned_variable", "loc": [73, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:While_L71_C8", "vector": [14, 3, 0.3364, 0.0046, 3, 0.97, 0.25, 0, 3, 1, 0, 0, 54, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "standard_rad", "annotation": ""}, "snippet": " orient[-1] = standard_rad( orient[-1] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:If_L74_C12", "label": "if", "type": "if", "loc": [74, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:While_L71_C8", "vector": [4, 3, 0.3456, 0.0138, 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 success:\n rospy.logout( 'rotate_backup: Rotate transform fail. Exiting.' )\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L75_C16", "label": "logout()", "type": "expression", "loc": [75, 75], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:If_L74_C12", "vector": [8, 4, 0.3456, 0.0046, 4, 0.89, 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( 'rotate_backup: Rotate transform fail. Exiting.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Return_L76_C16", "label": "return", "type": "return", "loc": [76, 76], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:If_L74_C12", "vector": [13, 4, 0.3502, 0.0046, 4, 0.89, 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_99358:Expr_L77_C12", "label": "publish()", "type": "expression", "loc": [77, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:While_L71_C8", "vector": [8, 3, 0.3548, 0.0046, 3, 0.97, 0.75, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.pub_direct.publish( mov )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L78_C12", "label": "sleep()", "type": "expression", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:While_L71_C8", "vector": [8, 3, 0.3594, 0.0046, 3, 0.97, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L81_C4", "label": "non_nav_backup", "type": "function", "loc": [81, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:ClassDef_L43_C0", "vector": [2, 1, 0.3917, 0.0415, 1, 0.09, 0.4, 607, 0, 2, 0, 0, 0, 0, 8], "semantic": {"name": "non_nav_backup", "arg_names": ["self", "d"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def non_nav_backup( self, d ):\n # Hacky way to backup without relying on nav_stack's bizarre circling.\n mov = Twist()\n mov.linear.x = 0.1 * np.sign( d )\n t0 = time.time()\n rate = rospy.Rate( 10.0 )\n while time.time() - t0 < np.abs(d) / 0.1:\n self.pub_direct.publish( mov )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L83_C8", "label": "mov = Twist()", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L81_C4", "vector": [14, 2, 0.3825, 0.0046, 2, 0.71, 0.0, 202, 3, 0, 0, 0, 9, 10, 1], "semantic": {"name": "mov", "arg_names": [], "import_names": [], "rhs_call_name": "Twist", "annotation": ""}, "snippet": " mov = Twist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L84_C8", "label": "mov.linear.x =", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L81_C4", "vector": [14, 2, 0.3871, 0.0046, 2, 0.71, 0.25, 583, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "mov.linear.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mov.linear.x = 0.1 * np.sign( d )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L85_C8", "label": "t0 = time()", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L81_C4", "vector": [14, 2, 0.3917, 0.0046, 2, 0.71, 0.5, 573, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "t0", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " t0 = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L86_C8", "label": "rate = Rate()", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L81_C4", "vector": [14, 2, 0.3963, 0.0046, 2, 0.71, 0.75, 477, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "rate", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " rate = rospy.Rate( 10.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:While_L87_C8", "label": "while", "type": "while", "loc": [87, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L81_C4", "vector": [5, 2, 0.4055, 0.0138, 2, 0.71, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while time.time() - t0 < np.abs(d) / 0.1:\n self.pub_direct.publish( mov )\n rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L88_C12", "label": "publish()", "type": "expression", "loc": [88, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:While_L87_C8", "vector": [8, 3, 0.4055, 0.0046, 3, 0.85, 0.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.pub_direct.publish( mov )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L89_C12", "label": "sleep()", "type": "expression", "loc": [89, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:While_L87_C8", "vector": [8, 3, 0.4101, 0.0046, 3, 0.85, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L91_C4", "label": "get_pose", "type": "function", "loc": [91, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:ClassDef_L43_C0", "vector": [2, 1, 0.4562, 0.0783, 1, 0.09, 0.6, 876, 0, 1, 1, 0, 0, 0, 6], "semantic": {"name": "get_pose", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_pose( self ):\n ps = PoseStamped()\n ps.header.stamp = rospy.Time(0)\n ps.header.frame_id = '/base_link'\n #ps.pose.position.x = d\n \n try:\n ps_odom = self.listener.transformPose( '/odom_combined', ps )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L92_C8", "label": "ps = PoseStamped()", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L91_C4", "vector": [14, 2, 0.424, 0.0046, 2, 0.11, 0.0, 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_99358:Assign_L93_C8", "label": "ps.header.stamp = Time()", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L91_C4", "vector": [14, 2, 0.4286, 0.0046, 2, 0.11, 0.1429, 161, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " ps.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L94_C8", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L91_C4", "vector": [14, 2, 0.4332, 0.0046, 2, 0.11, 0.2857, 293, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ps.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.header.frame_id = '/base_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Try_L97_C8", "label": "try", "type": "try", "loc": [97, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L91_C4", "vector": [7, 2, 0.4585, 0.0276, 2, 0.11, 0.4286, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n ps_odom = self.listener.transformPose( '/odom_combined', ps )\n except:\n rospy.logout( 'rotate_backup: Failed transform #1.' )\n time.sleep( 2.0 )\n return False, [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L98_C12", "label": "ps_odom = transformPose()", "type": "assigned_variable", "loc": [98, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:Try_L97_C8", "vector": [14, 3, 0.4516, 0.0046, 3, 0.12, 0.0, 871, 3, 2, 0, 0, 654, 10, 1], "semantic": {"name": "ps_odom", "arg_names": [], "import_names": [], "rhs_call_name": "transformPose", "annotation": ""}, "snippet": " ps_odom = self.listener.transformPose( '/odom_combined', ps )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L100_C12", "label": "logout()", "type": "expression", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:Try_L97_C8", "vector": [8, 3, 0.4608, 0.0046, 3, 0.12, 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( 'rotate_backup: Failed transform #1.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L101_C12", "label": "sleep()", "type": "expression", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:Try_L97_C8", "vector": [8, 3, 0.4654, 0.0046, 3, 0.12, 0.5, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep( 2.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Return_L102_C12", "label": "return", "type": "return", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:Try_L97_C8", "vector": [13, 3, 0.47, 0.0046, 3, 0.12, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False, [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L104_C8", "label": "orient =", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L91_C4", "vector": [14, 2, 0.4793, 0.0046, 2, 0.11, 0.5714, 295, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "orient", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " orient = ps_odom.pose.orientation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L105_C8", "label": "rx, ry, rz = euler_from_quaternion()", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L91_C4", "vector": [14, 2, 0.4839, 0.0046, 2, 0.11, 0.7143, 603, 3, 1, 0, 0, 409, 10, 1], "semantic": {"name": "rx, ry, rz", "arg_names": [], "import_names": [], "rhs_call_name": "euler_from_quaternion", "annotation": ""}, "snippet": " rx, ry, rz = tft.euler_from_quaternion([ orient.x, orient.y, orient.z, orient.w ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L106_C8", "label": "pose =", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L91_C4", "vector": [14, 2, 0.4885, 0.0046, 2, 0.11, 0.8571, 767, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose = [ ps_odom.pose.position.x, ps_odom.pose.position.y, ps_odom.pose.position.z ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Return_L107_C8", "label": "return", "type": "return", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L91_C4", "vector": [13, 2, 0.4931, 0.0046, 2, 0.11, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True, pose, [rx, ry, rz]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L135_C4", "label": "move", "type": "function", "loc": [135, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:ClassDef_L43_C0", "vector": [2, 1, 0.6843, 0.129, 1, 0.09, 0.8, 856, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "move", "arg_names": ["self", "request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move( self, request ):\n r = request.rotate\n d = request.displace\n rospy.logout( 'rotate_backup: Asked to rotate: %3.2f (deg)' % math.degrees(r))\n rospy.logout( 'rotate_backup: Asked to translate (forward-backward): %3.2f (m)' % d)\n\n self.non_nav_backup( d )\n self.non_nav_rotate( r )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L136_C8", "label": "r =", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L135_C4", "vector": [14, 2, 0.6267, 0.0046, 2, 0.21, 0.0, 436, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = request.rotate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L137_C8", "label": "d =", "type": "assigned_variable", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L135_C4", "vector": [14, 2, 0.6313, 0.0046, 2, 0.21, 0.1667, 355, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d = request.displace"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L138_C8", "label": "logout()", "type": "expression", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L135_C4", "vector": [8, 2, 0.6359, 0.0046, 2, 0.21, 0.3333, 525, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'rotate_backup: Asked to rotate: %3.2f (deg)' % math.degrees(r))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L139_C8", "label": "logout()", "type": "expression", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L135_C4", "vector": [8, 2, 0.6406, 0.0046, 2, 0.21, 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( 'rotate_backup: Asked to translate (forward-backward): %3.2f (m)' % d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L141_C8", "label": "non_nav_backup()", "type": "expression", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L135_C4", "vector": [8, 2, 0.6498, 0.0046, 2, 0.21, 0.6667, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "non_nav_backup", "arg_names": [], "import_names": [], "rhs_call_name": "non_nav_backup", "annotation": ""}, "snippet": " self.non_nav_backup( d )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L142_C8", "label": "non_nav_rotate()", "type": "expression", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L135_C4", "vector": [8, 2, 0.6544, 0.0046, 2, 0.21, 0.8333, 213, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "non_nav_rotate", "arg_names": [], "import_names": [], "rhs_call_name": "non_nav_rotate", "annotation": ""}, "snippet": " self.non_nav_rotate( r )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Return_L162_C8", "label": "return", "type": "return", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L135_C4", "vector": [13, 2, 0.7465, 0.0046, 2, 0.21, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return FloatFloat_Int32Response( int(True) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "label": "navstack", "type": "function", "loc": [184, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:ClassDef_L43_C0", "vector": [2, 1, 0.8871, 0.0829, 1, 0.09, 1.0, 791, 0, 2, 1, 0, 0, 0, 13], "semantic": {"name": "navstack", "arg_names": ["self", "request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def navstack( self, request ):\n rospy.logout( 'rotate_backup: Requesting navstack move to <x,y,ang-deg> %3.3f %3.3f %3.3f.' % (request.x, request.y, math.degrees(request.ang)) )\n\n client = actionlib.SimpleActionClient( 'move_base', MoveBaseAction )\n client.wait_for_server()\n\n ps = PoseStamped()\n ps.header.frame_id = '/map'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L185_C8", "label": "logout()", "type": "expression", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "vector": [8, 2, 0.8525, 0.0046, 2, 0.12, 0.0, 525, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'rotate_backup: Requesting navstack move to <x,y,ang-deg> %3.3f %3.3f %3.3f.' % (request.x, request.y, math.degrees(request.ang)) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L187_C8", "label": "client = SimpleActionClient()", "type": "assigned_variable", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "vector": [14, 2, 0.8618, 0.0046, 2, 0.12, 0.0769, 608, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " client = actionlib.SimpleActionClient( 'move_base', MoveBaseAction )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L188_C8", "label": "wait_for_server()", "type": "expression", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "vector": [8, 2, 0.8664, 0.0046, 2, 0.12, 0.1538, 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_99358:Assign_L190_C8", "label": "ps = PoseStamped()", "type": "assigned_variable", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "vector": [14, 2, 0.8756, 0.0046, 2, 0.12, 0.2308, 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_99358:Assign_L191_C8", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "vector": [14, 2, 0.8802, 0.0046, 2, 0.12, 0.3077, 293, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ps.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.header.frame_id = '/map'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L192_C8", "label": "ps.header.stamp = Time()", "type": "assigned_variable", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "vector": [14, 2, 0.8848, 0.0046, 2, 0.12, 0.3846, 161, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " ps.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L193_C8", "label": "ps.pose.position.x =", "type": "assigned_variable", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "vector": [14, 2, 0.8894, 0.0046, 2, 0.12, 0.4615, 782, 7, 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 = request.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L194_C8", "label": "ps.pose.position.y =", "type": "assigned_variable", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "vector": [14, 2, 0.894, 0.0046, 2, 0.12, 0.5385, 661, 7, 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 = request.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L195_C8", "label": "ps.pose.orientation = Quaternion()", "type": "assigned_variable", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "vector": [14, 2, 0.8986, 0.0046, 2, 0.12, 0.6154, 670, 3, 1, 0, 0, 747, 10, 2], "semantic": {"name": "ps.pose.orientation", "arg_names": [], "import_names": [], "rhs_call_name": "Quaternion", "annotation": ""}, "snippet": " ps.pose.orientation = Quaternion( *tft.quaternion_from_euler( 0.0, 0.0, request.ang ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L197_C8", "label": "goal = MoveBaseGoal()", "type": "assigned_variable", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "vector": [14, 2, 0.9078, 0.0046, 2, 0.12, 0.6923, 914, 3, 1, 0, 0, 968, 10, 1], "semantic": {"name": "goal", "arg_names": [], "import_names": [], "rhs_call_name": "MoveBaseGoal", "annotation": ""}, "snippet": " goal = MoveBaseGoal( ps )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L198_C8", "label": "send_goal()", "type": "expression", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "vector": [8, 2, 0.9124, 0.0046, 2, 0.12, 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": " client.send_goal( goal )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L199_C8", "label": "logout()", "type": "expression", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "vector": [8, 2, 0.9171, 0.0046, 2, 0.12, 0.8462, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'rotate_backup: Waiting for base to stop moving.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L200_C8", "label": "wait_for_result()", "type": "expression", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "vector": [8, 2, 0.9217, 0.0046, 2, 0.12, 0.9231, 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_99358:Return_L201_C8", "label": "return", "type": "return", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "vector": [13, 2, 0.9263, 0.0046, 2, 0.12, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return int( True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:ClassDef_L204_C0", "label": "RotateBackupClient", "type": "class", "loc": [204, 213], "level": 0, "parent": null, "vector": [3, 0, 0.9608, 0.0461, 0, 0.66, 0.9697, 481, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "RotateBackupClient", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RotateBackupClient():\n def __init__( self, service_name = '/rotate_backup' ):\n rospy.logout( 'rotate_backup_client: Waiting for service: \\'%s\\'' % service_name )\n rospy.wait_for_service( service_name )\n rospy.logout( 'rotate_backup_client: Service ready.' )\n \n self._rb_service = rospy.ServiceProxy( service_name, FloatFloat_Int32 )\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L205_C4", "label": "__init__", "type": "function", "loc": [205, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:ClassDef_L204_C0", "vector": [2, 1, 0.9562, 0.0276, 1, 0.68, 0.0, 555, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "service_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, service_name = '/rotate_backup' ):\n rospy.logout( 'rotate_backup_client: Waiting for service: \\'%s\\'' % service_name )\n rospy.wait_for_service( service_name )\n rospy.logout( 'rotate_backup_client: Service ready.' )\n \n self._rb_service = rospy.ServiceProxy( service_name, FloatFloat_Int32 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L206_C8", "label": "logout()", "type": "expression", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L205_C4", "vector": [8, 2, 0.9493, 0.0046, 2, 0.15, 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( 'rotate_backup_client: Waiting for service: \\'%s\\'' % service_name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L207_C8", "label": "wait_for_service()", "type": "expression", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L205_C4", "vector": [8, 2, 0.9539, 0.0046, 2, 0.15, 0.3333, 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( service_name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L208_C8", "label": "logout()", "type": "expression", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L205_C4", "vector": [8, 2, 0.9585, 0.0046, 2, 0.15, 0.6667, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'rotate_backup_client: Service ready.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L210_C8", "label": "self._rb_service = ServiceProxy()", "type": "assigned_variable", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L205_C4", "vector": [14, 2, 0.9677, 0.0046, 2, 0.15, 1.0, 700, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._rb_service", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._rb_service = rospy.ServiceProxy( service_name, FloatFloat_Int32 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L212_C4", "label": "rotate_backup", "type": "function", "loc": [212, 213], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:ClassDef_L204_C0", "vector": [2, 1, 0.9793, 0.0092, 1, 0.68, 1.0, 878, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "rotate_backup", "arg_names": ["self", "rotate", "displace"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def rotate_backup( self, rotate, displace ):\n return self._rb_service( rotate, displace )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Return_L213_C8", "label": "return", "type": "return", "loc": [213, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L212_C4", "vector": [13, 2, 0.9816, 0.0046, 2, 0.38, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._rb_service( rotate, displace )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:If_L215_C0", "label": "if", "type": "if", "loc": [215, 217], "level": 0, "parent": null, "vector": [4, 0, 0.9954, 0.0138, 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 rb = RotateBackup()\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L216_C4", "label": "rb = RotateBackup()", "type": "assigned_variable", "loc": [216, 216], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:If_L215_C0", "vector": [14, 1, 0.9954, 0.0046, 1, 0.93, 0.0, 815, 3, 0, 0, 0, 827, 10, 1], "semantic": {"name": "rb", "arg_names": [], "import_names": [], "rhs_call_name": "RotateBackup", "annotation": ""}, "snippet": " rb = RotateBackup()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L217_C4", "label": "spin()", "type": "expression", "loc": [217, 217], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99358:If_L215_C0", "vector": [8, 1, 1.0, 0.0046, 1, 0.93, 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_99358:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:If_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:If_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Return_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:If_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Return_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:ClassDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Try_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:Try_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:ClassDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:If_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Return_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:While_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:While_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:While_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:While_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:If_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:If_L74_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L75_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:If_L74_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Return_L76_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:While_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L77_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:While_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:ClassDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:While_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:While_L87_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:While_L87_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:ClassDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Try_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:Try_L97_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:Try_L97_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:Try_L97_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:Try_L97_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Return_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Return_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:ClassDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Return_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:ClassDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Return_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:ClassDef_L204_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:ClassDef_L204_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L212_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:FunctionDef_L212_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Return_L213_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:If_L215_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Assign_L216_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99358:If_L215_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99358:Expr_L217_C4"}]
db = { 'person ': { 'humanread': 'Person', 'img': 'person.jpg' }, 'LightSwitch1': { 'humanread': 'Light Switch', 'img': 'LightSwitch1.jpg' } }
ajibawa-2023/Python-Code-Large/train/row_99359
1
6
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99359:Assign_L1_C0", "label": "db =", "type": "assigned_variable", "loc": [1, 6], "level": 0, "parent": null, "vector": [14, 0, 0.5833, 1.0, 0, 0.66, 0.0, 761, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "db", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "db = {\n 'person ': { 'humanread': 'Person',\n 'img': 'person.jpg' },\n 'LightSwitch1': { 'humanread': 'Light Switch',\n 'img': 'LightSwitch1.jpg' }\n}"}]
[]
import roslib roslib.load_manifest( 'rfid_people_following' ) roslib.load_manifest( 'tf' ) roslib.load_manifest( 'geometry_msgs' ) roslib.load_manifest('hrl_rfid') import rospy from hrl_rfid.msg import RFIDread from hrl_rfid.msg import RFIDreadArr from hrl_rfid.srv import RfidSrv import tf from geometry_msgs.msg import PointStamped import sys, serial, time, string from threading import Thread import friis import pickle as pkl import numpy as np, math # A nice functional print function (Norvig) def prin(x): print x f = open( '/home/travis/svn/data_robot1/rfid_data/pan_captures/model_fit.pkl', 'r' ) d = pkl.load( f ) f.close() def calculate_angle( pt1 ): return np.arctan2( pt1.point.y, pt1.point.x ) class M5e: "Interface to Mercury M5e and M5e-Compact" def __init__(self, portSTR='/dev/robot/RFIDreader', baudrate=9600, TXport=1, RXport=1, readPwr=2300, protocol='GEN2', compact=True, verbosity_func=prin): # verbosity_func should alawys take string as an input. Lets us choose a selective # print function (like rospy.logout) instead of built-in print. self.TXport = TXport # Initialized transmit antenna self.RXport = RXport # Initialized receive antenna self.readPwr = readPwr # Initialized read TX power in centi-dBm self.protocol = protocol # Initialized protocol self.compact = compact self.prin = verbosity_func self.ser = None try: rospy.init_node( 'RFID_Simulator_Friis' ) except rospy.ROSException: pass self.prin( 'Initializing M5e (or M5e-Compact)' ) self.listener = tf.TransformListener() rospy.logout('Simulated M5e: Waiting for odom_combined-antenna tf') self.listener.waitForTransform('/ear_antenna_left', '/odom_combined', rospy.Time(0), timeout = rospy.Duration(100) ) self.listener.waitForTransform('/ear_antenna_right', '/odom_combined', rospy.Time(0), timeout = rospy.Duration(100) ) self.listener.waitForTransform('/left_rotation_center', '/odom_combined', rospy.Time(0), timeout = rospy.Duration(100) ) self.listener.waitForTransform('/right_rotation_center', '/odom_combined', rospy.Time(0), timeout = rospy.Duration(100) ) self.listener.waitForTransform('/base_link', '/odom_combined', rospy.Time(0), timeout = rospy.Duration(100) ) self.listener.waitForTransform('/tag_gt', '/odom_combined', rospy.Time(0), timeout = rospy.Duration(100) ) rospy.logout('Simulated M5e: Transforms ready') self.prin( 'M5e Initialized' ) def ChangeAntennaPorts(self, TXport, RXport): "Changes TX and RX ports" self.TXport = TXport self.RXport = RXport # Currently Unimplemented! def QueryEnvironment(self, timeout=50): rospy.sleep( timeout * 0.001 ) return [] # Relies on a single tag whose coord frame is '/tag_gt' # Lots of hardcoding... boo! def TrackSingleTag(self, tagID, timeout=50): rospy.sleep( timeout * 0.001 ) # 6DOF params -- Calculate these using tf ant_zp = PointStamped() ant_zp.header.stamp = rospy.Time(0) tag_zp = PointStamped() tag_zp.header.stamp = rospy.Time(0) tag_zp.header.frame_id = '/tag_gt' if self.TXport == 1 and self.RXport == 1: # 'EleLeftEar' ear_frame = '/ear_antenna_left' else: # 'EleRightEar' ear_frame = '/ear_antenna_right' ant_zp.header.frame_id = ear_frame # should probably catch exceptions and throw big warnings... tag_in_ant = self.listener.transformPoint( ear_frame, tag_zp ) ant_in_tag = self.listener.transformPoint( '/tag_gt', ant_zp ) tag_in_ant_sphere = np.array( friis.CartToSphere2( tag_in_ant.point.x, tag_in_ant.point.y, tag_in_ant.point.z )) ant_in_tag_sphere = np.array( friis.CartToSphere2( ant_in_tag.point.x, ant_in_tag.point.y, ant_in_tag.point.z )) # Determine Friis Powers Ptag = friis.pwr_inc_tag( tag_in_ant_sphere[0], # radius friis.patch.G, tag_in_ant_sphere[1], tag_in_ant_sphere[2], friis.dipole.G, ant_in_tag_sphere[1], ant_in_tag_sphere[2] ) Prdr = friis.pwr_inc_rdr( tag_in_ant_sphere[0], # radius friis.patch.G, tag_in_ant_sphere[1], tag_in_ant_sphere[2], friis.dipole.G, ant_in_tag_sphere[1], ant_in_tag_sphere[2] ) Prdr_dBm = friis.WattsToDBm( Prdr ) # Calculate expectation (read/no-read and RSSI if applicable) sim_read = Ptag > friis.DBmToWatts( -18.0 ) sim_rssi_ind = np.sum( Prdr_dBm > d['bins'][:-1] ) - 1 sim_rssi_ind = np.clip( sim_rssi_ind, 0, sim_rssi_ind ) # if less than 0 (power lower than in previous data) sim_rssi = d['mean_rssi'][sim_rssi_ind] if sim_read: return int(sim_rssi) # be a little more accurate by returning int else: return -1 # Modeled off lib_M5e.M5e_Poller class ROS_M5e( Thread ): QUERY_MODE = 'query' TRACK_MODE = 'track' def __init__(self, name = 'reader1', readPwr = 2300, portStr = '/dev/robot/RFIDreader', antFuncs = [], callbacks = []): Thread.__init__(self) self.should_run = True try: rospy.init_node( 'rfid_m5e_' + name ) except rospy.ROSException: pass self.mode = '' self.name = name + '_reader' rospy.logout( 'ROS_M5e: Launching RFID Reader' ) rospy.logout( 'ROS_M5e: Please check out our related work @ http://www.hsi.gatech.edu/hrl/project_rfid.shtml' ) rospy.logout( 'ROS_M5e: '+self.name+' Building & Connecting to reader' ) def prin( x ): rospy.logout( 'ROS_M5e: lib_M5e: ' + x ) # use rospy.logout in underlying lib's output self.reader = M5e(readPwr=readPwr, portSTR = portStr, verbosity_func = prin) self.antFuncs = antFuncs self.callbacks = callbacks + [self.broadcast] rospy.logout( 'ROS_M5e: publishing RFID reader with type RFIDread to channel /rfid/'+name+'_reader' ) self.channel = rospy.Publisher('/rfid/'+name+'_reader', RFIDread) self.pub_arr = rospy.Publisher('/rfid/'+name+'_reader_arr', RFIDreadArr) self._mode_service_obj = rospy.Service('/rfid/'+name+'_mode', RfidSrv, self._mode_service) rospy.logout( 'ROS_M5e: '+self.name+' Inialized and awaiting instructions' ) self.start() # Thread: calls self.run() def run( self ): while self.should_run: if self.mode == self.QUERY_MODE: for aF in self.antFuncs: antennaName = aF(self.reader) # let current antFunc make appropriate changes results = self.reader.QueryEnvironment() if len(results) == 0: results = [[ '', -1 ]] # [[ tagid, rssi ], ...] #datum = [antennaName, '', -1] #[cF(datum) for cF in self.callbacks] arr = [] t_now = rospy.Time.now() for tagid, rssi in results: rv = RFIDread( None, antennaName, tagid, rssi ) rv.header.stamp = t_now arr.append( rv ) datum = [antennaName, tagid, rssi] [cF(datum) for cF in self.callbacks] rfid_arr = RFIDreadArr() rfid_arr.header.stamp = t_now rfid_arr.arr = arr self.pub_arr.publish( rfid_arr ) elif self.mode == self.TRACK_MODE: for aF in self.antFuncs: antennaName = aF(self.reader) # let current antFunc make appropriate changes tagid = self.tag_to_track rssi = self.reader.TrackSingleTag(tagid, timeout=100) t_now = rospy.Time.now() rv = RFIDread( None, antennaName, tagid, rssi ) rv.header.stamp = t_now rfid_arr = RFIDreadArr() rfid_arr.header.stamp = t_now rfid_arr.arr = [rv] self.pub_arr.publish( rfid_arr ) #if rssi != -1: datum = [antennaName, tagid, rssi] [cF(datum) for cF in self.callbacks] else: time.sleep(0.005) rospy.logout( 'ROS_M5e: '+self.name+' Shutting down reader' ) def stop( self ): self.should_run = False self.join(3) if (self.isAlive()): raise RuntimeError("ROS_M5e: unable to stop thread") def broadcast(self, data): antName, tagid, rssi = data rv = RFIDread( None, antName, tagid, rssi ) rv.header.stamp = rospy.Time.now() self.channel.publish( rv ) # For internal use only def _mode_service(self, data): val = data.data if len(val) == 0: rospy.logout( 'ROS_M5e: Mode Service called with invalid argument: ' + str(val) ) elif len(val) == 1: if val[0] == self.QUERY_MODE: rospy.logout( 'ROS_M5e: '+self.name+' Entering Query Mode' ) self.mode = self.QUERY_MODE else: rospy.logout( 'ROS_M5e: '+self.name+' Stopping Reader' ) self.mode = '' elif len(val) == 2: if val[0] == self.TRACK_MODE and len(val[1]) == 12: rospy.logout( 'ROS_M5e: '+self.name+' Entering Track Mode: ' + str(val[1]) ) self.mode = self.TRACK_MODE self.tag_to_track = val[1] else: rospy.logout( 'ROS_M5e: Mode Service called with invalid argument: ' + str(val) ) else: rospy.logout( 'ROS_M5e: Mode Service called with invalid argument: ' + str(val) ) return True # ----------------------------------------------- # Likely Callbacks: (various antennas) # ----------------------------------------------- def EleLeftEar(M5e): M5e.ChangeAntennaPorts(1,1) rospy.sleep(0.010) return 'EleLeftEar' def EleRightEar(M5e): M5e.ChangeAntennaPorts(2,2) rospy.sleep(0.010) return 'EleRightEar' def Hand_Right_1(M5e): # GPIO1 = 1, GPIO2 = 0 M5e.TransmitCommand('\x02\x96\x01\x01') M5e.ReceiveResponse() M5e.TransmitCommand('\x02\x96\x02\x00') M5e.ReceiveResponse() return 'Hand_Right_1' def Hand_Right_2(M5e): # GPIO1 = 1, GPIO2 = 1 M5e.TransmitCommand('\x02\x96\x01\x01') M5e.ReceiveResponse() M5e.TransmitCommand('\x02\x96\x02\x01') M5e.ReceiveResponse() return 'Hand_Right_2' def Hand_Left_1(M5e): # GPIO1 = 0, GPIO2 = 0 M5e.TransmitCommand('\x02\x96\x01\x00') M5e.ReceiveResponse() M5e.TransmitCommand('\x02\x96\x02\x00') M5e.ReceiveResponse() return 'Hand_Left_1' def Hand_Left_2(M5e): # GPIO1 = 0, GPIO2 = 1 M5e.TransmitCommand('\x02\x96\x01\x00') M5e.ReceiveResponse() M5e.TransmitCommand('\x02\x96\x02\x01') M5e.ReceiveResponse() return 'Hand_Left_2' def PrintDatum(data): ant, ids, rssi = data print data
ajibawa-2023/Python-Code-Large/train/row_99360
198
304
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0033, 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_99360:Expr_L2_C0", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0066, 0.0033, 0, 0.66, 0.0357, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'rfid_people_following' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0099, 0.0033, 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": "roslib.load_manifest( 'tf' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0132, 0.0033, 0, 0.66, 0.1071, 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_99360:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0164, 0.0033, 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": "roslib.load_manifest('hrl_rfid')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Import_L6_C0", "label": "rospy import rospy", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0197, 0.0033, 0, 0.66, 0.1786, 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_99360:ImportFrom_L8_C0", "label": "from hrl_rfid.msg import RFIDread", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0263, 0.0033, 0, 0.66, 0.2143, 328, 0, 1, 0, 0, 328, 0, 0], "semantic": {"name": "hrl_rfid.msg", "arg_names": [], "import_names": ["RFIDread"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_rfid.msg import RFIDread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:ImportFrom_L9_C0", "label": "from hrl_rfid.msg import RFIDreadArr", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0296, 0.0033, 0, 0.66, 0.25, 328, 0, 1, 0, 0, 328, 0, 0], "semantic": {"name": "hrl_rfid.msg", "arg_names": [], "import_names": ["RFIDreadArr"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_rfid.msg import RFIDreadArr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:ImportFrom_L10_C0", "label": "from hrl_rfid.srv import RfidSrv", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0329, 0.0033, 0, 0.66, 0.2857, 592, 0, 1, 0, 0, 592, 0, 0], "semantic": {"name": "hrl_rfid.srv", "arg_names": [], "import_names": ["RfidSrv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_rfid.srv import RfidSrv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Import_L11_C0", "label": "tf import tf", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0362, 0.0033, 0, 0.66, 0.3214, 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_99360:ImportFrom_L12_C0", "label": "from geometry_msgs.msg import PointStamped", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0395, 0.0033, 0, 0.66, 0.3571, 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_99360:Import_L14_C0", "label": "sys import sys, serial, time\u2026", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0461, 0.0033, 0, 0.66, 0.3929, 509, 0, 4, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "serial", "time", "string"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, serial, time, string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:ImportFrom_L15_C0", "label": "from threading import Thread", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0493, 0.0033, 0, 0.66, 0.4286, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["Thread"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import Thread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Import_L16_C0", "label": "friis import friis", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0033, 0, 0.66, 0.4643, 769, 0, 1, 0, 0, 769, 0, 0], "semantic": {"name": "friis", "arg_names": [], "import_names": ["friis"], "rhs_call_name": "", "annotation": ""}, "snippet": "import friis"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Import_L17_C0", "label": "pickle import pkl", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0559, 0.0033, 0, 0.66, 0.5, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "pickle", "arg_names": [], "import_names": ["pkl"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pickle as pkl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Import_L18_C0", "label": "numpy import np, math", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0592, 0.0033, 0, 0.66, 0.5357, 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_99360:Assign_L22_C0", "label": "f = open()", "type": "assigned_variable", "loc": [22, 22], "level": 0, "parent": null, "vector": [14, 0, 0.0724, 0.0033, 0, 0.66, 0.5714, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "f = open( '/home/travis/svn/data_robot1/rfid_data/pan_captures/model_fit.pkl', 'r' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L23_C0", "label": "d = load()", "type": "assigned_variable", "loc": [23, 23], "level": 0, "parent": null, "vector": [14, 0, 0.0757, 0.0033, 0, 0.66, 0.6071, 355, 3, 1, 0, 0, 37, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "d = pkl.load( f )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L24_C0", "label": "close()", "type": "expression", "loc": [24, 24], "level": 0, "parent": null, "vector": [8, 0, 0.0789, 0.0033, 0, 0.66, 0.6429, 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_99360:FunctionDef_L26_C0", "label": "calculate_angle", "type": "function", "loc": [26, 27], "level": 0, "parent": null, "vector": [2, 0, 0.0872, 0.0066, 0, 0.66, 0.6786, 793, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "calculate_angle", "arg_names": ["pt1"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def calculate_angle( pt1 ):\n return np.arctan2( pt1.point.y, pt1.point.x )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Return_L27_C4", "label": "return", "type": "return", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L26_C0", "vector": [13, 1, 0.0888, 0.0033, 1, 0.27, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.arctan2( pt1.point.y, pt1.point.x )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L29_C0", "label": "M5e", "type": "class", "loc": [29, 131], "level": 0, "parent": null, "vector": [3, 0, 0.2632, 0.3388, 0, 0.66, 0.7143, 931, 0, 4, 0, 0, 0, 0, 43], "semantic": {"name": "M5e", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class M5e:\n \"Interface to Mercury M5e and M5e-Compact\"\n def __init__(self, portSTR='/dev/robot/RFIDreader', baudrate=9600, \n TXport=1, RXport=1, readPwr=2300, protocol='GEN2', compact=True, verbosity_func=prin):\n\n # verbosity_func should alawys take string as an input. Lets us choose a selective \n # print function (like rospy.logout) instead of built-in print.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L30_C4", "label": "expression", "type": "expression", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L29_C0", "vector": [8, 1, 0.0987, 0.0033, 1, 0.83, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Interface to Mercury M5e and M5e-Compact\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "label": "__init__", "type": "function", "loc": [31, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L29_C0", "vector": [2, 1, 0.1612, 0.1217, 1, 0.83, 0.25, 555, 0, 9, 0, 0, 0, 0, 24], "semantic": {"name": "__init__", "arg_names": ["self", "portSTR", "baudrate", "TXport", "RXport", "readPwr", "protocol", "compact", "verbosity_func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, portSTR='/dev/robot/RFIDreader', baudrate=9600, \n TXport=1, RXport=1, readPwr=2300, protocol='GEN2', compact=True, verbosity_func=prin):\n\n # verbosity_func should alawys take string as an input. Lets us choose a selective \n # print function (like rospy.logout) instead of built-in print.\n\n self.TXport = TXport # Initialized transmit antenna\n self.RXport = RXport # Initialized receive antenna"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L37_C8", "label": "self.TXport =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "vector": [14, 2, 0.1217, 0.0033, 2, 0.78, 0.0, 285, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.TXport", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.TXport = TXport # Initialized transmit antenna"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L38_C8", "label": "self.RXport =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "vector": [14, 2, 0.125, 0.0033, 2, 0.78, 0.0556, 401, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.RXport", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.RXport = RXport # Initialized receive antenna"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L39_C8", "label": "self.readPwr =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "vector": [14, 2, 0.1283, 0.0033, 2, 0.78, 0.1111, 880, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.readPwr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.readPwr = readPwr # Initialized read TX power in centi-dBm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L40_C8", "label": "self.protocol =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "vector": [14, 2, 0.1316, 0.0033, 2, 0.78, 0.1667, 581, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.protocol", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.protocol = protocol # Initialized protocol"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L41_C8", "label": "self.compact =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "vector": [14, 2, 0.1349, 0.0033, 2, 0.78, 0.2222, 733, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.compact", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.compact = compact"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L42_C8", "label": "self.prin =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "vector": [14, 2, 0.1382, 0.0033, 2, 0.78, 0.2778, 402, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.prin", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.prin = verbosity_func"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L43_C8", "label": "self.ser =", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "vector": [14, 2, 0.1414, 0.0033, 2, 0.78, 0.3333, 165, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.ser", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ser = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Try_L45_C8", "label": "try", "type": "try", "loc": [45, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "vector": [7, 2, 0.153, 0.0132, 2, 0.78, 0.3889, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node( 'RFID_Simulator_Friis' )\n except rospy.ROSException:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L46_C12", "label": "init_node()", "type": "expression", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:Try_L45_C8", "vector": [8, 3, 0.1513, 0.0033, 3, 0.28, 0.0, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node( 'RFID_Simulator_Friis' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L50_C8", "label": "prin()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "vector": [8, 2, 0.1645, 0.0033, 2, 0.78, 0.4444, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "prin", "arg_names": [], "import_names": [], "rhs_call_name": "prin", "annotation": ""}, "snippet": " self.prin( 'Initializing M5e (or M5e-Compact)' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L51_C8", "label": "self.listener = TransformListener()", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "vector": [14, 2, 0.1678, 0.0033, 2, 0.78, 0.5, 686, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.listener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L53_C8", "label": "logout()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "vector": [8, 2, 0.1743, 0.0033, 2, 0.78, 0.5556, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('Simulated M5e: Waiting for odom_combined-antenna tf')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L54_C8", "label": "waitForTransform()", "type": "expression", "loc": [54, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "vector": [8, 2, 0.1793, 0.0066, 2, 0.78, 0.6111, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.listener.waitForTransform('/ear_antenna_left', '/odom_combined',\n rospy.Time(0), timeout = rospy.Duration(100) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L56_C8", "label": "waitForTransform()", "type": "expression", "loc": [56, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "vector": [8, 2, 0.1859, 0.0066, 2, 0.78, 0.6667, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.listener.waitForTransform('/ear_antenna_right', '/odom_combined',\n rospy.Time(0), timeout = rospy.Duration(100) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L58_C8", "label": "waitForTransform()", "type": "expression", "loc": [58, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "vector": [8, 2, 0.1924, 0.0066, 2, 0.78, 0.7222, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.listener.waitForTransform('/left_rotation_center', '/odom_combined',\n rospy.Time(0), timeout = rospy.Duration(100) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L60_C8", "label": "waitForTransform()", "type": "expression", "loc": [60, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "vector": [8, 2, 0.199, 0.0066, 2, 0.78, 0.7778, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.listener.waitForTransform('/right_rotation_center', '/odom_combined',\n rospy.Time(0), timeout = rospy.Duration(100) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L62_C8", "label": "waitForTransform()", "type": "expression", "loc": [62, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "vector": [8, 2, 0.2056, 0.0066, 2, 0.78, 0.8333, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.listener.waitForTransform('/base_link', '/odom_combined',\n rospy.Time(0), timeout = rospy.Duration(100) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L64_C8", "label": "waitForTransform()", "type": "expression", "loc": [64, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "vector": [8, 2, 0.2122, 0.0066, 2, 0.78, 0.8889, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.listener.waitForTransform('/tag_gt', '/odom_combined',\n rospy.Time(0), timeout = rospy.Duration(100) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L66_C8", "label": "logout()", "type": "expression", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "vector": [8, 2, 0.2171, 0.0033, 2, 0.78, 0.9444, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('Simulated M5e: Transforms ready')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L67_C8", "label": "prin()", "type": "expression", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "vector": [8, 2, 0.2204, 0.0033, 2, 0.78, 1.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "prin", "arg_names": [], "import_names": [], "rhs_call_name": "prin", "annotation": ""}, "snippet": " self.prin( 'M5e Initialized' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L70_C4", "label": "ChangeAntennaPorts", "type": "function", "loc": [70, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L29_C0", "vector": [2, 1, 0.2352, 0.0132, 1, 0.83, 0.5, 901, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "ChangeAntennaPorts", "arg_names": ["self", "TXport", "RXport"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def ChangeAntennaPorts(self, TXport, RXport):\n \"Changes TX and RX ports\"\n self.TXport = TXport\n self.RXport = RXport"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L71_C8", "label": "expression", "type": "expression", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L70_C4", "vector": [8, 2, 0.2336, 0.0033, 2, 0.82, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Changes TX and RX ports\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L72_C8", "label": "self.TXport =", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L70_C4", "vector": [14, 2, 0.2368, 0.0033, 2, 0.82, 0.5, 285, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.TXport", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.TXport = TXport"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L73_C8", "label": "self.RXport =", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L70_C4", "vector": [14, 2, 0.2401, 0.0033, 2, 0.82, 1.0, 401, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.RXport", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.RXport = RXport"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L76_C4", "label": "QueryEnvironment", "type": "function", "loc": [76, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L29_C0", "vector": [2, 1, 0.2533, 0.0099, 1, 0.83, 0.75, 496, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "QueryEnvironment", "arg_names": ["self", "timeout"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def QueryEnvironment(self, timeout=50):\n rospy.sleep( timeout * 0.001 )\n return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L77_C8", "label": "sleep()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L76_C4", "vector": [8, 2, 0.2533, 0.0033, 2, 0.16, 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( timeout * 0.001 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Return_L78_C8", "label": "return", "type": "return", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L76_C4", "vector": [13, 2, 0.2566, 0.0033, 2, 0.16, 1.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "label": "TrackSingleTag", "type": "function", "loc": [82, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L29_C0", "vector": [2, 1, 0.3503, 0.1645, 1, 0.83, 1.0, 782, 0, 3, 1, 0, 0, 0, 18], "semantic": {"name": "TrackSingleTag", "arg_names": ["self", "tagID", "timeout"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def TrackSingleTag(self, tagID, timeout=50):\n rospy.sleep( timeout * 0.001 )\n\n # 6DOF params -- Calculate these using tf\n ant_zp = PointStamped()\n ant_zp.header.stamp = rospy.Time(0)\n\n tag_zp = PointStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L83_C8", "label": "sleep()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "vector": [8, 2, 0.273, 0.0033, 2, 0.94, 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( timeout * 0.001 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L86_C8", "label": "ant_zp = PointStamped()", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "vector": [14, 2, 0.2829, 0.0033, 2, 0.94, 0.0526, 262, 3, 0, 0, 0, 969, 10, 1], "semantic": {"name": "ant_zp", "arg_names": [], "import_names": [], "rhs_call_name": "PointStamped", "annotation": ""}, "snippet": " ant_zp = PointStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L87_C8", "label": "ant_zp.header.stamp = Time()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "vector": [14, 2, 0.2862, 0.0033, 2, 0.94, 0.1053, 387, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "ant_zp.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " ant_zp.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L89_C8", "label": "tag_zp = PointStamped()", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "vector": [14, 2, 0.2928, 0.0033, 2, 0.94, 0.1579, 969, 3, 0, 0, 0, 969, 10, 1], "semantic": {"name": "tag_zp", "arg_names": [], "import_names": [], "rhs_call_name": "PointStamped", "annotation": ""}, "snippet": " tag_zp = PointStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L90_C8", "label": "tag_zp.header.stamp = Time()", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "vector": [14, 2, 0.2961, 0.0033, 2, 0.94, 0.2105, 482, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "tag_zp.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " tag_zp.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L91_C8", "label": "tag_zp.header.frame_id =", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "vector": [14, 2, 0.2993, 0.0033, 2, 0.94, 0.2632, 435, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "tag_zp.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tag_zp.header.frame_id = '/tag_gt'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L93_C8", "label": "if", "type": "if", "loc": [93, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "vector": [4, 2, 0.3109, 0.0132, 2, 0.94, 0.3158, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.TXport == 1 and self.RXport == 1: # 'EleLeftEar'\n ear_frame = '/ear_antenna_left'\n else: # 'EleRightEar'\n ear_frame = '/ear_antenna_right'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L94_C12", "label": "ear_frame =", "type": "assigned_variable", "loc": [94, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L93_C8", "vector": [14, 3, 0.3092, 0.0033, 3, 0.95, 0.0, 242, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ear_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ear_frame = '/ear_antenna_left'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L96_C12", "label": "ear_frame =", "type": "assigned_variable", "loc": [96, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L93_C8", "vector": [14, 3, 0.3158, 0.0033, 3, 0.95, 1.0, 242, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ear_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ear_frame = '/ear_antenna_right'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L98_C8", "label": "ant_zp.header.frame_id =", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "vector": [14, 2, 0.3224, 0.0033, 2, 0.94, 0.3684, 389, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ant_zp.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ant_zp.header.frame_id = ear_frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L101_C8", "label": "tag_in_ant = transformPoint()", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "vector": [14, 2, 0.3322, 0.0033, 2, 0.94, 0.4211, 455, 3, 2, 0, 0, 987, 10, 1], "semantic": {"name": "tag_in_ant", "arg_names": [], "import_names": [], "rhs_call_name": "transformPoint", "annotation": ""}, "snippet": " tag_in_ant = self.listener.transformPoint( ear_frame, tag_zp )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L102_C8", "label": "ant_in_tag = transformPoint()", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "vector": [14, 2, 0.3355, 0.0033, 2, 0.94, 0.4737, 63, 3, 2, 0, 0, 987, 10, 1], "semantic": {"name": "ant_in_tag", "arg_names": [], "import_names": [], "rhs_call_name": "transformPoint", "annotation": ""}, "snippet": " ant_in_tag = self.listener.transformPoint( '/tag_gt', ant_zp )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L105_C8", "label": "tag_in_ant_sphere = array()", "type": "assigned_variable", "loc": [105, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "vector": [14, 2, 0.3487, 0.0099, 2, 0.94, 0.5263, 143, 3, 1, 0, 0, 80, 10, 2], "semantic": {"name": "tag_in_ant_sphere", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " tag_in_ant_sphere = np.array( friis.CartToSphere2( tag_in_ant.point.x,\n tag_in_ant.point.y,\n tag_in_ant.point.z ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L108_C8", "label": "ant_in_tag_sphere = array()", "type": "assigned_variable", "loc": [108, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "vector": [14, 2, 0.3586, 0.0099, 2, 0.94, 0.5789, 425, 3, 1, 0, 0, 80, 10, 2], "semantic": {"name": "ant_in_tag_sphere", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " ant_in_tag_sphere = np.array( friis.CartToSphere2( ant_in_tag.point.x,\n ant_in_tag.point.y,\n ant_in_tag.point.z ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L114_C8", "label": "Ptag = pwr_inc_tag()", "type": "assigned_variable", "loc": [114, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "vector": [14, 2, 0.3783, 0.0099, 2, 0.94, 0.6316, 219, 3, 7, 0, 0, 455, 10, 1], "semantic": {"name": "Ptag", "arg_names": [], "import_names": [], "rhs_call_name": "pwr_inc_tag", "annotation": ""}, "snippet": " Ptag = friis.pwr_inc_tag( tag_in_ant_sphere[0], # radius\n friis.patch.G, tag_in_ant_sphere[1], tag_in_ant_sphere[2],\n friis.dipole.G, ant_in_tag_sphere[1], ant_in_tag_sphere[2] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L117_C8", "label": "Prdr = pwr_inc_rdr()", "type": "assigned_variable", "loc": [117, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "vector": [14, 2, 0.3882, 0.0099, 2, 0.94, 0.6842, 896, 3, 7, 0, 0, 503, 10, 1], "semantic": {"name": "Prdr", "arg_names": [], "import_names": [], "rhs_call_name": "pwr_inc_rdr", "annotation": ""}, "snippet": " Prdr = friis.pwr_inc_rdr( tag_in_ant_sphere[0], # radius\n friis.patch.G, tag_in_ant_sphere[1], tag_in_ant_sphere[2],\n friis.dipole.G, ant_in_tag_sphere[1], ant_in_tag_sphere[2] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L120_C8", "label": "Prdr_dBm = WattsToDBm()", "type": "assigned_variable", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "vector": [14, 2, 0.3947, 0.0033, 2, 0.94, 0.7368, 298, 3, 1, 0, 0, 378, 10, 1], "semantic": {"name": "Prdr_dBm", "arg_names": [], "import_names": [], "rhs_call_name": "WattsToDBm", "annotation": ""}, "snippet": " Prdr_dBm = friis.WattsToDBm( Prdr )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L123_C8", "label": "sim_read =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "vector": [14, 2, 0.4046, 0.0033, 2, 0.94, 0.7895, 885, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sim_read", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sim_read = Ptag > friis.DBmToWatts( -18.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L124_C8", "label": "sim_rssi_ind =", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "vector": [14, 2, 0.4079, 0.0033, 2, 0.94, 0.8421, 350, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sim_rssi_ind", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sim_rssi_ind = np.sum( Prdr_dBm > d['bins'][:-1] ) - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L125_C8", "label": "sim_rssi_ind = clip()", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "vector": [14, 2, 0.4112, 0.0033, 2, 0.94, 0.8947, 350, 3, 3, 0, 0, 689, 10, 1], "semantic": {"name": "sim_rssi_ind", "arg_names": [], "import_names": [], "rhs_call_name": "clip", "annotation": ""}, "snippet": " sim_rssi_ind = np.clip( sim_rssi_ind, 0, sim_rssi_ind ) # if less than 0 (power lower than in previous data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L126_C8", "label": "sim_rssi =", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "vector": [14, 2, 0.4145, 0.0033, 2, 0.94, 0.9474, 351, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sim_rssi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sim_rssi = d['mean_rssi'][sim_rssi_ind]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L128_C8", "label": "if", "type": "if", "loc": [128, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "vector": [4, 2, 0.426, 0.0132, 2, 0.94, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sim_read:\n return int(sim_rssi) # be a little more accurate by returning int\n else:\n return -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Return_L129_C12", "label": "return", "type": "return", "loc": [129, 129], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L128_C8", "vector": [13, 3, 0.4243, 0.0033, 3, 0.26, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return int(sim_rssi) # be a little more accurate by returning int"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Return_L131_C12", "label": "return", "type": "return", "loc": [131, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L128_C8", "vector": [13, 3, 0.4309, 0.0033, 3, 0.26, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L137_C0", "label": "ROS_M5e", "type": "class", "loc": [137, 251], "level": 0, "parent": null, "vector": [3, 0, 0.6382, 0.3783, 0, 0.66, 0.75, 65, 0, 6, 0, 0, 134, 0, 51], "semantic": {"name": "ROS_M5e", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ROS_M5e( Thread ):\n QUERY_MODE = 'query'\n TRACK_MODE = 'track'\n \n def __init__(self, name = 'reader1', readPwr = 2300,\n portStr = '/dev/robot/RFIDreader',\n antFuncs = [], callbacks = []):\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L138_C4", "label": "QUERY_MODE =", "type": "assigned_variable", "loc": [138, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L137_C0", "vector": [14, 1, 0.4539, 0.0033, 1, 0.76, 0.0, 353, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "QUERY_MODE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " QUERY_MODE = 'query'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L139_C4", "label": "TRACK_MODE =", "type": "assigned_variable", "loc": [139, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L137_C0", "vector": [14, 1, 0.4572, 0.0033, 1, 0.76, 0.1667, 197, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TRACK_MODE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " TRACK_MODE = 'track'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "label": "__init__", "type": "function", "loc": [141, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L137_C0", "vector": [2, 1, 0.5181, 0.1118, 1, 0.76, 0.3333, 555, 0, 6, 0, 0, 0, 0, 13], "semantic": {"name": "__init__", "arg_names": ["self", "name", "readPwr", "portStr", "antFuncs", "callbacks"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, name = 'reader1', readPwr = 2300,\n portStr = '/dev/robot/RFIDreader',\n antFuncs = [], callbacks = []):\n\n Thread.__init__(self)\n self.should_run = True\n\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L145_C8", "label": "__init__()", "type": "expression", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "vector": [8, 2, 0.477, 0.0033, 2, 0.97, 0.0, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Thread.__init__(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L146_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "vector": [14, 2, 0.4803, 0.0033, 2, 0.97, 0.0588, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Try_L148_C8", "label": "try", "type": "try", "loc": [148, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "vector": [7, 2, 0.4918, 0.0132, 2, 0.97, 0.1176, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node( 'rfid_m5e_' + name )\n except rospy.ROSException:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L149_C12", "label": "init_node()", "type": "expression", "loc": [149, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:Try_L148_C8", "vector": [8, 3, 0.4901, 0.0033, 3, 0.98, 0.0, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node( 'rfid_m5e_' + name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L153_C8", "label": "self.mode =", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "vector": [14, 2, 0.5033, 0.0033, 2, 0.97, 0.1765, 474, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.mode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mode = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L154_C8", "label": "self.name =", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "vector": [14, 2, 0.5066, 0.0033, 2, 0.97, 0.2353, 689, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = name + '_reader'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L156_C8", "label": "logout()", "type": "expression", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "vector": [8, 2, 0.5132, 0.0033, 2, 0.97, 0.2941, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'ROS_M5e: Launching RFID Reader' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L157_C8", "label": "logout()", "type": "expression", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "vector": [8, 2, 0.5164, 0.0033, 2, 0.97, 0.3529, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'ROS_M5e: Please check out our related work @ http://www.hsi.gatech.edu/hrl/project_rfid.shtml' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L158_C8", "label": "logout()", "type": "expression", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "vector": [8, 2, 0.5197, 0.0033, 2, 0.97, 0.4118, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'ROS_M5e: '+self.name+' Building & Connecting to reader' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L160_C8", "label": "prin", "type": "function", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "vector": [2, 2, 0.5263, 0.0033, 2, 0.97, 0.4706, 607, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "prin", "arg_names": ["x"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def prin( x ): rospy.logout( 'ROS_M5e: lib_M5e: ' + x ) # use rospy.logout in underlying lib's output"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L160_C23", "label": "logout()", "type": "expression", "loc": [160, 160], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L160_C8", "vector": [8, 3, 0.5263, 0.0033, 3, 0.8, 0.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " def prin( x ): rospy.logout( 'ROS_M5e: lib_M5e: ' + x ) # use rospy.logout in underlying lib's output"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L162_C8", "label": "self.reader = M5e()", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "vector": [14, 2, 0.5329, 0.0033, 2, 0.97, 0.5294, 536, 3, 3, 0, 0, 931, 10, 1], "semantic": {"name": "self.reader", "arg_names": [], "import_names": [], "rhs_call_name": "M5e", "annotation": ""}, "snippet": " self.reader = M5e(readPwr=readPwr, portSTR = portStr, verbosity_func = prin)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L163_C8", "label": "self.antFuncs =", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "vector": [14, 2, 0.5362, 0.0033, 2, 0.97, 0.5882, 516, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.antFuncs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.antFuncs = antFuncs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L164_C8", "label": "self.callbacks =", "type": "assigned_variable", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "vector": [14, 2, 0.5395, 0.0033, 2, 0.97, 0.6471, 264, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.callbacks", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.callbacks = callbacks + [self.broadcast]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L166_C8", "label": "logout()", "type": "expression", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "vector": [8, 2, 0.5461, 0.0033, 2, 0.97, 0.7059, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'ROS_M5e: publishing RFID reader with type RFIDread to channel /rfid/'+name+'_reader' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L167_C8", "label": "self.channel = Publisher()", "type": "assigned_variable", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "vector": [14, 2, 0.5493, 0.0033, 2, 0.97, 0.7647, 503, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.channel", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.channel = rospy.Publisher('/rfid/'+name+'_reader', RFIDread)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L168_C8", "label": "self.pub_arr = Publisher()", "type": "assigned_variable", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "vector": [14, 2, 0.5526, 0.0033, 2, 0.97, 0.8235, 27, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.pub_arr", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.pub_arr = rospy.Publisher('/rfid/'+name+'_reader_arr', RFIDreadArr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L169_C8", "label": "self._mode_service_obj = Service()", "type": "assigned_variable", "loc": [169, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "vector": [14, 2, 0.5576, 0.0066, 2, 0.97, 0.8824, 356, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self._mode_service_obj", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self._mode_service_obj = rospy.Service('/rfid/'+name+'_mode',\n RfidSrv, self._mode_service)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L172_C8", "label": "logout()", "type": "expression", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "vector": [8, 2, 0.5658, 0.0033, 2, 0.97, 0.9412, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'ROS_M5e: '+self.name+' Inialized and awaiting instructions' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L174_C8", "label": "start()", "type": "expression", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "vector": [8, 2, 0.5724, 0.0033, 2, 0.97, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.start() # Thread: calls self.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L176_C4", "label": "run", "type": "function", "loc": [176, 216], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L137_C0", "vector": [2, 1, 0.6447, 0.1349, 1, 0.76, 0.5, 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 while self.should_run:\n if self.mode == self.QUERY_MODE:\n for aF in self.antFuncs:\n antennaName = aF(self.reader) # let current antFunc make appropriate changes\n results = self.reader.QueryEnvironment()\n if len(results) == 0:\n results = [[ '', -1 ]] # [[ tagid, rssi ], ...]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:While_L177_C8", "label": "while", "type": "while", "loc": [177, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L176_C4", "vector": [5, 2, 0.6431, 0.125, 2, 0.11, 0.0, 0, 7, 0, 0, 0, 0, 0, 17], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.should_run:\n if self.mode == self.QUERY_MODE:\n for aF in self.antFuncs:\n antennaName = aF(self.reader) # let current antFunc make appropriate changes\n results = self.reader.QueryEnvironment()\n if len(results) == 0:\n results = [[ '', -1 ]] # [[ tagid, rssi ], ...]\n #datum = [antennaName, '', -1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L178_C12", "label": "if", "type": "if", "loc": [178, 214], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:While_L177_C8", "vector": [4, 3, 0.6447, 0.1217, 3, 0.7, 0.0, 0, 0, 0, 0, 0, 0, 0, 17], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.mode == self.QUERY_MODE:\n for aF in self.antFuncs:\n antennaName = aF(self.reader) # let current antFunc make appropriate changes\n results = self.reader.QueryEnvironment()\n if len(results) == 0:\n results = [[ '', -1 ]] # [[ tagid, rssi ], ...]\n #datum = [antennaName, '', -1]\n #[cF(datum) for cF in self.callbacks]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L179_C16", "label": "for aF", "type": "for", "loc": [179, 197], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L178_C12", "vector": [6, 4, 0.6184, 0.0625, 4, 0.81, 0.0, 36, 7, 0, 0, 0, 0, 0, 9], "semantic": {"name": "aF", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for aF in self.antFuncs:\n antennaName = aF(self.reader) # let current antFunc make appropriate changes\n results = self.reader.QueryEnvironment()\n if len(results) == 0:\n results = [[ '', -1 ]] # [[ tagid, rssi ], ...]\n #datum = [antennaName, '', -1]\n #[cF(datum) for cF in self.callbacks]\n arr = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L180_C20", "label": "antennaName = aF()", "type": "assigned_variable", "loc": [180, 180], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L179_C16", "vector": [14, 5, 0.5921, 0.0033, 5, 0.49, 0.0, 713, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "antennaName", "arg_names": [], "import_names": [], "rhs_call_name": "aF", "annotation": ""}, "snippet": " antennaName = aF(self.reader) # let current antFunc make appropriate changes"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L181_C20", "label": "results = QueryEnvironment()", "type": "assigned_variable", "loc": [181, 181], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L179_C16", "vector": [14, 5, 0.5954, 0.0033, 5, 0.49, 0.1111, 143, 3, 0, 0, 0, 496, 10, 1], "semantic": {"name": "results", "arg_names": [], "import_names": [], "rhs_call_name": "QueryEnvironment", "annotation": ""}, "snippet": " results = self.reader.QueryEnvironment()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L182_C20", "label": "if", "type": "if", "loc": [182, 183], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L179_C16", "vector": [4, 5, 0.6003, 0.0066, 5, 0.49, 0.2222, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(results) == 0:\n results = [[ '', -1 ]] # [[ tagid, rssi ], ...]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L183_C24", "label": "results =", "type": "assigned_variable", "loc": [183, 183], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L182_C20", "vector": [14, 6, 0.602, 0.0033, 6, 0.41, 0.0, 143, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "results", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " results = [[ '', -1 ]] # [[ tagid, rssi ], ...]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L186_C20", "label": "arr =", "type": "assigned_variable", "loc": [186, 186], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L179_C16", "vector": [14, 5, 0.6118, 0.0033, 5, 0.49, 0.3333, 395, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arr = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L187_C20", "label": "t_now = now()", "type": "assigned_variable", "loc": [187, 187], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L179_C16", "vector": [14, 5, 0.6151, 0.0033, 5, 0.49, 0.4444, 23, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "t_now", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " t_now = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L188_C20", "label": "for tagid, rssi", "type": "for", "loc": [188, 193], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L179_C16", "vector": [6, 5, 0.6266, 0.0197, 5, 0.49, 0.5556, 398, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "tagid, rssi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for tagid, rssi in results:\n rv = RFIDread( None, antennaName, tagid, rssi )\n rv.header.stamp = t_now\n arr.append( rv )\n datum = [antennaName, tagid, rssi]\n [cF(datum) for cF in self.callbacks]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L189_C24", "label": "rv = RFIDread()", "type": "assigned_variable", "loc": [189, 189], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L188_C20", "vector": [14, 6, 0.6217, 0.0033, 6, 0.87, 0.0, 222, 3, 4, 0, 0, 624, 10, 1], "semantic": {"name": "rv", "arg_names": [], "import_names": [], "rhs_call_name": "RFIDread", "annotation": ""}, "snippet": " rv = RFIDread( None, antennaName, tagid, rssi )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L190_C24", "label": "rv.header.stamp =", "type": "assigned_variable", "loc": [190, 190], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L188_C20", "vector": [14, 6, 0.625, 0.0033, 6, 0.87, 0.25, 13, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rv.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rv.header.stamp = t_now"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L191_C24", "label": "append()", "type": "expression", "loc": [191, 191], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L188_C20", "vector": [8, 6, 0.6283, 0.0033, 6, 0.87, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " arr.append( rv )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L192_C24", "label": "datum =", "type": "assigned_variable", "loc": [192, 192], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L188_C20", "vector": [14, 6, 0.6316, 0.0033, 6, 0.87, 0.75, 975, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "datum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " datum = [antennaName, tagid, rssi]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L193_C24", "label": "expression", "type": "expression", "loc": [193, 193], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L188_C20", "vector": [8, 6, 0.6349, 0.0033, 6, 0.87, 1.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " [cF(datum) for cF in self.callbacks]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L194_C20", "label": "rfid_arr = RFIDreadArr()", "type": "assigned_variable", "loc": [194, 194], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L179_C16", "vector": [14, 5, 0.6382, 0.0033, 5, 0.49, 0.6667, 272, 3, 0, 0, 0, 80, 10, 1], "semantic": {"name": "rfid_arr", "arg_names": [], "import_names": [], "rhs_call_name": "RFIDreadArr", "annotation": ""}, "snippet": " rfid_arr = RFIDreadArr()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L195_C20", "label": "rfid_arr.header.stamp =", "type": "assigned_variable", "loc": [195, 195], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L179_C16", "vector": [14, 5, 0.6414, 0.0033, 5, 0.49, 0.7778, 144, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rfid_arr.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rfid_arr.header.stamp = t_now"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L196_C20", "label": "rfid_arr.arr =", "type": "assigned_variable", "loc": [196, 196], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L179_C16", "vector": [14, 5, 0.6447, 0.0033, 5, 0.49, 0.8889, 694, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rfid_arr.arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rfid_arr.arr = arr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L197_C20", "label": "publish()", "type": "expression", "loc": [197, 197], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L179_C16", "vector": [8, 5, 0.648, 0.0033, 5, 0.49, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.pub_arr.publish( rfid_arr )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L198_C12", "label": "if", "type": "if", "loc": [198, 214], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L178_C12", "vector": [4, 4, 0.6776, 0.0559, 4, 0.81, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self.mode == self.TRACK_MODE:\n for aF in self.antFuncs:\n antennaName = aF(self.reader) # let current antFunc make appropriate changes\n tagid = self.tag_to_track\n rssi = self.reader.TrackSingleTag(tagid, timeout=100)\n t_now = rospy.Time.now()\n rv = RFIDread( None, antennaName, tagid, rssi )\n rv.header.stamp = t_now"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "label": "for aF", "type": "for", "loc": [199, 212], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L198_C12", "vector": [6, 5, 0.676, 0.0461, 5, 0.33, 0.0, 36, 7, 0, 0, 0, 0, 0, 7], "semantic": {"name": "aF", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for aF in self.antFuncs:\n antennaName = aF(self.reader) # let current antFunc make appropriate changes\n tagid = self.tag_to_track\n rssi = self.reader.TrackSingleTag(tagid, timeout=100)\n t_now = rospy.Time.now()\n rv = RFIDread( None, antennaName, tagid, rssi )\n rv.header.stamp = t_now\n rfid_arr = RFIDreadArr()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L200_C20", "label": "antennaName = aF()", "type": "assigned_variable", "loc": [200, 200], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "vector": [14, 6, 0.6579, 0.0033, 6, 0.55, 0.0, 713, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "antennaName", "arg_names": [], "import_names": [], "rhs_call_name": "aF", "annotation": ""}, "snippet": " antennaName = aF(self.reader) # let current antFunc make appropriate changes"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L201_C20", "label": "tagid =", "type": "assigned_variable", "loc": [201, 201], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "vector": [14, 6, 0.6612, 0.0033, 6, 0.55, 0.0909, 538, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tagid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tagid = self.tag_to_track"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L202_C20", "label": "rssi = TrackSingleTag()", "type": "assigned_variable", "loc": [202, 202], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "vector": [14, 6, 0.6645, 0.0033, 6, 0.55, 0.1818, 906, 3, 2, 0, 0, 782, 10, 1], "semantic": {"name": "rssi", "arg_names": [], "import_names": [], "rhs_call_name": "TrackSingleTag", "annotation": ""}, "snippet": " rssi = self.reader.TrackSingleTag(tagid, timeout=100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L203_C20", "label": "t_now = now()", "type": "assigned_variable", "loc": [203, 203], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "vector": [14, 6, 0.6678, 0.0033, 6, 0.55, 0.2727, 23, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "t_now", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " t_now = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L204_C20", "label": "rv = RFIDread()", "type": "assigned_variable", "loc": [204, 204], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "vector": [14, 6, 0.6711, 0.0033, 6, 0.55, 0.3636, 222, 3, 4, 0, 0, 624, 10, 1], "semantic": {"name": "rv", "arg_names": [], "import_names": [], "rhs_call_name": "RFIDread", "annotation": ""}, "snippet": " rv = RFIDread( None, antennaName, tagid, rssi )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L205_C20", "label": "rv.header.stamp =", "type": "assigned_variable", "loc": [205, 205], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "vector": [14, 6, 0.6743, 0.0033, 6, 0.55, 0.4545, 13, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rv.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rv.header.stamp = t_now"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L206_C20", "label": "rfid_arr = RFIDreadArr()", "type": "assigned_variable", "loc": [206, 206], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "vector": [14, 6, 0.6776, 0.0033, 6, 0.55, 0.5455, 272, 3, 0, 0, 0, 80, 10, 1], "semantic": {"name": "rfid_arr", "arg_names": [], "import_names": [], "rhs_call_name": "RFIDreadArr", "annotation": ""}, "snippet": " rfid_arr = RFIDreadArr()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L207_C20", "label": "rfid_arr.header.stamp =", "type": "assigned_variable", "loc": [207, 207], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "vector": [14, 6, 0.6809, 0.0033, 6, 0.55, 0.6364, 144, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rfid_arr.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rfid_arr.header.stamp = t_now"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L208_C20", "label": "rfid_arr.arr =", "type": "assigned_variable", "loc": [208, 208], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "vector": [14, 6, 0.6842, 0.0033, 6, 0.55, 0.7273, 694, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "rfid_arr.arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rfid_arr.arr = [rv]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L209_C20", "label": "publish()", "type": "expression", "loc": [209, 209], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "vector": [8, 6, 0.6875, 0.0033, 6, 0.55, 0.8182, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.pub_arr.publish( rfid_arr )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L211_C20", "label": "datum =", "type": "assigned_variable", "loc": [211, 211], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "vector": [14, 6, 0.6941, 0.0033, 6, 0.55, 0.9091, 975, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "datum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " datum = [antennaName, tagid, rssi]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L212_C20", "label": "expression", "type": "expression", "loc": [212, 212], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "vector": [8, 6, 0.6974, 0.0033, 6, 0.55, 1.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " [cF(datum) for cF in self.callbacks]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L214_C16", "label": "sleep()", "type": "expression", "loc": [214, 214], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L198_C12", "vector": [8, 5, 0.7039, 0.0033, 5, 0.33, 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(0.005)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L216_C8", "label": "logout()", "type": "expression", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L176_C4", "vector": [8, 2, 0.7105, 0.0033, 2, 0.11, 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( 'ROS_M5e: '+self.name+' Shutting down reader' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L218_C4", "label": "stop", "type": "function", "loc": [218, 222], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L137_C0", "vector": [2, 1, 0.7237, 0.0164, 1, 0.76, 0.6667, 343, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "stop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop( self ):\n self.should_run = False\n self.join(3)\n if (self.isAlive()):\n raise RuntimeError(\"ROS_M5e: unable to stop thread\") "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L219_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L218_C4", "vector": [14, 2, 0.7204, 0.0033, 2, 0.63, 0.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L220_C8", "label": "join()", "type": "expression", "loc": [220, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L218_C4", "vector": [8, 2, 0.7237, 0.0033, 2, 0.63, 0.5, 933, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.join(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L221_C8", "label": "if", "type": "if", "loc": [221, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L218_C4", "vector": [4, 2, 0.7286, 0.0066, 2, 0.63, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.isAlive()):\n raise RuntimeError(\"ROS_M5e: unable to stop thread\") "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L224_C4", "label": "broadcast", "type": "function", "loc": [224, 228], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L137_C0", "vector": [2, 1, 0.7434, 0.0164, 1, 0.76, 0.8333, 803, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "broadcast", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def broadcast(self, data):\n antName, tagid, rssi = data\n rv = RFIDread( None, antName, tagid, rssi )\n rv.header.stamp = rospy.Time.now()\n self.channel.publish( rv )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L225_C8", "label": "antName, tagid, rssi =", "type": "assigned_variable", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L224_C4", "vector": [14, 2, 0.7401, 0.0033, 2, 0.13, 0.0, 920, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "antName, tagid, rssi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " antName, tagid, rssi = data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L226_C8", "label": "rv = RFIDread()", "type": "assigned_variable", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L224_C4", "vector": [14, 2, 0.7434, 0.0033, 2, 0.13, 0.3333, 222, 3, 4, 0, 0, 624, 10, 1], "semantic": {"name": "rv", "arg_names": [], "import_names": [], "rhs_call_name": "RFIDread", "annotation": ""}, "snippet": " rv = RFIDread( None, antName, tagid, rssi )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L227_C8", "label": "rv.header.stamp = now()", "type": "assigned_variable", "loc": [227, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L224_C4", "vector": [14, 2, 0.7467, 0.0033, 2, 0.13, 0.6667, 13, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "rv.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " rv.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L228_C8", "label": "publish()", "type": "expression", "loc": [228, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L224_C4", "vector": [8, 2, 0.75, 0.0033, 2, 0.13, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.channel.publish( rv )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L231_C4", "label": "_mode_service", "type": "function", "loc": [231, 251], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L137_C0", "vector": [2, 1, 0.7928, 0.0691, 1, 0.76, 1.0, 436, 0, 2, 1, 0, 0, 0, 14], "semantic": {"name": "_mode_service", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _mode_service(self, data):\n val = data.data\n if len(val) == 0:\n rospy.logout( 'ROS_M5e: Mode Service called with invalid argument: ' + str(val) )\n elif len(val) == 1:\n if val[0] == self.QUERY_MODE:\n rospy.logout( 'ROS_M5e: '+self.name+' Entering Query Mode' )\n self.mode = self.QUERY_MODE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L232_C8", "label": "val =", "type": "assigned_variable", "loc": [232, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L231_C4", "vector": [14, 2, 0.7632, 0.0033, 2, 0.9, 0.0, 618, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " val = data.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L233_C8", "label": "if", "type": "if", "loc": [233, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L231_C4", "vector": [4, 2, 0.7944, 0.0592, 2, 0.9, 0.5, 0, 0, 0, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(val) == 0:\n rospy.logout( 'ROS_M5e: Mode Service called with invalid argument: ' + str(val) )\n elif len(val) == 1:\n if val[0] == self.QUERY_MODE:\n rospy.logout( 'ROS_M5e: '+self.name+' Entering Query Mode' )\n self.mode = self.QUERY_MODE\n else:\n rospy.logout( 'ROS_M5e: '+self.name+' Stopping Reader' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L234_C12", "label": "logout()", "type": "expression", "loc": [234, 234], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L233_C8", "vector": [8, 3, 0.7697, 0.0033, 3, 0.84, 0.0, 525, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'ROS_M5e: Mode Service called with invalid argument: ' + str(val) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L235_C8", "label": "if", "type": "if", "loc": [235, 250], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L233_C8", "vector": [4, 3, 0.7977, 0.0526, 3, 0.84, 1.0, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif len(val) == 1:\n if val[0] == self.QUERY_MODE:\n rospy.logout( 'ROS_M5e: '+self.name+' Entering Query Mode' )\n self.mode = self.QUERY_MODE\n else:\n rospy.logout( 'ROS_M5e: '+self.name+' Stopping Reader' )\n self.mode = ''\n elif len(val) == 2:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L236_C12", "label": "if", "type": "if", "loc": [236, 241], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L235_C8", "vector": [4, 4, 0.7845, 0.0197, 4, 0.43, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if val[0] == self.QUERY_MODE:\n rospy.logout( 'ROS_M5e: '+self.name+' Entering Query Mode' )\n self.mode = self.QUERY_MODE\n else:\n rospy.logout( 'ROS_M5e: '+self.name+' Stopping Reader' )\n self.mode = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L237_C16", "label": "logout()", "type": "expression", "loc": [237, 237], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L236_C12", "vector": [8, 5, 0.7796, 0.0033, 5, 0.09, 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( 'ROS_M5e: '+self.name+' Entering Query Mode' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L238_C16", "label": "self.mode =", "type": "assigned_variable", "loc": [238, 238], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L236_C12", "vector": [14, 5, 0.7829, 0.0033, 5, 0.09, 0.3333, 474, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.mode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mode = self.QUERY_MODE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L240_C16", "label": "logout()", "type": "expression", "loc": [240, 240], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L236_C12", "vector": [8, 5, 0.7895, 0.0033, 5, 0.09, 0.6667, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'ROS_M5e: '+self.name+' Stopping Reader' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L241_C16", "label": "self.mode =", "type": "assigned_variable", "loc": [241, 241], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L236_C12", "vector": [14, 5, 0.7928, 0.0033, 5, 0.09, 1.0, 474, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.mode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mode = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L242_C8", "label": "if", "type": "if", "loc": [242, 250], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L235_C8", "vector": [4, 4, 0.8092, 0.0296, 4, 0.43, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif len(val) == 2:\n if val[0] == self.TRACK_MODE and len(val[1]) == 12:\n rospy.logout( 'ROS_M5e: '+self.name+' Entering Track Mode: ' + str(val[1]) )\n self.mode = self.TRACK_MODE\n self.tag_to_track = val[1]\n else:\n rospy.logout( 'ROS_M5e: Mode Service called with invalid argument: ' + str(val) )\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L243_C12", "label": "if", "type": "if", "loc": [243, 248], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L242_C8", "vector": [4, 5, 0.8076, 0.0197, 5, 0.98, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if val[0] == self.TRACK_MODE and len(val[1]) == 12:\n rospy.logout( 'ROS_M5e: '+self.name+' Entering Track Mode: ' + str(val[1]) )\n self.mode = self.TRACK_MODE\n self.tag_to_track = val[1]\n else:\n rospy.logout( 'ROS_M5e: Mode Service called with invalid argument: ' + str(val) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L244_C16", "label": "logout()", "type": "expression", "loc": [244, 244], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L243_C12", "vector": [8, 6, 0.8026, 0.0033, 6, 0.26, 0.0, 525, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'ROS_M5e: '+self.name+' Entering Track Mode: ' + str(val[1]) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L245_C16", "label": "self.mode =", "type": "assigned_variable", "loc": [245, 245], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L243_C12", "vector": [14, 6, 0.8059, 0.0033, 6, 0.26, 0.3333, 474, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.mode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mode = self.TRACK_MODE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L246_C16", "label": "self.tag_to_track =", "type": "assigned_variable", "loc": [246, 246], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L243_C12", "vector": [14, 6, 0.8092, 0.0033, 6, 0.26, 0.6667, 131, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tag_to_track", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tag_to_track = val[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L248_C16", "label": "logout()", "type": "expression", "loc": [248, 248], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L243_C12", "vector": [8, 6, 0.8158, 0.0033, 6, 0.26, 1.0, 525, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'ROS_M5e: Mode Service called with invalid argument: ' + str(val) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L250_C12", "label": "logout()", "type": "expression", "loc": [250, 250], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L242_C8", "vector": [8, 5, 0.8224, 0.0033, 5, 0.98, 1.0, 525, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'ROS_M5e: Mode Service called with invalid argument: ' + str(val) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Return_L251_C8", "label": "return", "type": "return", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L231_C4", "vector": [13, 2, 0.8257, 0.0033, 2, 0.9, 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_99360:FunctionDef_L259_C0", "label": "EleLeftEar", "type": "function", "loc": [259, 262], "level": 0, "parent": null, "vector": [2, 0, 0.8569, 0.0132, 0, 0.66, 0.7857, 578, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "EleLeftEar", "arg_names": ["M5e"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def EleLeftEar(M5e):\n M5e.ChangeAntennaPorts(1,1)\n rospy.sleep(0.010)\n return 'EleLeftEar'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L260_C4", "label": "ChangeAntennaPorts()", "type": "expression", "loc": [260, 260], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L259_C0", "vector": [8, 1, 0.8553, 0.0033, 1, 0.76, 0.0, 901, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ChangeAntennaPorts", "arg_names": [], "import_names": [], "rhs_call_name": "ChangeAntennaPorts", "annotation": ""}, "snippet": " M5e.ChangeAntennaPorts(1,1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L261_C4", "label": "sleep()", "type": "expression", "loc": [261, 261], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L259_C0", "vector": [8, 1, 0.8586, 0.0033, 1, 0.76, 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.010)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Return_L262_C4", "label": "return", "type": "return", "loc": [262, 262], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L259_C0", "vector": [13, 1, 0.8618, 0.0033, 1, 0.76, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'EleLeftEar'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L264_C0", "label": "EleRightEar", "type": "function", "loc": [264, 267], "level": 0, "parent": null, "vector": [2, 0, 0.8734, 0.0132, 0, 0.66, 0.8214, 801, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "EleRightEar", "arg_names": ["M5e"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def EleRightEar(M5e):\n M5e.ChangeAntennaPorts(2,2)\n rospy.sleep(0.010)\n return 'EleRightEar'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L265_C4", "label": "ChangeAntennaPorts()", "type": "expression", "loc": [265, 265], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L264_C0", "vector": [8, 1, 0.8717, 0.0033, 1, 0.22, 0.0, 901, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ChangeAntennaPorts", "arg_names": [], "import_names": [], "rhs_call_name": "ChangeAntennaPorts", "annotation": ""}, "snippet": " M5e.ChangeAntennaPorts(2,2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L266_C4", "label": "sleep()", "type": "expression", "loc": [266, 266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L264_C0", "vector": [8, 1, 0.875, 0.0033, 1, 0.22, 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.010)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Return_L267_C4", "label": "return", "type": "return", "loc": [267, 267], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L264_C0", "vector": [13, 1, 0.8783, 0.0033, 1, 0.22, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'EleRightEar'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L269_C0", "label": "Hand_Right_1", "type": "function", "loc": [269, 275], "level": 0, "parent": null, "vector": [2, 0, 0.8947, 0.023, 0, 0.66, 0.8571, 490, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "Hand_Right_1", "arg_names": ["M5e"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def Hand_Right_1(M5e):\n # GPIO1 = 1, GPIO2 = 0\n M5e.TransmitCommand('\\x02\\x96\\x01\\x01')\n M5e.ReceiveResponse()\n M5e.TransmitCommand('\\x02\\x96\\x02\\x00')\n M5e.ReceiveResponse()\n return 'Hand_Right_1'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L271_C4", "label": "TransmitCommand()", "type": "expression", "loc": [271, 271], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L269_C0", "vector": [8, 1, 0.8914, 0.0033, 1, 0.51, 0.0, 591, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "TransmitCommand", "arg_names": [], "import_names": [], "rhs_call_name": "TransmitCommand", "annotation": ""}, "snippet": " M5e.TransmitCommand('\\x02\\x96\\x01\\x01')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L272_C4", "label": "ReceiveResponse()", "type": "expression", "loc": [272, 272], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L269_C0", "vector": [8, 1, 0.8947, 0.0033, 1, 0.51, 0.25, 223, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ReceiveResponse", "arg_names": [], "import_names": [], "rhs_call_name": "ReceiveResponse", "annotation": ""}, "snippet": " M5e.ReceiveResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L273_C4", "label": "TransmitCommand()", "type": "expression", "loc": [273, 273], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L269_C0", "vector": [8, 1, 0.898, 0.0033, 1, 0.51, 0.5, 591, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "TransmitCommand", "arg_names": [], "import_names": [], "rhs_call_name": "TransmitCommand", "annotation": ""}, "snippet": " M5e.TransmitCommand('\\x02\\x96\\x02\\x00')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L274_C4", "label": "ReceiveResponse()", "type": "expression", "loc": [274, 274], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L269_C0", "vector": [8, 1, 0.9013, 0.0033, 1, 0.51, 0.75, 223, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ReceiveResponse", "arg_names": [], "import_names": [], "rhs_call_name": "ReceiveResponse", "annotation": ""}, "snippet": " M5e.ReceiveResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Return_L275_C4", "label": "return", "type": "return", "loc": [275, 275], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L269_C0", "vector": [13, 1, 0.9046, 0.0033, 1, 0.51, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'Hand_Right_1'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L277_C0", "label": "Hand_Right_2", "type": "function", "loc": [277, 283], "level": 0, "parent": null, "vector": [2, 0, 0.9211, 0.023, 0, 0.66, 0.8929, 943, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "Hand_Right_2", "arg_names": ["M5e"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def Hand_Right_2(M5e):\n # GPIO1 = 1, GPIO2 = 1\n M5e.TransmitCommand('\\x02\\x96\\x01\\x01')\n M5e.ReceiveResponse()\n M5e.TransmitCommand('\\x02\\x96\\x02\\x01')\n M5e.ReceiveResponse()\n return 'Hand_Right_2'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L279_C4", "label": "TransmitCommand()", "type": "expression", "loc": [279, 279], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L277_C0", "vector": [8, 1, 0.9178, 0.0033, 1, 0.25, 0.0, 591, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "TransmitCommand", "arg_names": [], "import_names": [], "rhs_call_name": "TransmitCommand", "annotation": ""}, "snippet": " M5e.TransmitCommand('\\x02\\x96\\x01\\x01')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L280_C4", "label": "ReceiveResponse()", "type": "expression", "loc": [280, 280], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L277_C0", "vector": [8, 1, 0.9211, 0.0033, 1, 0.25, 0.25, 223, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ReceiveResponse", "arg_names": [], "import_names": [], "rhs_call_name": "ReceiveResponse", "annotation": ""}, "snippet": " M5e.ReceiveResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L281_C4", "label": "TransmitCommand()", "type": "expression", "loc": [281, 281], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L277_C0", "vector": [8, 1, 0.9243, 0.0033, 1, 0.25, 0.5, 591, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "TransmitCommand", "arg_names": [], "import_names": [], "rhs_call_name": "TransmitCommand", "annotation": ""}, "snippet": " M5e.TransmitCommand('\\x02\\x96\\x02\\x01')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L282_C4", "label": "ReceiveResponse()", "type": "expression", "loc": [282, 282], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L277_C0", "vector": [8, 1, 0.9276, 0.0033, 1, 0.25, 0.75, 223, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ReceiveResponse", "arg_names": [], "import_names": [], "rhs_call_name": "ReceiveResponse", "annotation": ""}, "snippet": " M5e.ReceiveResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Return_L283_C4", "label": "return", "type": "return", "loc": [283, 283], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L277_C0", "vector": [13, 1, 0.9309, 0.0033, 1, 0.25, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'Hand_Right_2'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L285_C0", "label": "Hand_Left_1", "type": "function", "loc": [285, 291], "level": 0, "parent": null, "vector": [2, 0, 0.9474, 0.023, 0, 0.66, 0.9286, 666, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "Hand_Left_1", "arg_names": ["M5e"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def Hand_Left_1(M5e):\n # GPIO1 = 0, GPIO2 = 0\n M5e.TransmitCommand('\\x02\\x96\\x01\\x00')\n M5e.ReceiveResponse()\n M5e.TransmitCommand('\\x02\\x96\\x02\\x00')\n M5e.ReceiveResponse()\n return 'Hand_Left_1'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L287_C4", "label": "TransmitCommand()", "type": "expression", "loc": [287, 287], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L285_C0", "vector": [8, 1, 0.9441, 0.0033, 1, 0.32, 0.0, 591, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "TransmitCommand", "arg_names": [], "import_names": [], "rhs_call_name": "TransmitCommand", "annotation": ""}, "snippet": " M5e.TransmitCommand('\\x02\\x96\\x01\\x00')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L288_C4", "label": "ReceiveResponse()", "type": "expression", "loc": [288, 288], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L285_C0", "vector": [8, 1, 0.9474, 0.0033, 1, 0.32, 0.25, 223, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ReceiveResponse", "arg_names": [], "import_names": [], "rhs_call_name": "ReceiveResponse", "annotation": ""}, "snippet": " M5e.ReceiveResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L289_C4", "label": "TransmitCommand()", "type": "expression", "loc": [289, 289], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L285_C0", "vector": [8, 1, 0.9507, 0.0033, 1, 0.32, 0.5, 591, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "TransmitCommand", "arg_names": [], "import_names": [], "rhs_call_name": "TransmitCommand", "annotation": ""}, "snippet": " M5e.TransmitCommand('\\x02\\x96\\x02\\x00')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L290_C4", "label": "ReceiveResponse()", "type": "expression", "loc": [290, 290], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L285_C0", "vector": [8, 1, 0.9539, 0.0033, 1, 0.32, 0.75, 223, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ReceiveResponse", "arg_names": [], "import_names": [], "rhs_call_name": "ReceiveResponse", "annotation": ""}, "snippet": " M5e.ReceiveResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Return_L291_C4", "label": "return", "type": "return", "loc": [291, 291], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L285_C0", "vector": [13, 1, 0.9572, 0.0033, 1, 0.32, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'Hand_Left_1'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L293_C0", "label": "Hand_Left_2", "type": "function", "loc": [293, 299], "level": 0, "parent": null, "vector": [2, 0, 0.9737, 0.023, 0, 0.66, 0.9643, 308, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "Hand_Left_2", "arg_names": ["M5e"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def Hand_Left_2(M5e):\n # GPIO1 = 0, GPIO2 = 1\n M5e.TransmitCommand('\\x02\\x96\\x01\\x00')\n M5e.ReceiveResponse()\n M5e.TransmitCommand('\\x02\\x96\\x02\\x01')\n M5e.ReceiveResponse()\n return 'Hand_Left_2'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L295_C4", "label": "TransmitCommand()", "type": "expression", "loc": [295, 295], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L293_C0", "vector": [8, 1, 0.9704, 0.0033, 1, 0.81, 0.0, 591, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "TransmitCommand", "arg_names": [], "import_names": [], "rhs_call_name": "TransmitCommand", "annotation": ""}, "snippet": " M5e.TransmitCommand('\\x02\\x96\\x01\\x00')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L296_C4", "label": "ReceiveResponse()", "type": "expression", "loc": [296, 296], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L293_C0", "vector": [8, 1, 0.9737, 0.0033, 1, 0.81, 0.25, 223, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ReceiveResponse", "arg_names": [], "import_names": [], "rhs_call_name": "ReceiveResponse", "annotation": ""}, "snippet": " M5e.ReceiveResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L297_C4", "label": "TransmitCommand()", "type": "expression", "loc": [297, 297], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L293_C0", "vector": [8, 1, 0.977, 0.0033, 1, 0.81, 0.5, 591, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "TransmitCommand", "arg_names": [], "import_names": [], "rhs_call_name": "TransmitCommand", "annotation": ""}, "snippet": " M5e.TransmitCommand('\\x02\\x96\\x02\\x01')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L298_C4", "label": "ReceiveResponse()", "type": "expression", "loc": [298, 298], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L293_C0", "vector": [8, 1, 0.9803, 0.0033, 1, 0.81, 0.75, 223, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ReceiveResponse", "arg_names": [], "import_names": [], "rhs_call_name": "ReceiveResponse", "annotation": ""}, "snippet": " M5e.ReceiveResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Return_L299_C4", "label": "return", "type": "return", "loc": [299, 299], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L293_C0", "vector": [13, 1, 0.9836, 0.0033, 1, 0.81, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'Hand_Left_2'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L301_C0", "label": "PrintDatum", "type": "function", "loc": [301, 303], "level": 0, "parent": null, "vector": [2, 0, 0.9934, 0.0099, 0, 0.66, 1.0, 369, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "PrintDatum", "arg_names": ["data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def PrintDatum(data):\n ant, ids, rssi = data\n print(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L302_C4", "label": "ant, ids, rssi =", "type": "assigned_variable", "loc": [302, 302], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L301_C0", "vector": [14, 1, 0.9934, 0.0033, 1, 0.66, 0.0, 269, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ant, ids, rssi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ant, ids, rssi = data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L303_C4", "label": "print()", "type": "expression", "loc": [303, 303], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L301_C0", "vector": [8, 1, 0.9967, 0.0033, 1, 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(data)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Return_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Try_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:Try_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Return_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L93_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L94_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L93_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L96_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L128_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Return_L129_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L128_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Return_L131_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Try_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:Try_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L149_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L160_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L160_C23"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:While_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:While_L177_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L178_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L178_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L179_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L179_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L180_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L179_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L181_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L179_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L182_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L182_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L183_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L179_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L186_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L179_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L187_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L179_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L188_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L188_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L189_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L188_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L190_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L188_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L191_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L188_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L192_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L188_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L193_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L179_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L194_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L179_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L195_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L179_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L196_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L179_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L197_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L178_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L198_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L198_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L200_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L201_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L202_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L203_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L204_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L205_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L206_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L207_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L208_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L209_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L211_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:For_L199_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L212_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L198_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L214_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L218_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L218_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L218_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L218_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L224_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L224_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L224_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L224_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L224_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:ClassDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L231_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L231_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L231_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L233_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L234_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L233_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L235_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L236_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L236_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L237_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L236_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L238_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L236_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L240_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L236_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L241_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L235_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L242_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L243_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L243_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L244_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L243_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L245_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L243_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L246_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L243_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L248_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:If_L242_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L250_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L231_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Return_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L259_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L260_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L259_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L259_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Return_L262_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L264_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L265_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L264_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L266_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L264_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Return_L267_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L269_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L271_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L269_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L272_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L269_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L273_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L269_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L274_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L269_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Return_L275_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L277_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L279_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L277_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L280_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L277_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L281_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L277_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L282_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L277_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Return_L283_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L285_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L287_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L285_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L288_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L285_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L289_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L285_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L290_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L285_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Return_L291_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L293_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L295_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L293_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L296_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L293_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L297_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L293_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L298_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L293_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Return_L299_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Assign_L302_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99360:FunctionDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99360:Expr_L303_C4"}]
#!/usr/bin/python import roslib roslib.load_manifest( 'robotis' ) import rospy import robotis.ros_robotis as rr import time import math if __name__ == '__main__': p_left = rr.ROS_Robotis_Client( 'left_pan' ) t_left = rr.ROS_Robotis_Client( 'left_tilt' ) p_left.move_angle( -1.370, math.radians(10), blocking = False ) t_left.move_angle( 0.0, math.radians(10), blocking = False ) p_right = rr.ROS_Robotis_Client( 'right_pan' ) t_right = rr.ROS_Robotis_Client( 'right_tilt' ) p_right.move_angle( 1.370, math.radians(10), blocking = False ) t_right.move_angle( 0.0, math.radians(10), blocking = False )
ajibawa-2023/Python-Code-Large/train/row_99361
15
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_99361:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.125, 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"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99361:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.1667, 0.0417, 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( 'robotis' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99361:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.2083, 0.0417, 0, 0.66, 0.3333, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99361:Import_L6_C0", "label": "robotis.ros_robotis import rr", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.0417, 0, 0.66, 0.5, 570, 0, 1, 0, 0, 570, 0, 0], "semantic": {"name": "robotis.ros_robotis", "arg_names": [], "import_names": ["rr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import robotis.ros_robotis as rr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99361:Import_L8_C0", "label": "time import time", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.0417, 0, 0.66, 0.6667, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99361:Import_L9_C0", "label": "math import math", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.375, 0.0417, 0, 0.66, 0.8333, 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_99361:If_L11_C0", "label": "if", "type": "if", "loc": [11, 23], "level": 0, "parent": null, "vector": [4, 0, 0.7083, 0.5417, 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 p_left = rr.ROS_Robotis_Client( 'left_pan' )\n t_left = rr.ROS_Robotis_Client( 'left_tilt' )\n \n p_left.move_angle( -1.370, math.radians(10), blocking = False )\n t_left.move_angle( 0.0, math.radians(10), blocking = False )\n\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99361:Assign_L12_C4", "label": "p_left = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99361:If_L11_C0", "vector": [14, 1, 0.5, 0.0417, 1, 0.98, 0.0, 339, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "p_left", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " p_left = rr.ROS_Robotis_Client( 'left_pan' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99361:Assign_L13_C4", "label": "t_left = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99361:If_L11_C0", "vector": [14, 1, 0.5417, 0.0417, 1, 0.98, 0.1429, 276, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "t_left", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " t_left = rr.ROS_Robotis_Client( 'left_tilt' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99361:Expr_L15_C4", "label": "move_angle()", "type": "expression", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99361:If_L11_C0", "vector": [8, 1, 0.625, 0.0417, 1, 0.98, 0.2857, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " p_left.move_angle( -1.370, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99361:Expr_L16_C4", "label": "move_angle()", "type": "expression", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99361:If_L11_C0", "vector": [8, 1, 0.6667, 0.0417, 1, 0.98, 0.4286, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " t_left.move_angle( 0.0, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99361:Assign_L19_C4", "label": "p_right = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99361:If_L11_C0", "vector": [14, 1, 0.7917, 0.0417, 1, 0.98, 0.5714, 866, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "p_right", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " p_right = rr.ROS_Robotis_Client( 'right_pan' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99361:Assign_L20_C4", "label": "t_right = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99361:If_L11_C0", "vector": [14, 1, 0.8333, 0.0417, 1, 0.98, 0.7143, 942, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "t_right", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " t_right = rr.ROS_Robotis_Client( 'right_tilt' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99361:Expr_L22_C4", "label": "move_angle()", "type": "expression", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99361:If_L11_C0", "vector": [8, 1, 0.9167, 0.0417, 1, 0.98, 0.8571, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " p_right.move_angle( 1.370, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99361:Expr_L23_C4", "label": "move_angle()", "type": "expression", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99361:If_L11_C0", "vector": [8, 1, 0.9583, 0.0417, 1, 0.98, 1.0, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " t_right.move_angle( 0.0, math.radians(10), blocking = False )"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99361:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99361:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99361:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99361:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99361:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99361:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99361:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99361:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99361:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99361:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99361:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99361:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99361:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99361:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99361:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99361:Expr_L23_C4"}]
#! /usr/bin/python import roslib roslib.load_manifest('rfid_people_following') roslib.load_manifest('pr2_msgs') roslib.load_manifest('std_msgs') import rospy from pr2_msgs.msg import PressureState from std_msgs.msg import Float64 from rfid_people_following.srv import FloatFloat_Int32 import numpy as np, math import time, string def default_mag_func( x ): return np.sum( np.abs( x )) class TactileSensor( ): def __init__( self, topic = '/pressure/r_gripper_motor', mag_func = default_mag_func ): rospy.logout( 'tactile_sensor: Initializing' ) try: rospy.init_node( 'tactile_sensor' ) except: pass self.mag_func = mag_func self.left = None self.right = None self.l_bias = None self.r_bias = None self.topic = topic self.pub = rospy.Publisher( '/readings/' + string.replace(topic,'/','_') + '_mag', Float64 ) self.service = rospy.Service( '/readings/' + string.replace(topic,'/','_') + '_serv', FloatFloat_Int32, self.thresh_service ) self.reg_sensor( ) while self.left == None or self.right == None: time.sleep( 0.1 ) self.unreg_sensor() rospy.logout( 'tactile_sensor: Ready' ) def reg_sensor( self ): self.sub = rospy.Subscriber( self.topic, PressureState, self.cb ) time.sleep( 0.3 ) def unreg_sensor( self ): self.sub.unregister() def cb( self, msg ): self.left = np.array( list( msg.l_finger_tip ), dtype=float ) self.right = np.array( list( msg.r_finger_tip ), dtype=float ) if self.l_bias == None or self.r_bias == None: self.l_bias = np.zeros( len( self.left )) self.r_bias = np.zeros( len( self.right )) self.l_read = np.copy( self.left - self.l_bias ) self.r_read = np.copy( self.right - self.r_bias ) self.mag = self.mag_func( np.append( self.l_read, self.r_read )) #print np.append( self.l_read, self.r_read ) self.pub.publish( self.mag ) def bias( self ): self.reg_sensor() rospy.logout( 'tactile_sensor: Biasing' ) self.l_bias = np.copy( self.left ) self.r_bias = np.copy( self.right ) self.unreg_sensor() return True def read( self ): return np.copy( self.l_read ), np.copy( self.r_read ) def thresh_service( self, request ): self.thresh_detect( request.rotate, request.displace ) # yeah, jacked up names return int( True ) def thresh_detect( self, threshold, timeout = 100.0 ): rospy.logout( 'tactile_sensor: Threshold detector activated: %3.2f, timeout: %d' % (threshold, timeout)) self.bias() self.reg_sensor() t0 = time.time() t_diff = time.time() - t0 lp = t0 # Printing status messages while self.mag < threshold and t_diff < timeout: if time.time() - lp > 1.0: lp = time.time() rospy.logout( 'tactile_sensor: Threshold still undetected' ) time.sleep( 0.05 ) t_diff = time.time() - t0 self.unreg_sensor() rospy.logout( 'tactile_sensor: Detected (or timeout)' ) return self.mag if __name__ == '__main__': import optparse p = optparse.OptionParser() p.add_option('-r', '--right', action='store_true', dest='right', default=False, help='Right finger') p.add_option('-l', '--left', action='store_true', dest='left', default=False, help='left finger') opt, args = p.parse_args() if opt.right: r_tact = TactileSensor('/pressure/r_gripper_motor') if opt.left: l_tact = TactileSensor('/pressure/l_gripper_motor') rospy.spin() # print 'Reading: ', r_tact.read() # raw_input('Hit [ENTER]') # r_tact.bias() # time.sleep(3.0) # print 'Reading: ', r_tact.read() # raw_input('Hit [ENTER]') # print 'COMBINED:', np.append( *r_tact.read() ) # print 'ERR:', np.sum(np.abs( np.append( *r_tact.read() ))) # print 'Waiting for thresh' # r_tact.thresh_detect( 5000 )
ajibawa-2023/Python-Code-Large/train/row_99362
84
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_99362:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0147, 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_99362:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0221, 0.0074, 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('rfid_people_following')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0294, 0.0074, 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('pr2_msgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0368, 0.0074, 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_99362:Import_L6_C0", "label": "rospy import rospy", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0441, 0.0074, 0, 0.66, 0.3333, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:ImportFrom_L8_C0", "label": "from pr2_msgs.msg import PressureState", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0588, 0.0074, 0, 0.66, 0.4167, 797, 0, 1, 0, 0, 797, 0, 0], "semantic": {"name": "pr2_msgs.msg", "arg_names": [], "import_names": ["PressureState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_msgs.msg import PressureState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:ImportFrom_L9_C0", "label": "from std_msgs.msg import Float64", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0662, 0.0074, 0, 0.66, 0.5, 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_99362:ImportFrom_L10_C0", "label": "from rfid_people_following.srv import FloatFloat_Int32", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0735, 0.0074, 0, 0.66, 0.5833, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["FloatFloat_Int32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import FloatFloat_Int32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Import_L12_C0", "label": "numpy import np, math", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0882, 0.0074, 0, 0.66, 0.6667, 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_99362:Import_L13_C0", "label": "time import time, string", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0956, 0.0074, 0, 0.66, 0.75, 654, 0, 2, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time", "string"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time, string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L15_C0", "label": "default_mag_func", "type": "function", "loc": [15, 16], "level": 0, "parent": null, "vector": [2, 0, 0.114, 0.0147, 0, 0.66, 0.8333, 9, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "default_mag_func", "arg_names": ["x"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def default_mag_func( x ):\n return np.sum( np.abs( x ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Return_L16_C4", "label": "return", "type": "return", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L15_C0", "vector": [13, 1, 0.1176, 0.0074, 1, 0.3, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.sum( np.abs( x ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:ClassDef_L18_C0", "label": "TactileSensor", "type": "class", "loc": [18, 102], "level": 0, "parent": null, "vector": [3, 0, 0.4412, 0.625, 0, 0.66, 0.9167, 495, 0, 8, 0, 0, 0, 0, 47], "semantic": {"name": "TactileSensor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TactileSensor( ):\n def __init__( self, topic = '/pressure/r_gripper_motor', \n mag_func = default_mag_func ):\n rospy.logout( 'tactile_sensor: Initializing' )\n try:\n rospy.init_node( 'tactile_sensor' )\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "label": "__init__", "type": "function", "loc": [19, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:ClassDef_L18_C0", "vector": [2, 1, 0.2353, 0.1985, 1, 0.85, 0.0, 555, 0, 3, 0, 0, 0, 0, 10], "semantic": {"name": "__init__", "arg_names": ["self", "topic", "mag_func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, topic = '/pressure/r_gripper_motor', \n mag_func = default_mag_func ):\n rospy.logout( 'tactile_sensor: Initializing' )\n try:\n rospy.init_node( 'tactile_sensor' )\n except:\n pass\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L21_C8", "label": "logout()", "type": "expression", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "vector": [8, 2, 0.1544, 0.0074, 2, 0.75, 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( 'tactile_sensor: Initializing' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Try_L22_C8", "label": "try", "type": "try", "loc": [22, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "vector": [7, 2, 0.1728, 0.0294, 2, 0.75, 0.0769, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node( 'tactile_sensor' )\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L23_C12", "label": "init_node()", "type": "expression", "loc": [23, 23], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:Try_L22_C8", "vector": [8, 3, 0.1691, 0.0074, 3, 0.37, 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( 'tactile_sensor' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L27_C8", "label": "self.mag_func =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "vector": [14, 2, 0.1985, 0.0074, 2, 0.75, 0.1538, 803, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.mag_func", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mag_func = mag_func"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L28_C8", "label": "self.left =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "vector": [14, 2, 0.2059, 0.0074, 2, 0.75, 0.2308, 643, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.left", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.left = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L29_C8", "label": "self.right =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "vector": [14, 2, 0.2132, 0.0074, 2, 0.75, 0.3077, 683, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.right", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L30_C8", "label": "self.l_bias =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "vector": [14, 2, 0.2206, 0.0074, 2, 0.75, 0.3846, 421, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.l_bias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.l_bias = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L31_C8", "label": "self.r_bias =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "vector": [14, 2, 0.2279, 0.0074, 2, 0.75, 0.4615, 343, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.r_bias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_bias = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L32_C8", "label": "self.topic =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "vector": [14, 2, 0.2353, 0.0074, 2, 0.75, 0.5385, 928, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.topic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.topic = topic"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L34_C8", "label": "self.pub = Publisher()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "vector": [14, 2, 0.25, 0.0074, 2, 0.75, 0.6154, 86, 3, 2, 0, 0, 45, 10, 2], "semantic": {"name": "self.pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.pub = rospy.Publisher( '/readings/' + string.replace(topic,'/','_') + '_mag', Float64 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L35_C8", "label": "self.service = Service()", "type": "assigned_variable", "loc": [35, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "vector": [14, 2, 0.2647, 0.0221, 2, 0.75, 0.6923, 457, 3, 3, 0, 0, 451, 10, 2], "semantic": {"name": "self.service", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self.service = rospy.Service( '/readings/' + string.replace(topic,'/','_') + '_serv', \n FloatFloat_Int32, \n self.thresh_service )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L38_C8", "label": "reg_sensor()", "type": "expression", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "vector": [8, 2, 0.2794, 0.0074, 2, 0.75, 0.7692, 443, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "reg_sensor", "arg_names": [], "import_names": [], "rhs_call_name": "reg_sensor", "annotation": ""}, "snippet": " self.reg_sensor( )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:While_L40_C8", "label": "while", "type": "while", "loc": [40, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "vector": [5, 2, 0.2978, 0.0147, 2, 0.75, 0.8462, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.left == None or self.right == None:\n time.sleep( 0.1 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L41_C12", "label": "sleep()", "type": "expression", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:While_L40_C8", "vector": [8, 3, 0.3015, 0.0074, 3, 0.39, 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_99362:Expr_L43_C8", "label": "unreg_sensor()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "vector": [8, 2, 0.3162, 0.0074, 2, 0.75, 0.9231, 809, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "unreg_sensor", "arg_names": [], "import_names": [], "rhs_call_name": "unreg_sensor", "annotation": ""}, "snippet": " self.unreg_sensor()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L45_C8", "label": "logout()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "vector": [8, 2, 0.3309, 0.0074, 2, 0.75, 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( 'tactile_sensor: Ready' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L48_C4", "label": "reg_sensor", "type": "function", "loc": [48, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:ClassDef_L18_C0", "vector": [2, 1, 0.3603, 0.0221, 1, 0.85, 0.1429, 443, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "reg_sensor", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def reg_sensor( self ):\n self.sub = rospy.Subscriber( self.topic, PressureState, self.cb )\n time.sleep( 0.3 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L49_C8", "label": "self.sub = Subscriber()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L48_C4", "vector": [14, 2, 0.3603, 0.0074, 2, 0.41, 0.0, 88, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "self.sub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " self.sub = rospy.Subscriber( self.topic, PressureState, self.cb )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L50_C8", "label": "sleep()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L48_C4", "vector": [8, 2, 0.3676, 0.0074, 2, 0.41, 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( 0.3 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L52_C4", "label": "unreg_sensor", "type": "function", "loc": [52, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:ClassDef_L18_C0", "vector": [2, 1, 0.386, 0.0147, 1, 0.85, 0.2857, 809, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "unreg_sensor", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def unreg_sensor( self ):\n self.sub.unregister()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L53_C8", "label": "unregister()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L52_C4", "vector": [8, 2, 0.3897, 0.0074, 2, 0.4, 0.0, 614, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "unregister", "arg_names": [], "import_names": [], "rhs_call_name": "unregister", "annotation": ""}, "snippet": " self.sub.unregister()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L56_C4", "label": "cb", "type": "function", "loc": [56, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:ClassDef_L18_C0", "vector": [2, 1, 0.4596, 0.1029, 1, 0.85, 0.4286, 540, 0, 2, 0, 0, 0, 0, 13], "semantic": {"name": "cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def cb( self, msg ):\n self.left = np.array( list( msg.l_finger_tip ), dtype=float )\n self.right = np.array( list( msg.r_finger_tip ), dtype=float )\n\n if self.l_bias == None or self.r_bias == None:\n self.l_bias = np.zeros( len( self.left ))\n self.r_bias = np.zeros( len( self.right ))\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L57_C8", "label": "self.left = array()", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L56_C4", "vector": [14, 2, 0.4191, 0.0074, 2, 0.7, 0.0, 643, 3, 2, 0, 0, 80, 10, 2], "semantic": {"name": "self.left", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " self.left = np.array( list( msg.l_finger_tip ), dtype=float )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L58_C8", "label": "self.right = array()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L56_C4", "vector": [14, 2, 0.4265, 0.0074, 2, 0.7, 0.1667, 683, 3, 2, 0, 0, 80, 10, 2], "semantic": {"name": "self.right", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " self.right = np.array( list( msg.r_finger_tip ), dtype=float )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L60_C8", "label": "if", "type": "if", "loc": [60, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L56_C4", "vector": [4, 2, 0.4485, 0.0221, 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 self.l_bias == None or self.r_bias == None:\n self.l_bias = np.zeros( len( self.left ))\n self.r_bias = np.zeros( len( self.right ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L61_C12", "label": "self.l_bias = zeros()", "type": "assigned_variable", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L60_C8", "vector": [14, 3, 0.4485, 0.0074, 3, 0.0, 0.0, 421, 3, 1, 0, 0, 213, 10, 2], "semantic": {"name": "self.l_bias", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " self.l_bias = np.zeros( len( self.left ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L62_C12", "label": "self.r_bias = zeros()", "type": "assigned_variable", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L60_C8", "vector": [14, 3, 0.4559, 0.0074, 3, 0.0, 1.0, 343, 3, 1, 0, 0, 213, 10, 2], "semantic": {"name": "self.r_bias", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " self.r_bias = np.zeros( len( self.right ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L64_C8", "label": "self.l_read = copy()", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L56_C4", "vector": [14, 2, 0.4706, 0.0074, 2, 0.7, 0.5, 993, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.l_read", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.l_read = np.copy( self.left - self.l_bias )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L65_C8", "label": "self.r_read = copy()", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L56_C4", "vector": [14, 2, 0.4779, 0.0074, 2, 0.7, 0.6667, 617, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.r_read", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.r_read = np.copy( self.right - self.r_bias )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L67_C8", "label": "self.mag = mag_func()", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L56_C4", "vector": [14, 2, 0.4926, 0.0074, 2, 0.7, 0.8333, 477, 3, 1, 0, 0, 22, 10, 2], "semantic": {"name": "self.mag", "arg_names": [], "import_names": [], "rhs_call_name": "mag_func", "annotation": ""}, "snippet": " self.mag = self.mag_func( np.append( self.l_read, self.r_read ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L69_C8", "label": "publish()", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L56_C4", "vector": [8, 2, 0.5074, 0.0074, 2, 0.7, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.pub.publish( self.mag )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L72_C4", "label": "bias", "type": "function", "loc": [72, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:ClassDef_L18_C0", "vector": [2, 1, 0.5515, 0.0515, 1, 0.85, 0.5714, 354, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "bias", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def bias( self ):\n self.reg_sensor()\n rospy.logout( 'tactile_sensor: Biasing' )\n self.l_bias = np.copy( self.left )\n self.r_bias = np.copy( self.right )\n self.unreg_sensor()\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L73_C8", "label": "reg_sensor()", "type": "expression", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L72_C4", "vector": [8, 2, 0.5368, 0.0074, 2, 0.68, 0.0, 443, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "reg_sensor", "arg_names": [], "import_names": [], "rhs_call_name": "reg_sensor", "annotation": ""}, "snippet": " self.reg_sensor()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L74_C8", "label": "logout()", "type": "expression", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L72_C4", "vector": [8, 2, 0.5441, 0.0074, 2, 0.68, 0.2, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'tactile_sensor: Biasing' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L75_C8", "label": "self.l_bias = copy()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L72_C4", "vector": [14, 2, 0.5515, 0.0074, 2, 0.68, 0.4, 421, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.l_bias", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.l_bias = np.copy( self.left )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L76_C8", "label": "self.r_bias = copy()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L72_C4", "vector": [14, 2, 0.5588, 0.0074, 2, 0.68, 0.6, 343, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.r_bias", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.r_bias = np.copy( self.right )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L77_C8", "label": "unreg_sensor()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L72_C4", "vector": [8, 2, 0.5662, 0.0074, 2, 0.68, 0.8, 809, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "unreg_sensor", "arg_names": [], "import_names": [], "rhs_call_name": "unreg_sensor", "annotation": ""}, "snippet": " self.unreg_sensor()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Return_L78_C8", "label": "return", "type": "return", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L72_C4", "vector": [13, 2, 0.5735, 0.0074, 2, 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_99362:FunctionDef_L80_C4", "label": "read", "type": "function", "loc": [80, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:ClassDef_L18_C0", "vector": [2, 1, 0.5919, 0.0147, 1, 0.85, 0.7143, 453, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "read", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def read( self ):\n return np.copy( self.l_read ), np.copy( self.r_read )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Return_L81_C8", "label": "return", "type": "return", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L80_C4", "vector": [13, 2, 0.5956, 0.0074, 2, 0.44, 0.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.copy( self.l_read ), np.copy( self.r_read )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L83_C4", "label": "thresh_service", "type": "function", "loc": [83, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:ClassDef_L18_C0", "vector": [2, 1, 0.6176, 0.0221, 1, 0.85, 0.8571, 84, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "thresh_service", "arg_names": ["self", "request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def thresh_service( self, request ):\n self.thresh_detect( request.rotate, request.displace ) # yeah, jacked up names\n return int( True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L84_C8", "label": "thresh_detect()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L83_C4", "vector": [8, 2, 0.6176, 0.0074, 2, 0.99, 0.0, 233, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "thresh_detect", "arg_names": [], "import_names": [], "rhs_call_name": "thresh_detect", "annotation": ""}, "snippet": " self.thresh_detect( request.rotate, request.displace ) # yeah, jacked up names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Return_L85_C8", "label": "return", "type": "return", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L83_C4", "vector": [13, 2, 0.625, 0.0074, 2, 0.99, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return int( True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L87_C4", "label": "thresh_detect", "type": "function", "loc": [87, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:ClassDef_L18_C0", "vector": [2, 1, 0.6949, 0.1176, 1, 0.85, 1.0, 233, 0, 3, 1, 0, 0, 0, 12], "semantic": {"name": "thresh_detect", "arg_names": ["self", "threshold", "timeout"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def thresh_detect( self, threshold, timeout = 100.0 ):\n rospy.logout( 'tactile_sensor: Threshold detector activated: %3.2f, timeout: %d' % (threshold, timeout))\n self.bias()\n self.reg_sensor()\n t0 = time.time()\n t_diff = time.time() - t0\n lp = t0 # Printing status messages\n while self.mag < threshold and t_diff < timeout:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L88_C8", "label": "logout()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L87_C4", "vector": [8, 2, 0.6471, 0.0074, 2, 0.62, 0.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'tactile_sensor: Threshold detector activated: %3.2f, timeout: %d' % (threshold, timeout))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L89_C8", "label": "bias()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L87_C4", "vector": [8, 2, 0.6544, 0.0074, 2, 0.62, 0.1111, 354, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bias", "arg_names": [], "import_names": [], "rhs_call_name": "bias", "annotation": ""}, "snippet": " self.bias()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L90_C8", "label": "reg_sensor()", "type": "expression", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L87_C4", "vector": [8, 2, 0.6618, 0.0074, 2, 0.62, 0.2222, 443, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "reg_sensor", "arg_names": [], "import_names": [], "rhs_call_name": "reg_sensor", "annotation": ""}, "snippet": " self.reg_sensor()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L91_C8", "label": "t0 = time()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L87_C4", "vector": [14, 2, 0.6691, 0.0074, 2, 0.62, 0.3333, 573, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "t0", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " t0 = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L92_C8", "label": "t_diff =", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L87_C4", "vector": [14, 2, 0.6765, 0.0074, 2, 0.62, 0.4444, 435, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "t_diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t_diff = time.time() - t0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L93_C8", "label": "lp =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L87_C4", "vector": [14, 2, 0.6838, 0.0074, 2, 0.62, 0.5556, 721, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lp = t0 # Printing status messages"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:While_L94_C8", "label": "while", "type": "while", "loc": [94, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L87_C4", "vector": [5, 2, 0.7096, 0.0441, 2, 0.62, 0.6667, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.mag < threshold and t_diff < timeout:\n if time.time() - lp > 1.0:\n lp = time.time()\n rospy.logout( 'tactile_sensor: Threshold still undetected' )\n time.sleep( 0.05 )\n t_diff = time.time() - t0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L95_C12", "label": "if", "type": "if", "loc": [95, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:While_L94_C8", "vector": [4, 3, 0.7059, 0.0221, 3, 0.07, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if time.time() - lp > 1.0:\n lp = time.time()\n rospy.logout( 'tactile_sensor: Threshold still undetected' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L96_C16", "label": "lp = time()", "type": "assigned_variable", "loc": [96, 96], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L95_C12", "vector": [14, 4, 0.7059, 0.0074, 4, 0.27, 0.0, 721, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "lp", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " lp = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L97_C16", "label": "logout()", "type": "expression", "loc": [97, 97], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L95_C12", "vector": [8, 4, 0.7132, 0.0074, 4, 0.27, 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( 'tactile_sensor: Threshold still undetected' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L98_C12", "label": "sleep()", "type": "expression", "loc": [98, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:While_L94_C8", "vector": [8, 3, 0.7206, 0.0074, 3, 0.07, 0.5, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep( 0.05 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L99_C12", "label": "t_diff =", "type": "assigned_variable", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:While_L94_C8", "vector": [14, 3, 0.7279, 0.0074, 3, 0.07, 1.0, 435, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "t_diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t_diff = time.time() - t0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L100_C8", "label": "unreg_sensor()", "type": "expression", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L87_C4", "vector": [8, 2, 0.7353, 0.0074, 2, 0.62, 0.7778, 809, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "unreg_sensor", "arg_names": [], "import_names": [], "rhs_call_name": "unreg_sensor", "annotation": ""}, "snippet": " self.unreg_sensor()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L101_C8", "label": "logout()", "type": "expression", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L87_C4", "vector": [8, 2, 0.7426, 0.0074, 2, 0.62, 0.8889, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'tactile_sensor: Detected (or timeout)' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Return_L102_C8", "label": "return", "type": "return", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L87_C4", "vector": [13, 2, 0.75, 0.0074, 2, 0.62, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.mag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L104_C0", "label": "if", "type": "if", "loc": [104, 118], "level": 0, "parent": null, "vector": [4, 0, 0.8162, 0.1103, 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 optparse\n p = optparse.OptionParser()\n p.add_option('-r', '--right', action='store_true', dest='right', default=False,\n help='Right finger')\n p.add_option('-l', '--left', action='store_true', dest='left', default=False,\n help='left finger')\n opt, args = p.parse_args()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Import_L105_C4", "label": "optparse import optparse", "type": "import", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L104_C0", "vector": [1, 1, 0.7721, 0.0074, 1, 0.25, 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_99362:Assign_L106_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L104_C0", "vector": [14, 1, 0.7794, 0.0074, 1, 0.25, 0.1429, 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_99362:Expr_L107_C4", "label": "add_option()", "type": "expression", "loc": [107, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L104_C0", "vector": [8, 1, 0.7904, 0.0147, 1, 0.25, 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('-r', '--right', action='store_true', dest='right', default=False,\n help='Right finger')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L109_C4", "label": "add_option()", "type": "expression", "loc": [109, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L104_C0", "vector": [8, 1, 0.8051, 0.0147, 1, 0.25, 0.4286, 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('-l', '--left', action='store_true', dest='left', default=False,\n help='left finger')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L111_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L104_C0", "vector": [14, 1, 0.8162, 0.0074, 1, 0.25, 0.5714, 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_99362:If_L113_C4", "label": "if", "type": "if", "loc": [113, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L104_C0", "vector": [4, 1, 0.8346, 0.0147, 1, 0.25, 0.7143, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.right:\n r_tact = TactileSensor('/pressure/r_gripper_motor')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L114_C8", "label": "r_tact = TactileSensor()", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L113_C4", "vector": [14, 2, 0.8382, 0.0074, 2, 0.78, 0.0, 353, 3, 1, 0, 0, 495, 10, 1], "semantic": {"name": "r_tact", "arg_names": [], "import_names": [], "rhs_call_name": "TactileSensor", "annotation": ""}, "snippet": " r_tact = TactileSensor('/pressure/r_gripper_motor')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L115_C4", "label": "if", "type": "if", "loc": [115, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L104_C0", "vector": [4, 1, 0.8493, 0.0147, 1, 0.25, 0.8571, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.left:\n l_tact = TactileSensor('/pressure/l_gripper_motor')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L116_C8", "label": "l_tact = TactileSensor()", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L115_C4", "vector": [14, 2, 0.8529, 0.0074, 2, 0.7, 0.0, 215, 3, 1, 0, 0, 495, 10, 1], "semantic": {"name": "l_tact", "arg_names": [], "import_names": [], "rhs_call_name": "TactileSensor", "annotation": ""}, "snippet": " l_tact = TactileSensor('/pressure/l_gripper_motor')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L118_C4", "label": "spin()", "type": "expression", "loc": [118, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L104_C0", "vector": [8, 1, 0.8676, 0.0074, 1, 0.25, 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_99362:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Return_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Try_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:Try_L22_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L23_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:While_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:While_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Return_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Return_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Return_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:While_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:While_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L95_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L96_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L95_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L97_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:While_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:While_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Return_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Import_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Assign_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99362:If_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99362:Expr_L118_C4"}]
#! /usr/bin/python import time import roslib roslib.load_manifest('rospy') roslib.load_manifest('geometry_msgs') roslib.load_manifest('hrl_rfid') roslib.load_manifest('robotis') import time import rospy from geometry_msgs.msg import Twist import numpy as np, math import hrl_rfid.ros_M5e_client as rmc import robotis.ros_robotis as rr from threading import Thread class ServoNode( Thread ): def __init__( self ): Thread.__init__( self ) self.should_run = True rospy.logout('servo_node: Initializing') rospy.init_node('servo_node') # Unfold "ears" to servo positions p_left = rr.ROS_Robotis_Client( 'left_pan' ) t_left = rr.ROS_Robotis_Client( 'left_tilt' ) p_left.move_angle( math.radians(-40), math.radians(10), blocking = False ) t_left.move_angle( 0.0, math.radians(10), blocking = False ) p_right = rr.ROS_Robotis_Client( 'right_pan' ) t_right = rr.ROS_Robotis_Client( 'right_tilt' ) p_right.move_angle( math.radians(40), math.radians(10), blocking = False ) t_right.move_angle( 0.0, math.radians(10), blocking = False ) self.reader = rmc.ROS_M5e_Client('ears') self.reader.track_mode('person ') # Use assisted teleop as pseudo-callback to see if valid movement: self.check_pub = rospy.Publisher( 'rfid_cmd_vel_check', Twist ) self.sub = rospy.Subscriber( "assisted_teleop_response", Twist, self.callback ) self.command_pub = rospy.Publisher( "rfid_cmd_vel", Twist ) self.moving = True time.sleep(3.0) # give antennas time to settle self.start() def callback( self, msg ): #print 'Hit callback: ', msg self.response_received = True self.response = msg def sloppy_check( self, desired_movement, timeout = 5.0 ): #print 'Checking: ', desired_movement # Simple statemachine with self.callback. Checks to see if # assisted teleop returns an unaltered command self.response_received = False self.response = Twist() self.check_pub.publish( desired_movement ) t0 = time.time() # wait for the callback to be received while not self.response_received and time.time() - t0 < timeout and self.should_run and not rospy.is_shutdown(): time.sleep(0.01) # Apply some hysteresis to starting & stopping conditions if self.moving: if self.response.linear.x > 0.04: self.moving = True # As long as safe move is within 40%, keep moving return self.response, True else: self.moving = False return Twist(), False # Otherwise stop else: if self.response.linear.x > 0.075: self.moving = True # Wait until it is within 75% to resume movement return self.response, True else: self.moving = False return Twist(), False # Otherwise remain stop def run( self ): rospy.logout('servo_node: Running') filt_x = [] filt_z = [] while self.should_run and not rospy.is_shutdown(): left = self.reader.read('EleLeftEar')[-1] if left == -1 or left < 75: left = 75 right = self.reader.read('EleRightEar')[-1] if right == -1 or right < 75: right = 75 check = Twist() check.linear.x = 0.1 check.angular.z = 0.07 * (left - right)/5.0 safe_move, continue_moving = self.sloppy_check( check ) if continue_moving: filt_z.append( check.angular.z ) filt_x.append( check.linear.x ) else: filt_z.append( 0.0 ) filt_x.append( 0.0 ) if len( filt_z ) < 5 or len( filt_x ) < 5: # let the 5-point averager fill up. continue filt_z = filt_z[1:] filt_x = filt_x[1:] filt_movement = Twist() filt_movement.linear.x = np.average( filt_x ) filt_movement.angular.z = np.average( filt_z ) self.command_pub.publish( filt_movement ) time.sleep(0.01) # Stop the RFID reader (conserve power and hardware) try: r.stop() except: # If servo_node is being run in the same launch file, stop is a # race condition with service disappearing. Just ignore. pass self.command_pub.publish( Twist() ) # Halt the base (just in case) rospy.logout('servo_node: Exiting') def stop( self ): self.should_run = False self.join(3) if (self.isAlive()): raise RuntimeError("servo_node: unable to stop thread") if __name__ == '__main__': sn = ServoNode() rospy.spin() sn.stop()
ajibawa-2023/Python-Code-Large/train/row_99363
96
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_99363:Import_L2_C0", "label": "time import time", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0132, 0.0066, 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_99363:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0199, 0.0066, 0, 0.66, 0.0714, 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_99363:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0265, 0.0066, 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": "roslib.load_manifest('rospy')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0331, 0.0066, 0, 0.66, 0.2143, 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_99363:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0397, 0.0066, 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": "roslib.load_manifest('hrl_rfid')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0464, 0.0066, 0, 0.66, 0.3571, 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('robotis')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Import_L9_C0", "label": "time import time", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0596, 0.0066, 0, 0.66, 0.4286, 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_99363:Import_L10_C0", "label": "rospy import rospy", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0662, 0.0066, 0, 0.66, 0.5, 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_99363:ImportFrom_L11_C0", "label": "from geometry_msgs.msg import Twist", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0728, 0.0066, 0, 0.66, 0.5714, 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_99363:Import_L12_C0", "label": "numpy import np, math", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0795, 0.0066, 0, 0.66, 0.6429, 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_99363:Import_L13_C0", "label": "hrl_rfid.ros_M5e_client import rmc", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0861, 0.0066, 0, 0.66, 0.7143, 460, 0, 1, 0, 0, 460, 0, 0], "semantic": {"name": "hrl_rfid.ros_M5e_client", "arg_names": [], "import_names": ["rmc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_rfid.ros_M5e_client as rmc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Import_L14_C0", "label": "robotis.ros_robotis import rr", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0927, 0.0066, 0, 0.66, 0.7857, 570, 0, 1, 0, 0, 570, 0, 0], "semantic": {"name": "robotis.ros_robotis", "arg_names": [], "import_names": ["rr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import robotis.ros_robotis as rr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:ImportFrom_L15_C0", "label": "from threading import Thread", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0993, 0.0066, 0, 0.66, 0.8571, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["Thread"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import Thread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:ClassDef_L17_C0", "label": "ServoNode", "type": "class", "loc": [17, 144], "level": 0, "parent": null, "vector": [3, 0, 0.5331, 0.8477, 0, 0.66, 0.9286, 654, 0, 5, 0, 0, 134, 0, 56], "semantic": {"name": "ServoNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ServoNode( Thread ):\n def __init__( self ):\n Thread.__init__( self )\n\n self.should_run = True\n\n rospy.logout('servo_node: Initializing')\n rospy.init_node('servo_node')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "label": "__init__", "type": "function", "loc": [18, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:ClassDef_L17_C0", "vector": [2, 1, 0.2252, 0.2185, 1, 0.77, 0.0, 555, 0, 1, 0, 0, 0, 0, 24], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self ):\n Thread.__init__( self )\n\n self.should_run = True\n\n rospy.logout('servo_node: Initializing')\n rospy.init_node('servo_node')\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L19_C8", "label": "__init__()", "type": "expression", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "vector": [8, 2, 0.1258, 0.0066, 2, 0.37, 0.0, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Thread.__init__( self )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L21_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "vector": [14, 2, 0.1391, 0.0066, 2, 0.37, 0.0526, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L23_C8", "label": "logout()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "vector": [8, 2, 0.1523, 0.0066, 2, 0.37, 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('servo_node: Initializing')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L24_C8", "label": "init_node()", "type": "expression", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "vector": [8, 2, 0.1589, 0.0066, 2, 0.37, 0.1579, 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('servo_node')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L27_C8", "label": "p_left = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "vector": [14, 2, 0.1788, 0.0066, 2, 0.37, 0.2105, 339, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "p_left", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " p_left = rr.ROS_Robotis_Client( 'left_pan' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L28_C8", "label": "t_left = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "vector": [14, 2, 0.1854, 0.0066, 2, 0.37, 0.2632, 276, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "t_left", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " t_left = rr.ROS_Robotis_Client( 'left_tilt' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L30_C8", "label": "move_angle()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "vector": [8, 2, 0.1987, 0.0066, 2, 0.37, 0.3158, 293, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " p_left.move_angle( math.radians(-40), math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L31_C8", "label": "move_angle()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "vector": [8, 2, 0.2053, 0.0066, 2, 0.37, 0.3684, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " t_left.move_angle( 0.0, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L33_C8", "label": "p_right = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "vector": [14, 2, 0.2185, 0.0066, 2, 0.37, 0.4211, 866, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "p_right", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " p_right = rr.ROS_Robotis_Client( 'right_pan' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L34_C8", "label": "t_right = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "vector": [14, 2, 0.2252, 0.0066, 2, 0.37, 0.4737, 942, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "t_right", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " t_right = rr.ROS_Robotis_Client( 'right_tilt' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L36_C8", "label": "move_angle()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "vector": [8, 2, 0.2384, 0.0066, 2, 0.37, 0.5263, 293, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " p_right.move_angle( math.radians(40), math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L37_C8", "label": "move_angle()", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "vector": [8, 2, 0.245, 0.0066, 2, 0.37, 0.5789, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " t_right.move_angle( 0.0, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L39_C8", "label": "self.reader = ROS_M5e_Client()", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "vector": [14, 2, 0.2583, 0.0066, 2, 0.37, 0.6316, 536, 3, 1, 0, 0, 479, 10, 1], "semantic": {"name": "self.reader", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_M5e_Client", "annotation": ""}, "snippet": " self.reader = rmc.ROS_M5e_Client('ears')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L40_C8", "label": "track_mode()", "type": "expression", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "vector": [8, 2, 0.2649, 0.0066, 2, 0.37, 0.6842, 884, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "track_mode", "arg_names": [], "import_names": [], "rhs_call_name": "track_mode", "annotation": ""}, "snippet": " self.reader.track_mode('person ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L43_C8", "label": "self.check_pub = Publisher()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "vector": [14, 2, 0.2848, 0.0066, 2, 0.37, 0.7368, 517, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.check_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.check_pub = rospy.Publisher( 'rfid_cmd_vel_check', Twist )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L44_C8", "label": "self.sub = Subscriber()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "vector": [14, 2, 0.2914, 0.0066, 2, 0.37, 0.7895, 88, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "self.sub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " self.sub = rospy.Subscriber( \"assisted_teleop_response\", Twist, self.callback )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L45_C8", "label": "self.command_pub = Publisher()", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "vector": [14, 2, 0.298, 0.0066, 2, 0.37, 0.8421, 513, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.command_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.command_pub = rospy.Publisher( \"rfid_cmd_vel\", Twist )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L47_C8", "label": "self.moving =", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "vector": [14, 2, 0.3113, 0.0066, 2, 0.37, 0.8947, 236, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.moving", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.moving = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L48_C8", "label": "sleep()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "vector": [8, 2, 0.3179, 0.0066, 2, 0.37, 0.9474, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep(3.0) # give antennas time to settle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L50_C8", "label": "start()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "vector": [8, 2, 0.3311, 0.0066, 2, 0.37, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L52_C4", "label": "callback", "type": "function", "loc": [52, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:ClassDef_L17_C0", "vector": [2, 1, 0.3543, 0.0265, 1, 0.77, 0.25, 342, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "callback", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def callback( self, msg ):\n #print 'Hit callback: ', msg\n self.response_received = True\n self.response = msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L54_C8", "label": "self.response_received =", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L52_C4", "vector": [14, 2, 0.3576, 0.0066, 2, 0.17, 0.0, 39, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.response_received", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.response_received = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L55_C8", "label": "self.response =", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L52_C4", "vector": [14, 2, 0.3642, 0.0066, 2, 0.17, 1.0, 498, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.response", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.response = msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L57_C4", "label": "sloppy_check", "type": "function", "loc": [57, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:ClassDef_L17_C0", "vector": [2, 1, 0.4702, 0.1921, 1, 0.77, 0.5, 779, 0, 3, 1, 0, 0, 0, 8], "semantic": {"name": "sloppy_check", "arg_names": ["self", "desired_movement", "timeout"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def sloppy_check( self, desired_movement, timeout = 5.0 ):\n #print 'Checking: ', desired_movement\n # Simple statemachine with self.callback. Checks to see if\n # assisted teleop returns an unaltered command\n self.response_received = False\n self.response = Twist()\n\n self.check_pub.publish( desired_movement )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L61_C8", "label": "self.response_received =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L57_C4", "vector": [14, 2, 0.404, 0.0066, 2, 0.6, 0.0, 39, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.response_received", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.response_received = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L62_C8", "label": "self.response = Twist()", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L57_C4", "vector": [14, 2, 0.4106, 0.0066, 2, 0.6, 0.2, 498, 3, 0, 0, 0, 9, 10, 1], "semantic": {"name": "self.response", "arg_names": [], "import_names": [], "rhs_call_name": "Twist", "annotation": ""}, "snippet": " self.response = Twist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L64_C8", "label": "publish()", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L57_C4", "vector": [8, 2, 0.4238, 0.0066, 2, 0.6, 0.4, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.check_pub.publish( desired_movement )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L65_C8", "label": "t0 = time()", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L57_C4", "vector": [14, 2, 0.4305, 0.0066, 2, 0.6, 0.6, 573, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "t0", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " t0 = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L68_C8", "label": "while", "type": "while", "loc": [68, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L57_C4", "vector": [5, 2, 0.4536, 0.0132, 2, 0.6, 0.8, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not self.response_received and time.time() - t0 < timeout and self.should_run and not rospy.is_shutdown():\n time.sleep(0.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L69_C12", "label": "sleep()", "type": "expression", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L68_C8", "vector": [8, 3, 0.457, 0.0066, 3, 0.23, 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.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L72_C8", "label": "if", "type": "if", "loc": [72, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L57_C4", "vector": [4, 2, 0.5199, 0.0927, 2, 0.6, 1.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.moving:\n if self.response.linear.x > 0.04:\n self.moving = True # As long as safe move is within 40%, keep moving\n return self.response, True \n else:\n self.moving = False\n return Twist(), False # Otherwise stop\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L73_C12", "label": "if", "type": "if", "loc": [73, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L72_C8", "vector": [4, 3, 0.5, 0.0397, 3, 0.98, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.response.linear.x > 0.04:\n self.moving = True # As long as safe move is within 40%, keep moving\n return self.response, True \n else:\n self.moving = False\n return Twist(), False # Otherwise stop"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L74_C16", "label": "self.moving =", "type": "assigned_variable", "loc": [74, 74], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L73_C12", "vector": [14, 4, 0.4901, 0.0066, 4, 0.08, 0.0, 236, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.moving", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.moving = True # As long as safe move is within 40%, keep moving"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Return_L75_C16", "label": "return", "type": "return", "loc": [75, 75], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L73_C12", "vector": [13, 4, 0.4967, 0.0066, 4, 0.08, 0.3333, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.response, True "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L77_C16", "label": "self.moving =", "type": "assigned_variable", "loc": [77, 77], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L73_C12", "vector": [14, 4, 0.5099, 0.0066, 4, 0.08, 0.6667, 236, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.moving", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.moving = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Return_L78_C16", "label": "return", "type": "return", "loc": [78, 78], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L73_C12", "vector": [13, 4, 0.5166, 0.0066, 4, 0.08, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Twist(), False # Otherwise stop"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L80_C12", "label": "if", "type": "if", "loc": [80, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L72_C8", "vector": [4, 3, 0.5464, 0.0397, 3, 0.98, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.response.linear.x > 0.075: \n self.moving = True # Wait until it is within 75% to resume movement\n return self.response, True \n else:\n self.moving = False\n return Twist(), False # Otherwise remain stop"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L81_C16", "label": "self.moving =", "type": "assigned_variable", "loc": [81, 81], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L80_C12", "vector": [14, 4, 0.5364, 0.0066, 4, 0.2, 0.0, 236, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.moving", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.moving = True # Wait until it is within 75% to resume movement"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Return_L82_C16", "label": "return", "type": "return", "loc": [82, 82], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L80_C12", "vector": [13, 4, 0.543, 0.0066, 4, 0.2, 0.3333, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.response, True "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L84_C16", "label": "self.moving =", "type": "assigned_variable", "loc": [84, 84], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L80_C12", "vector": [14, 4, 0.5563, 0.0066, 4, 0.2, 0.6667, 236, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.moving", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.moving = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Return_L85_C16", "label": "return", "type": "return", "loc": [85, 85], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L80_C12", "vector": [13, 4, 0.5629, 0.0066, 4, 0.2, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Twist(), False # Otherwise remain stop"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L90_C4", "label": "run", "type": "function", "loc": [90, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:ClassDef_L17_C0", "vector": [2, 1, 0.7517, 0.3179, 1, 0.77, 0.75, 679, 0, 1, 0, 0, 0, 0, 21], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run( self ):\n rospy.logout('servo_node: Running')\n filt_x = []\n filt_z = []\n\n while self.should_run and not rospy.is_shutdown():\n left = self.reader.read('EleLeftEar')[-1]\n if left == -1 or left < 75:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L91_C8", "label": "logout()", "type": "expression", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L90_C4", "vector": [8, 2, 0.6026, 0.0066, 2, 0.51, 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('servo_node: Running')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L92_C8", "label": "filt_x =", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L90_C4", "vector": [14, 2, 0.6093, 0.0066, 2, 0.51, 0.1667, 124, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "filt_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filt_x = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L93_C8", "label": "filt_z =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L90_C4", "vector": [14, 2, 0.6159, 0.0066, 2, 0.51, 0.3333, 697, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "filt_z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filt_z = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "label": "while", "type": "while", "loc": [95, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L90_C4", "vector": [5, 2, 0.7318, 0.2119, 2, 0.51, 0.5, 0, 0, 0, 0, 0, 0, 0, 16], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.should_run and not rospy.is_shutdown():\n left = self.reader.read('EleLeftEar')[-1]\n if left == -1 or left < 75:\n left = 75\n right = self.reader.read('EleRightEar')[-1]\n if right == -1 or right < 75:\n right = 75\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L96_C12", "label": "left =", "type": "assigned_variable", "loc": [96, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "vector": [14, 3, 0.6358, 0.0066, 3, 0.78, 0.0, 605, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "left", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " left = self.reader.read('EleLeftEar')[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L97_C12", "label": "if", "type": "if", "loc": [97, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "vector": [4, 3, 0.6457, 0.0132, 3, 0.78, 0.0625, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if left == -1 or left < 75:\n left = 75"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L98_C16", "label": "left =", "type": "assigned_variable", "loc": [98, 98], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L97_C12", "vector": [14, 4, 0.649, 0.0066, 4, 0.6, 0.0, 605, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "left", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " left = 75"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L99_C12", "label": "right =", "type": "assigned_variable", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "vector": [14, 3, 0.6556, 0.0066, 3, 0.78, 0.125, 724, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "right", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " right = self.reader.read('EleRightEar')[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L100_C12", "label": "if", "type": "if", "loc": [100, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "vector": [4, 3, 0.6656, 0.0132, 3, 0.78, 0.1875, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if right == -1 or right < 75:\n right = 75"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L101_C16", "label": "right =", "type": "assigned_variable", "loc": [101, 101], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L100_C12", "vector": [14, 4, 0.6689, 0.0066, 4, 0.7, 0.0, 724, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "right", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " right = 75"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L103_C12", "label": "check = Twist()", "type": "assigned_variable", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "vector": [14, 3, 0.6821, 0.0066, 3, 0.78, 0.25, 803, 3, 0, 0, 0, 9, 10, 1], "semantic": {"name": "check", "arg_names": [], "import_names": [], "rhs_call_name": "Twist", "annotation": ""}, "snippet": " check = Twist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L104_C12", "label": "check.linear.x =", "type": "assigned_variable", "loc": [104, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "vector": [14, 3, 0.6887, 0.0066, 3, 0.78, 0.3125, 860, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "check.linear.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " check.linear.x = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L105_C12", "label": "check.angular.z =", "type": "assigned_variable", "loc": [105, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "vector": [14, 3, 0.6954, 0.0066, 3, 0.78, 0.375, 781, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "check.angular.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " check.angular.z = 0.07 * (left - right)/5.0 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L107_C12", "label": "safe_move, continue_moving = sloppy_check()", "type": "assigned_variable", "loc": [107, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "vector": [14, 3, 0.7086, 0.0066, 3, 0.78, 0.4375, 958, 3, 1, 0, 0, 779, 10, 1], "semantic": {"name": "safe_move, continue_moving", "arg_names": [], "import_names": [], "rhs_call_name": "sloppy_check", "annotation": ""}, "snippet": " safe_move, continue_moving = self.sloppy_check( check )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L109_C12", "label": "if", "type": "if", "loc": [109, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "vector": [4, 3, 0.7384, 0.0397, 3, 0.78, 0.5, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if continue_moving:\n filt_z.append( check.angular.z )\n filt_x.append( check.linear.x )\n else:\n filt_z.append( 0.0 )\n filt_x.append( 0.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L110_C16", "label": "append()", "type": "expression", "loc": [110, 110], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L109_C12", "vector": [8, 4, 0.7285, 0.0066, 4, 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": " filt_z.append( check.angular.z )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L111_C16", "label": "append()", "type": "expression", "loc": [111, 111], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L109_C12", "vector": [8, 4, 0.7351, 0.0066, 4, 0.38, 0.3333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " filt_x.append( check.linear.x )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L113_C16", "label": "append()", "type": "expression", "loc": [113, 113], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L109_C12", "vector": [8, 4, 0.7483, 0.0066, 4, 0.38, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " filt_z.append( 0.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L114_C16", "label": "append()", "type": "expression", "loc": [114, 114], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L109_C12", "vector": [8, 4, 0.755, 0.0066, 4, 0.38, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " filt_x.append( 0.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L116_C12", "label": "if", "type": "if", "loc": [116, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "vector": [4, 3, 0.7715, 0.0132, 3, 0.78, 0.5625, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len( filt_z ) < 5 or len( filt_x ) < 5: # let the 5-point averager fill up.\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L118_C12", "label": "filt_z =", "type": "assigned_variable", "loc": [118, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "vector": [14, 3, 0.7815, 0.0066, 3, 0.78, 0.625, 697, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "filt_z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filt_z = filt_z[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L119_C12", "label": "filt_x =", "type": "assigned_variable", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "vector": [14, 3, 0.7881, 0.0066, 3, 0.78, 0.6875, 124, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "filt_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filt_x = filt_x[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L121_C12", "label": "filt_movement = Twist()", "type": "assigned_variable", "loc": [121, 121], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "vector": [14, 3, 0.8013, 0.0066, 3, 0.78, 0.75, 720, 3, 0, 0, 0, 9, 10, 1], "semantic": {"name": "filt_movement", "arg_names": [], "import_names": [], "rhs_call_name": "Twist", "annotation": ""}, "snippet": " filt_movement = Twist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L122_C12", "label": "filt_movement.linear.x = average()", "type": "assigned_variable", "loc": [122, 122], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "vector": [14, 3, 0.8079, 0.0066, 3, 0.78, 0.8125, 965, 3, 1, 0, 0, 273, 10, 1], "semantic": {"name": "filt_movement.linear.x", "arg_names": [], "import_names": [], "rhs_call_name": "average", "annotation": ""}, "snippet": " filt_movement.linear.x = np.average( filt_x )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L123_C12", "label": "filt_movement.angular.z = average()", "type": "assigned_variable", "loc": [123, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "vector": [14, 3, 0.8146, 0.0066, 3, 0.78, 0.875, 889, 3, 1, 0, 0, 273, 10, 1], "semantic": {"name": "filt_movement.angular.z", "arg_names": [], "import_names": [], "rhs_call_name": "average", "annotation": ""}, "snippet": " filt_movement.angular.z = np.average( filt_z )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L125_C12", "label": "publish()", "type": "expression", "loc": [125, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "vector": [8, 3, 0.8278, 0.0066, 3, 0.78, 0.9375, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.command_pub.publish( filt_movement )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L126_C12", "label": "sleep()", "type": "expression", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "vector": [8, 3, 0.8344, 0.0066, 3, 0.78, 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(0.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Try_L129_C8", "label": "try", "type": "try", "loc": [129, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L90_C4", "vector": [7, 2, 0.8709, 0.0397, 2, 0.51, 0.6667, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n r.stop()\n except: \n # If servo_node is being run in the same launch file, stop is a\n # race condition with service disappearing. Just ignore.\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L130_C12", "label": "stop()", "type": "expression", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:Try_L129_C8", "vector": [8, 3, 0.8609, 0.0066, 3, 0.56, 0.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " r.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L136_C8", "label": "publish()", "type": "expression", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L90_C4", "vector": [8, 2, 0.9007, 0.0066, 2, 0.51, 0.8333, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.command_pub.publish( Twist() ) # Halt the base (just in case)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L137_C8", "label": "logout()", "type": "expression", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L90_C4", "vector": [8, 2, 0.9073, 0.0066, 2, 0.51, 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('servo_node: Exiting')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L140_C4", "label": "stop", "type": "function", "loc": [140, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:ClassDef_L17_C0", "vector": [2, 1, 0.9404, 0.0331, 1, 0.77, 1.0, 343, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "stop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop( self ):\n self.should_run = False\n self.join(3)\n if (self.isAlive()):\n raise RuntimeError(\"servo_node: unable to stop thread\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L141_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L140_C4", "vector": [14, 2, 0.9338, 0.0066, 2, 0.37, 0.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L142_C8", "label": "join()", "type": "expression", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L140_C4", "vector": [8, 2, 0.9404, 0.0066, 2, 0.37, 0.5, 933, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.join(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L143_C8", "label": "if", "type": "if", "loc": [143, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L140_C4", "vector": [4, 2, 0.9503, 0.0132, 2, 0.37, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.isAlive()):\n raise RuntimeError(\"servo_node: unable to stop thread\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L147_C0", "label": "if", "type": "if", "loc": [147, 150], "level": 0, "parent": null, "vector": [4, 0, 0.9834, 0.0265, 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 sn = ServoNode()\n rospy.spin()\n sn.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L148_C4", "label": "sn = ServoNode()", "type": "assigned_variable", "loc": [148, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L147_C0", "vector": [14, 1, 0.9801, 0.0066, 1, 0.33, 0.0, 981, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "sn", "arg_names": [], "import_names": [], "rhs_call_name": "ServoNode", "annotation": ""}, "snippet": " sn = ServoNode()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L149_C4", "label": "spin()", "type": "expression", "loc": [149, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L147_C0", "vector": [8, 1, 0.9868, 0.0066, 1, 0.33, 0.5, 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_99363:Expr_L150_C4", "label": "stop()", "type": "expression", "loc": [150, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L147_C0", "vector": [8, 1, 0.9934, 0.0066, 1, 0.33, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " sn.stop()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99363:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L68_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L73_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L74_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L73_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Return_L75_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L73_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L77_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L73_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Return_L78_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L80_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L81_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L80_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Return_L82_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L80_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L84_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L80_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Return_L85_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L96_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L97_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L97_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L98_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L100_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L101_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L104_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L105_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L109_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L110_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L109_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L111_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L109_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L113_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L109_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L114_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L118_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L119_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L121_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L123_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:While_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Try_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:Try_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L147_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Assign_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L147_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99363:If_L147_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99363:Expr_L150_C4"}]
#!/usr/bin/python # Merges functionality from ros_M5e in hrl_rfid package. # if opt.device == 'ears': # print 'Starting Ears RFID Services' # ros_rfid = ROS_M5e( name = 'ears', readPwr = opt.power, # portStr = '/dev/robot/RFIDreader', # antFuncs = [EleLeftEar, EleRightEar], # callbacks = [] ) # rospy.spin() # ros_rfid.stop() import roslib roslib.load_manifest( 'robotis' ) roslib.load_manifest( 'hrl_rfid' ) roslib.load_manifest( 'rfid_people_following' ) import rospy import time from threading import Thread # The Servers need to distinguish b/w real vs. simulated! # They implement same services / functions. (Clients unaffected) import os if os.environ.has_key('ROBOT') and os.environ['ROBOT'] == 'sim': import rfid_people_following.robotis_servo_sim as rr import rfid_people_following.M5e_reader_sim as rM5e else: import robotis.ros_robotis as rr import hrl_rfid.ros_M5e as rM5e if __name__ == '__main__': # p_right = rr.ROS_Robotis_Poller( '/dev/robot/servo1', [29,30], ['right_pan', 'right_tilt'] ) # p_left = rr.ROS_Robotis_Poller( '/dev/robot/servo0', [27,28], ['left_pan', 'left_tilt'] ) p_right = rr.ROS_Robotis_Poller( '/dev/robot/servo1', [29,30], ['right_pan', 'right_tilt'] ) p_left = rr.ROS_Robotis_Poller( '/dev/robot/servo0', [27,28], ['left_pan', 'left_tilt'] ) # p_right = rr.ROS_Robotis_Poller( '/dev/robot/servo0', [29,30], ['right_pan', 'right_tilt'] ) # p_left = rr.ROS_Robotis_Poller( '/dev/robot/servo1', [27,28], ['left_pan', 'left_tilt'] ) ros_rfid = rM5e.ROS_M5e( name = 'ears', readPwr = 3000, portStr = '/dev/robot/RFIDreader', antFuncs = [ rM5e.EleLeftEar, rM5e.EleRightEar ], callbacks = [] ) rospy.spin() ros_rfid.stop() p_right.stop() p_left.stop()
ajibawa-2023/Python-Code-Large/train/row_99364
21
51
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99364:Import_L14_C0", "label": "roslib import roslib", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.2745, 0.0196, 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_99364:Expr_L15_C0", "label": "load_manifest()", "type": "expression", "loc": [15, 15], "level": 0, "parent": null, "vector": [8, 0, 0.2941, 0.0196, 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": "roslib.load_manifest( 'robotis' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99364:Expr_L16_C0", "label": "load_manifest()", "type": "expression", "loc": [16, 16], "level": 0, "parent": null, "vector": [8, 0, 0.3137, 0.0196, 0, 0.66, 0.2222, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'hrl_rfid' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99364:Expr_L17_C0", "label": "load_manifest()", "type": "expression", "loc": [17, 17], "level": 0, "parent": null, "vector": [8, 0, 0.3333, 0.0196, 0, 0.66, 0.3333, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'rfid_people_following' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99364:Import_L18_C0", "label": "rospy import rospy", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.3529, 0.0196, 0, 0.66, 0.4444, 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_99364:Import_L20_C0", "label": "time import time", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.3922, 0.0196, 0, 0.66, 0.5556, 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_99364:ImportFrom_L21_C0", "label": "from threading import Thread", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.4118, 0.0196, 0, 0.66, 0.6667, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["Thread"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import Thread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99364:Import_L25_C0", "label": "os import os", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.4902, 0.0196, 0, 0.66, 0.7778, 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_99364:If_L26_C0", "label": "if", "type": "if", "loc": [26, 32], "level": 0, "parent": null, "vector": [4, 0, 0.5686, 0.1373, 0, 0.66, 0.8889, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if os.environ.has_key('ROBOT') and os.environ['ROBOT'] == 'sim':\n import rfid_people_following.robotis_servo_sim as rr\n import rfid_people_following.M5e_reader_sim as rM5e\n \nelse:\n import robotis.ros_robotis as rr\n import hrl_rfid.ros_M5e as rM5e"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99364:Import_L27_C4", "label": "rfid_people_following.robotis_servo_sim import rr", "type": "import", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99364:If_L26_C0", "vector": [1, 1, 0.5294, 0.0196, 1, 0.75, 0.0, 790, 0, 1, 0, 0, 790, 0, 0], "semantic": {"name": "rfid_people_following.robotis_servo_sim", "arg_names": [], "import_names": ["rr"], "rhs_call_name": "", "annotation": ""}, "snippet": " import rfid_people_following.robotis_servo_sim as rr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99364:Import_L28_C4", "label": "rfid_people_following.M5e_reader_sim import rM5e", "type": "import", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99364:If_L26_C0", "vector": [1, 1, 0.549, 0.0196, 1, 0.75, 0.3333, 501, 0, 1, 0, 0, 501, 0, 0], "semantic": {"name": "rfid_people_following.M5e_reader_sim", "arg_names": [], "import_names": ["rM5e"], "rhs_call_name": "", "annotation": ""}, "snippet": " import rfid_people_following.M5e_reader_sim as rM5e"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99364:Import_L31_C4", "label": "robotis.ros_robotis import rr", "type": "import", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99364:If_L26_C0", "vector": [1, 1, 0.6078, 0.0196, 1, 0.75, 0.6667, 570, 0, 1, 0, 0, 570, 0, 0], "semantic": {"name": "robotis.ros_robotis", "arg_names": [], "import_names": ["rr"], "rhs_call_name": "", "annotation": ""}, "snippet": " import robotis.ros_robotis as rr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99364:Import_L32_C4", "label": "hrl_rfid.ros_M5e import rM5e", "type": "import", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99364:If_L26_C0", "vector": [1, 1, 0.6275, 0.0196, 1, 0.75, 1.0, 604, 0, 1, 0, 0, 604, 0, 0], "semantic": {"name": "hrl_rfid.ros_M5e", "arg_names": [], "import_names": ["rM5e"], "rhs_call_name": "", "annotation": ""}, "snippet": " import hrl_rfid.ros_M5e as rM5e"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99364:If_L35_C0", "label": "if", "type": "if", "loc": [35, 50], "level": 0, "parent": null, "vector": [4, 0, 0.8333, 0.3137, 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# p_right = rr.ROS_Robotis_Poller( '/dev/robot/servo1', [29,30], ['right_pan', 'right_tilt'] )\n# p_left = rr.ROS_Robotis_Poller( '/dev/robot/servo0', [27,28], ['left_pan', 'left_tilt'] )\n p_right = rr.ROS_Robotis_Poller( '/dev/robot/servo1', [29,30], ['right_pan', 'right_tilt'] )\n p_left = rr.ROS_Robotis_Poller( '/dev/robot/servo0', [27,28], ['left_pan', 'left_tilt'] )\n# p_right = rr.ROS_Robotis_Poller( '/dev/robot/servo0', [29,30], ['right_pan', 'right_tilt'] )\n# p_left = rr.ROS_Robotis_Poller( '/dev/robot/servo1', [27,28], ['left_pan', 'left_tilt'] )\n ros_rfid = rM5e.ROS_M5e( name = 'ears', readPwr = 3000,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99364:Assign_L38_C4", "label": "p_right = ROS_Robotis_Poller()", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99364:If_L35_C0", "vector": [14, 1, 0.7451, 0.0196, 1, 0.31, 0.0, 866, 3, 3, 0, 0, 343, 10, 1], "semantic": {"name": "p_right", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Poller", "annotation": ""}, "snippet": " p_right = rr.ROS_Robotis_Poller( '/dev/robot/servo1', [29,30], ['right_pan', 'right_tilt'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99364:Assign_L39_C4", "label": "p_left = ROS_Robotis_Poller()", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99364:If_L35_C0", "vector": [14, 1, 0.7647, 0.0196, 1, 0.31, 0.1667, 339, 3, 3, 0, 0, 343, 10, 1], "semantic": {"name": "p_left", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Poller", "annotation": ""}, "snippet": " p_left = rr.ROS_Robotis_Poller( '/dev/robot/servo0', [27,28], ['left_pan', 'left_tilt'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99364:Assign_L42_C4", "label": "ros_rfid = ROS_M5e()", "type": "assigned_variable", "loc": [42, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99364:If_L35_C0", "vector": [14, 1, 0.8529, 0.0784, 1, 0.31, 0.3333, 68, 3, 5, 0, 0, 65, 10, 1], "semantic": {"name": "ros_rfid", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_M5e", "annotation": ""}, "snippet": " ros_rfid = rM5e.ROS_M5e( name = 'ears', readPwr = 3000,\n portStr = '/dev/robot/RFIDreader',\n antFuncs = [ rM5e.EleLeftEar, rM5e.EleRightEar ],\n callbacks = [] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99364:Expr_L46_C4", "label": "spin()", "type": "expression", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99364:If_L35_C0", "vector": [8, 1, 0.902, 0.0196, 1, 0.31, 0.5, 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_99364:Expr_L48_C4", "label": "stop()", "type": "expression", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99364:If_L35_C0", "vector": [8, 1, 0.9412, 0.0196, 1, 0.31, 0.6667, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " ros_rfid.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99364:Expr_L49_C4", "label": "stop()", "type": "expression", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99364:If_L35_C0", "vector": [8, 1, 0.9608, 0.0196, 1, 0.31, 0.8333, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " p_right.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99364:Expr_L50_C4", "label": "stop()", "type": "expression", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99364:If_L35_C0", "vector": [8, 1, 0.9804, 0.0196, 1, 0.31, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " p_left.stop()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99364:If_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99364:Import_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99364:If_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99364:Import_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99364:If_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99364:Import_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99364:If_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99364:Import_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99364:If_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99364:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99364:If_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99364:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99364:If_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99364:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99364:If_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99364:Expr_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99364:If_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99364:Expr_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99364:If_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99364:Expr_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99364:If_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99364:Expr_L50_C4"}]
#!/usr/bin/python import roslib roslib.load_manifest('rfid_people_following') roslib.load_manifest('geometry_msgs') import rospy import tf from geometry_msgs.msg import PointStamped import time rospy.init_node('ground_truth_tag_pose') listener = tf.TransformListener() # listener.waitForTransform('/l_gripper_tool_frame', '/ear_antenna_left', # rospy.Time(0), timeout = rospy.Duration(10) ) listener.waitForTransform('/l_gripper_tool_frame', '/map', rospy.Time(0), timeout = rospy.Duration(10) ) rate = rospy.Rate(2) while not rospy.is_shutdown(): p = PointStamped() p.header.stamp = rospy.Time(0) p.header.frame_id = '/l_gripper_tool_frame' p.point.x = 0.015 # Frame is actually in middle of fingers. Move it out to tips #p_earl = listener.transformPoint('/ear_antenna_left', p) p_earl = listener.transformPoint('/map', p) print '<x,y,z> = <%2.3f, %2.3f, %2.3f> ' % ( p_earl.point.x, p_earl.point.y, p_earl.point.z ) rate.sleep()
ajibawa-2023/Python-Code-Large/train/row_99365
19
31
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99365:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0968, 0.0323, 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_99365:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.129, 0.0323, 0, 0.66, 0.0909, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('rfid_people_following')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99365:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.1613, 0.0323, 0, 0.66, 0.1818, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('geometry_msgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99365:Import_L6_C0", "label": "rospy import rospy", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1935, 0.0323, 0, 0.66, 0.2727, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99365:Import_L7_C0", "label": "tf import tf", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.2258, 0.0323, 0, 0.66, 0.3636, 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_99365:ImportFrom_L8_C0", "label": "from geometry_msgs.msg import PointStamped", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.2581, 0.0323, 0, 0.66, 0.4545, 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_99365:Import_L10_C0", "label": "time import time", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.3226, 0.0323, 0, 0.66, 0.5455, 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_99365:Expr_L12_C0", "label": "init_node()", "type": "expression", "loc": [12, 12], "level": 0, "parent": null, "vector": [8, 0, 0.3871, 0.0323, 0, 0.66, 0.6364, 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('ground_truth_tag_pose')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99365:Assign_L13_C0", "label": "listener = TransformListener()", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.4194, 0.0323, 0, 0.66, 0.7273, 870, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "listener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": "listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99365:Expr_L18_C0", "label": "waitForTransform()", "type": "expression", "loc": [18, 19], "level": 0, "parent": null, "vector": [8, 0, 0.5968, 0.0645, 0, 0.66, 0.8182, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": "listener.waitForTransform('/l_gripper_tool_frame', '/map',\n rospy.Time(0), timeout = rospy.Duration(10) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99365:Assign_L21_C0", "label": "rate = Rate()", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.6774, 0.0323, 0, 0.66, 0.9091, 477, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "rate", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": "rate = rospy.Rate(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99365:While_L22_C0", "label": "while", "type": "while", "loc": [22, 31], "level": 0, "parent": null, "vector": [5, 0, 0.8548, 0.3226, 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 p = PointStamped()\n p.header.stamp = rospy.Time(0)\n p.header.frame_id = '/l_gripper_tool_frame'\n p.point.x = 0.015 # Frame is actually in middle of fingers. Move it out to tips\n #p_earl = listener.transformPoint('/ear_antenna_left', p)\n p_earl = listener.transformPoint('/map', p)\n print('<x,y,z> = <%2.3f, %2.3f, %2.3f> ' % ( p_earl.point.x, p_earl.point.y, p_earl.point.z ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99365:Assign_L23_C4", "label": "p = PointStamped()", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99365:While_L22_C0", "vector": [14, 1, 0.7419, 0.0323, 1, 0.54, 0.0, 491, 3, 0, 0, 0, 969, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "PointStamped", "annotation": ""}, "snippet": " p = PointStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99365:Assign_L24_C4", "label": "p.header.stamp = Time()", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99365:While_L22_C0", "vector": [14, 1, 0.7742, 0.0323, 1, 0.54, 0.1667, 334, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "p.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " p.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99365:Assign_L25_C4", "label": "p.header.frame_id =", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99365:While_L22_C0", "vector": [14, 1, 0.8065, 0.0323, 1, 0.54, 0.3333, 17, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "p.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.header.frame_id = '/l_gripper_tool_frame'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99365:Assign_L26_C4", "label": "p.point.x =", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99365:While_L22_C0", "vector": [14, 1, 0.8387, 0.0323, 1, 0.54, 0.5, 10, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "p.point.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.point.x = 0.015 # Frame is actually in middle of fingers. Move it out to tips"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99365:Assign_L28_C4", "label": "p_earl = transformPoint()", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99365:While_L22_C0", "vector": [14, 1, 0.9032, 0.0323, 1, 0.54, 0.6667, 871, 3, 2, 0, 0, 987, 10, 1], "semantic": {"name": "p_earl", "arg_names": [], "import_names": [], "rhs_call_name": "transformPoint", "annotation": ""}, "snippet": " p_earl = listener.transformPoint('/map', p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99365:Expr_L29_C4", "label": "print()", "type": "expression", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99365:While_L22_C0", "vector": [8, 1, 0.9355, 0.0323, 1, 0.54, 0.8333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('<x,y,z> = <%2.3f, %2.3f, %2.3f> ' % ( p_earl.point.x, p_earl.point.y, p_earl.point.z ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99365:Expr_L31_C4", "label": "sleep()", "type": "expression", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99365:While_L22_C0", "vector": [8, 1, 1.0, 0.0323, 1, 0.54, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rate.sleep()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99365:While_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99365:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99365:While_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99365:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99365:While_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99365:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99365:While_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99365:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99365:While_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99365:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99365:While_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99365:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99365:While_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99365:Expr_L31_C4"}]
#!/usr/bin/python import roslib roslib.load_manifest( 'robotis' ) roslib.load_manifest( 'hrl_rfid' ) roslib.load_manifest( 'geometry_msgs' ) import rospy import robotis.ros_robotis as rr import hrl_rfid.ros_M5e_client as rmc from geometry_msgs.msg import PointStamped import time import math from threading import Thread import optparse class TagGroundTruth( Thread ): def __init__( self, tag_x, tag_y, tag_z, baseframe = '/map', date = '' ): Thread.__init__( self ) self.should_run = True self.tag_gt = PointStamped() self.tag_gt.header.stamp = rospy.Time(0) self.tag_gt.header.frame_id = baseframe self.tag_gt.point.x = tag_x self.tag_gt.point.y = tag_y self.tag_gt.point.z = tag_z rospy.logout('Publishing tag groundtruth at <%4.3f, %4.3f, %4.3f> in frame %s' % ( tag_x, tag_y, tag_z, baseframe )) self.pub = rospy.Publisher( 'tag_gt/' + date, PointStamped ) self.start() def run( self ): rate = rospy.Rate( 5 ) while self.should_run and not rospy.is_shutdown(): self.tag_gt.header.stamp = rospy.Time.now() self.pub.publish( self.tag_gt ) rate.sleep() def stop(self): self.should_run = False self.join(3) if (self.isAlive()): raise RuntimeError("Unable to stop thread") if __name__ == '__main__': p = optparse.OptionParser() p.add_option('-x', action='store', type='float', dest='x', default=None, help='tag groundtruth pose in x') p.add_option('-y', action='store', type='float', dest='y', default=None, help='tag groundtruth pose in y') p.add_option('-z', action='store', type='float', dest='z', default=None, help='tag groundtruth pose in z') p.add_option('-d', action='store', type='string', dest='date', default=None, help='date (yyyymmdd)') opt, args = p.parse_args() rospy.init_node( 'flapper' ) if opt.x == None or opt.y == None or opt.z == None or opt.date == None: print 'Requires <x,y,z> and date arguments!' exit() p_left = rr.ROS_Robotis_Client( 'left_pan' ) t_left = rr.ROS_Robotis_Client( 'left_tilt' ) p_right = rr.ROS_Robotis_Client( 'right_pan' ) t_right = rr.ROS_Robotis_Client( 'right_tilt' ) EX_1 = 1.350 EX_2 = 0.520 # 30 deg. # EX_2 = -1.000 tgt = TagGroundTruth( opt.x, opt.y, opt.z, '/map', opt.date ) p_left.move_angle( -1.0 * EX_1, math.radians(10), blocking = False ) t_left.move_angle( 0.0, math.radians(10), blocking = False ) p_right.move_angle( EX_1, math.radians(10), blocking = False ) t_right.move_angle( 0.0, math.radians(10), blocking = False ) forward = True while not rospy.is_shutdown(): if not p_left.is_moving() and not p_right.is_moving(): if forward: p_left.move_angle( -1.0 * EX_1, math.radians(30), blocking = False ) p_right.move_angle( EX_1, math.radians(30), blocking = False ) forward = False else: p_left.move_angle( EX_2, math.radians(30), blocking = False ) p_right.move_angle( -1.0 * EX_2, math.radians(30), blocking = False ) forward = True time.sleep(0.1) tgt.stop()
ajibawa-2023/Python-Code-Large/train/row_99366
69
98
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0306, 0.0102, 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_99366:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0408, 0.0102, 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( 'robotis' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.051, 0.0102, 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( 'hrl_rfid' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0612, 0.0102, 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( 'geometry_msgs' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Import_L7_C0", "label": "rospy import rospy", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0714, 0.0102, 0, 0.66, 0.3077, 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_99366:Import_L8_C0", "label": "robotis.ros_robotis import rr", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0816, 0.0102, 0, 0.66, 0.3846, 570, 0, 1, 0, 0, 570, 0, 0], "semantic": {"name": "robotis.ros_robotis", "arg_names": [], "import_names": ["rr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import robotis.ros_robotis as rr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Import_L9_C0", "label": "hrl_rfid.ros_M5e_client import rmc", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0918, 0.0102, 0, 0.66, 0.4615, 460, 0, 1, 0, 0, 460, 0, 0], "semantic": {"name": "hrl_rfid.ros_M5e_client", "arg_names": [], "import_names": ["rmc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_rfid.ros_M5e_client as rmc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:ImportFrom_L10_C0", "label": "from geometry_msgs.msg import PointStamped", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.102, 0.0102, 0, 0.66, 0.5385, 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_99366:Import_L12_C0", "label": "time import time", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1224, 0.0102, 0, 0.66, 0.6154, 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_99366:Import_L13_C0", "label": "math import math", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.1327, 0.0102, 0, 0.66, 0.6923, 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_99366:ImportFrom_L14_C0", "label": "from threading import Thread", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0102, 0, 0.66, 0.7692, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["Thread"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import Thread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Import_L15_C0", "label": "optparse import optparse", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1531, 0.0102, 0, 0.66, 0.8462, 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_99366:ClassDef_L17_C0", "label": "TagGroundTruth", "type": "class", "loc": [17, 44], "level": 0, "parent": null, "vector": [3, 0, 0.3112, 0.2857, 0, 0.66, 0.9231, 410, 0, 3, 0, 0, 134, 0, 14], "semantic": {"name": "TagGroundTruth", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TagGroundTruth( Thread ):\n def __init__( self, tag_x, tag_y, tag_z, baseframe = '/map', date = '' ):\n Thread.__init__( self )\n self.should_run = True\n\n self.tag_gt = PointStamped()\n self.tag_gt.header.stamp = rospy.Time(0)\n self.tag_gt.header.frame_id = baseframe"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L18_C4", "label": "__init__", "type": "function", "loc": [18, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:ClassDef_L17_C0", "vector": [2, 1, 0.25, 0.1429, 1, 0.51, 0.0, 555, 0, 6, 0, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self", "tag_x", "tag_y", "tag_z", "baseframe", "date"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, tag_x, tag_y, tag_z, baseframe = '/map', date = '' ):\n Thread.__init__( self )\n self.should_run = True\n\n self.tag_gt = PointStamped()\n self.tag_gt.header.stamp = rospy.Time(0)\n self.tag_gt.header.frame_id = baseframe\n self.tag_gt.point.x = tag_x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L19_C8", "label": "__init__()", "type": "expression", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L18_C4", "vector": [8, 2, 0.1939, 0.0102, 2, 0.51, 0.0, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Thread.__init__( self )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L20_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L18_C4", "vector": [14, 2, 0.2041, 0.0102, 2, 0.51, 0.1, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L22_C8", "label": "self.tag_gt = PointStamped()", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L18_C4", "vector": [14, 2, 0.2245, 0.0102, 2, 0.51, 0.2, 443, 3, 0, 0, 0, 969, 10, 1], "semantic": {"name": "self.tag_gt", "arg_names": [], "import_names": [], "rhs_call_name": "PointStamped", "annotation": ""}, "snippet": " self.tag_gt = PointStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L23_C8", "label": "self.tag_gt.header.stamp = Time()", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L18_C4", "vector": [14, 2, 0.2347, 0.0102, 2, 0.51, 0.3, 165, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "self.tag_gt.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " self.tag_gt.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L24_C8", "label": "self.tag_gt.header.frame_id =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L18_C4", "vector": [14, 2, 0.2449, 0.0102, 2, 0.51, 0.4, 139, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tag_gt.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tag_gt.header.frame_id = baseframe"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L25_C8", "label": "self.tag_gt.point.x =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L18_C4", "vector": [14, 2, 0.2551, 0.0102, 2, 0.51, 0.5, 757, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tag_gt.point.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tag_gt.point.x = tag_x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L26_C8", "label": "self.tag_gt.point.y =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L18_C4", "vector": [14, 2, 0.2653, 0.0102, 2, 0.51, 0.6, 362, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tag_gt.point.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tag_gt.point.y = tag_y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L27_C8", "label": "self.tag_gt.point.z =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L18_C4", "vector": [14, 2, 0.2755, 0.0102, 2, 0.51, 0.7, 359, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tag_gt.point.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tag_gt.point.z = tag_z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L29_C8", "label": "logout()", "type": "expression", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L18_C4", "vector": [8, 2, 0.2959, 0.0102, 2, 0.51, 0.8, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('Publishing tag groundtruth at <%4.3f, %4.3f, %4.3f> in frame %s' % ( tag_x, tag_y, tag_z, baseframe ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L30_C8", "label": "self.pub = Publisher()", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L18_C4", "vector": [14, 2, 0.3061, 0.0102, 2, 0.51, 0.9, 86, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.pub = rospy.Publisher( 'tag_gt/' + date, PointStamped )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L31_C8", "label": "start()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L18_C4", "vector": [8, 2, 0.3163, 0.0102, 2, 0.51, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L33_C4", "label": "run", "type": "function", "loc": [33, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:ClassDef_L17_C0", "vector": [2, 1, 0.3622, 0.0612, 1, 0.51, 0.5, 679, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run( self ):\n rate = rospy.Rate( 5 )\n while self.should_run and not rospy.is_shutdown():\n self.tag_gt.header.stamp = rospy.Time.now()\n self.pub.publish( self.tag_gt )\n rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L34_C8", "label": "rate = Rate()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L33_C4", "vector": [14, 2, 0.3469, 0.0102, 2, 0.09, 0.0, 477, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "rate", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " rate = rospy.Rate( 5 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:While_L35_C8", "label": "while", "type": "while", "loc": [35, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L33_C4", "vector": [5, 2, 0.3724, 0.0408, 2, 0.09, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.should_run and not rospy.is_shutdown():\n self.tag_gt.header.stamp = rospy.Time.now()\n self.pub.publish( self.tag_gt )\n rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L36_C12", "label": "self.tag_gt.header.stamp = now()", "type": "assigned_variable", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:While_L35_C8", "vector": [14, 3, 0.3673, 0.0102, 3, 0.86, 0.0, 165, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "self.tag_gt.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " self.tag_gt.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L37_C12", "label": "publish()", "type": "expression", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:While_L35_C8", "vector": [8, 3, 0.3776, 0.0102, 3, 0.86, 0.5, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.pub.publish( self.tag_gt )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L38_C12", "label": "sleep()", "type": "expression", "loc": [38, 38], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:While_L35_C8", "vector": [8, 3, 0.3878, 0.0102, 3, 0.86, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L40_C4", "label": "stop", "type": "function", "loc": [40, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:ClassDef_L17_C0", "vector": [2, 1, 0.4286, 0.051, 1, 0.51, 1.0, 343, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "stop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop(self):\n self.should_run = False\n self.join(3)\n if (self.isAlive()):\n raise RuntimeError(\"Unable to stop thread\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L41_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L40_C4", "vector": [14, 2, 0.4184, 0.0102, 2, 0.61, 0.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L42_C8", "label": "join()", "type": "expression", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L40_C4", "vector": [8, 2, 0.4286, 0.0102, 2, 0.61, 0.5, 933, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.join(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L43_C8", "label": "if", "type": "if", "loc": [43, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L40_C4", "vector": [4, 2, 0.4439, 0.0204, 2, 0.61, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.isAlive()):\n raise RuntimeError(\"Unable to stop thread\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "label": "if", "type": "if", "loc": [49, 98], "level": 0, "parent": null, "vector": [4, 0, 0.75, 0.5102, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 35], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n p = optparse.OptionParser()\n p.add_option('-x', action='store', type='float', dest='x', default=None,\n help='tag groundtruth pose in x')\n p.add_option('-y', action='store', type='float', dest='y', default=None,\n help='tag groundtruth pose in y')\n p.add_option('-z', action='store', type='float', dest='z', default=None,\n help='tag groundtruth pose in z')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L50_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "vector": [14, 1, 0.5102, 0.0102, 1, 0.92, 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_99366:Expr_L51_C4", "label": "add_option()", "type": "expression", "loc": [51, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "vector": [8, 1, 0.5255, 0.0204, 1, 0.92, 0.0476, 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('-x', action='store', type='float', dest='x', default=None,\n help='tag groundtruth pose in x')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L53_C4", "label": "add_option()", "type": "expression", "loc": [53, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "vector": [8, 1, 0.5459, 0.0204, 1, 0.92, 0.0952, 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('-y', action='store', type='float', dest='y', default=None,\n help='tag groundtruth pose in y')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L55_C4", "label": "add_option()", "type": "expression", "loc": [55, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "vector": [8, 1, 0.5663, 0.0204, 1, 0.92, 0.1429, 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('-z', action='store', type='float', dest='z', default=None,\n help='tag groundtruth pose in z')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L57_C4", "label": "add_option()", "type": "expression", "loc": [57, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "vector": [8, 1, 0.5867, 0.0204, 1, 0.92, 0.1905, 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', type='string', dest='date', default=None,\n help='date (yyyymmdd)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L59_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "vector": [14, 1, 0.602, 0.0102, 1, 0.92, 0.2381, 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_99366:Expr_L61_C4", "label": "init_node()", "type": "expression", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "vector": [8, 1, 0.6224, 0.0102, 1, 0.92, 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( 'flapper' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L63_C4", "label": "if", "type": "if", "loc": [63, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "vector": [4, 1, 0.6531, 0.0306, 1, 0.92, 0.3333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.x == None or opt.y == None or opt.z == None or opt.date == None:\n print('Requires <x,y,z> and date arguments!')\n exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L64_C8", "label": "print()", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L63_C4", "vector": [8, 2, 0.6531, 0.0102, 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('Requires <x,y,z> and date arguments!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L65_C8", "label": "exit()", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L63_C4", "vector": [8, 2, 0.6633, 0.0102, 2, 0.18, 1.0, 436, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L67_C4", "label": "p_left = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "vector": [14, 1, 0.6837, 0.0102, 1, 0.92, 0.381, 339, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "p_left", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " p_left = rr.ROS_Robotis_Client( 'left_pan' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L68_C4", "label": "t_left = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "vector": [14, 1, 0.6939, 0.0102, 1, 0.92, 0.4286, 276, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "t_left", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " t_left = rr.ROS_Robotis_Client( 'left_tilt' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L70_C4", "label": "p_right = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "vector": [14, 1, 0.7143, 0.0102, 1, 0.92, 0.4762, 866, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "p_right", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " p_right = rr.ROS_Robotis_Client( 'right_pan' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L71_C4", "label": "t_right = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "vector": [14, 1, 0.7245, 0.0102, 1, 0.92, 0.5238, 942, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "t_right", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " t_right = rr.ROS_Robotis_Client( 'right_tilt' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L73_C4", "label": "EX_1 =", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "vector": [14, 1, 0.7449, 0.0102, 1, 0.92, 0.5714, 527, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "EX_1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " EX_1 = 1.350"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L74_C4", "label": "EX_2 =", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "vector": [14, 1, 0.7551, 0.0102, 1, 0.92, 0.619, 347, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "EX_2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " EX_2 = 0.520 # 30 deg."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L77_C4", "label": "tgt = TagGroundTruth()", "type": "assigned_variable", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "vector": [14, 1, 0.7857, 0.0102, 1, 0.92, 0.6667, 280, 3, 5, 0, 0, 410, 10, 1], "semantic": {"name": "tgt", "arg_names": [], "import_names": [], "rhs_call_name": "TagGroundTruth", "annotation": ""}, "snippet": " tgt = TagGroundTruth( opt.x, opt.y, opt.z, '/map', opt.date )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L79_C4", "label": "move_angle()", "type": "expression", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "vector": [8, 1, 0.8061, 0.0102, 1, 0.92, 0.7143, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " p_left.move_angle( -1.0 * EX_1, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L80_C4", "label": "move_angle()", "type": "expression", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "vector": [8, 1, 0.8163, 0.0102, 1, 0.92, 0.7619, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " t_left.move_angle( 0.0, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L82_C4", "label": "move_angle()", "type": "expression", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "vector": [8, 1, 0.8367, 0.0102, 1, 0.92, 0.8095, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " p_right.move_angle( EX_1, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L83_C4", "label": "move_angle()", "type": "expression", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "vector": [8, 1, 0.8469, 0.0102, 1, 0.92, 0.8571, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " t_right.move_angle( 0.0, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L85_C4", "label": "forward =", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "vector": [14, 1, 0.8673, 0.0102, 1, 0.92, 0.9048, 194, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "forward", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " forward = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:While_L87_C4", "label": "while", "type": "while", "loc": [87, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "vector": [5, 1, 0.9388, 0.1122, 1, 0.92, 0.9524, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n if not p_left.is_moving() and not p_right.is_moving():\n if forward:\n p_left.move_angle( -1.0 * EX_1, math.radians(30), blocking = False )\n p_right.move_angle( EX_1, math.radians(30), blocking = False )\n forward = False\n else:\n p_left.move_angle( EX_2, math.radians(30), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L88_C8", "label": "if", "type": "if", "loc": [88, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:While_L87_C4", "vector": [4, 2, 0.9388, 0.0918, 2, 0.48, 0.0, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not p_left.is_moving() and not p_right.is_moving():\n if forward:\n p_left.move_angle( -1.0 * EX_1, math.radians(30), blocking = False )\n p_right.move_angle( EX_1, math.radians(30), blocking = False )\n forward = False\n else:\n p_left.move_angle( EX_2, math.radians(30), blocking = False )\n p_right.move_angle( -1.0 * EX_2, math.radians(30), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L89_C12", "label": "if", "type": "if", "loc": [89, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L88_C8", "vector": [4, 3, 0.9439, 0.0816, 3, 0.48, 0.0, 0, 2, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if forward:\n p_left.move_angle( -1.0 * EX_1, math.radians(30), blocking = False )\n p_right.move_angle( EX_1, math.radians(30), blocking = False )\n forward = False\n else:\n p_left.move_angle( EX_2, math.radians(30), blocking = False )\n p_right.move_angle( -1.0 * EX_2, math.radians(30), blocking = False )\n forward = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L90_C16", "label": "move_angle()", "type": "expression", "loc": [90, 90], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L89_C12", "vector": [8, 4, 0.9184, 0.0102, 4, 0.36, 0.0, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " p_left.move_angle( -1.0 * EX_1, math.radians(30), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L91_C16", "label": "move_angle()", "type": "expression", "loc": [91, 91], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L89_C12", "vector": [8, 4, 0.9286, 0.0102, 4, 0.36, 0.2, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " p_right.move_angle( EX_1, math.radians(30), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L92_C16", "label": "forward =", "type": "assigned_variable", "loc": [92, 92], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L89_C12", "vector": [14, 4, 0.9388, 0.0102, 4, 0.36, 0.4, 194, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "forward", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " forward = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L94_C16", "label": "move_angle()", "type": "expression", "loc": [94, 94], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L89_C12", "vector": [8, 4, 0.9592, 0.0102, 4, 0.36, 0.6, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " p_left.move_angle( EX_2, math.radians(30), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L95_C16", "label": "move_angle()", "type": "expression", "loc": [95, 95], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L89_C12", "vector": [8, 4, 0.9694, 0.0102, 4, 0.36, 0.8, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " p_right.move_angle( -1.0 * EX_2, math.radians(30), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L96_C16", "label": "forward =", "type": "assigned_variable", "loc": [96, 96], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L89_C12", "vector": [14, 4, 0.9796, 0.0102, 4, 0.36, 1.0, 194, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "forward", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " forward = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L97_C8", "label": "sleep()", "type": "expression", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:While_L87_C4", "vector": [8, 2, 0.9898, 0.0102, 2, 0.48, 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(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L98_C4", "label": "stop()", "type": "expression", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "vector": [8, 1, 1.0, 0.0102, 1, 0.92, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " tgt.stop()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99366:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:While_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:While_L35_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:While_L35_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:While_L35_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L38_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:While_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:While_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L88_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L89_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L90_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L89_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L91_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L89_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L92_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L89_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L94_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L89_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L95_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L89_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Assign_L96_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:While_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99366:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99366:Expr_L98_C4"}]
import time import roslib roslib.load_manifest('rospy') roslib.load_manifest('actionlib') roslib.load_manifest( 'move_base_msgs' ) roslib.load_manifest('tf') roslib.load_manifest('std_srvs') roslib.load_manifest('geometry_msgs') roslib.load_manifest('std_msgs') roslib.load_manifest('hrl_rfid') roslib.load_manifest('robotis') roslib.load_manifest('rfid_people_following') import rospy import tf import tf.transformations as tft import actionlib from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal from geometry_msgs.msg import Twist from geometry_msgs.msg import PointStamped from geometry_msgs.msg import Point from geometry_msgs.msg import PoseStamped from geometry_msgs.msg import Quaternion from geometry_msgs.msg import PoseWithCovarianceStamped from std_msgs.msg import Float64 from std_srvs.srv import Empty rospy.init_node( 'trial' ) import sim_capture bp = sim_capture.BasePose() # listener = tf.TransformListener() # listener.waitForTransform('/base_link', '/odom_combined', # rospy.Time(0), timeout = rospy.Duration(100) ) # ps = PointStamped() # ps.header.frame_id = '/base_link' # while True: # ps.header.stamp = rospy.Time(0) # ps_map = listener.transformPoint( '/odom_combined', ps ) # print ps_map.point.x, ps_map.point.y # rospy.sleep( 0.2 ) # # try: # # ps_map = self.listener.transformPoint( '/odom_combined', ps ) # # self.pts.append([ ps_map.point.x, ps.map.point.y ]) # # except: # # rospy.logout( 'sim_capture: Failed transform.' ) # # pass
ajibawa-2023/Python-Code-Large/train/row_99367
28
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_99367:Import_L2_C0", "label": "time import time", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0377, 0.0189, 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_99367:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0566, 0.0189, 0, 0.66, 0.037, 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_99367:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0755, 0.0189, 0, 0.66, 0.0741, 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_99367:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0943, 0.0189, 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": "roslib.load_manifest('actionlib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99367:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.1132, 0.0189, 0, 0.66, 0.1481, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'move_base_msgs' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99367:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.1321, 0.0189, 0, 0.66, 0.1852, 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_99367:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.1509, 0.0189, 0, 0.66, 0.2222, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('std_srvs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99367:Expr_L9_C0", "label": "load_manifest()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.1698, 0.0189, 0, 0.66, 0.2593, 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_99367:Expr_L10_C0", "label": "load_manifest()", "type": "expression", "loc": [10, 10], "level": 0, "parent": null, "vector": [8, 0, 0.1887, 0.0189, 0, 0.66, 0.2963, 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_99367:Expr_L11_C0", "label": "load_manifest()", "type": "expression", "loc": [11, 11], "level": 0, "parent": null, "vector": [8, 0, 0.2075, 0.0189, 0, 0.66, 0.3333, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('hrl_rfid')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99367:Expr_L12_C0", "label": "load_manifest()", "type": "expression", "loc": [12, 12], "level": 0, "parent": null, "vector": [8, 0, 0.2264, 0.0189, 0, 0.66, 0.3704, 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('robotis')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99367:Expr_L13_C0", "label": "load_manifest()", "type": "expression", "loc": [13, 13], "level": 0, "parent": null, "vector": [8, 0, 0.2453, 0.0189, 0, 0.66, 0.4074, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('rfid_people_following')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99367:Import_L14_C0", "label": "rospy import rospy", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.2642, 0.0189, 0, 0.66, 0.4444, 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_99367:Import_L16_C0", "label": "tf import tf", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.3019, 0.0189, 0, 0.66, 0.4815, 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_99367:Import_L17_C0", "label": "tf.transformations import tft", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.3208, 0.0189, 0, 0.66, 0.5185, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tft"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tft"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99367:Import_L18_C0", "label": "actionlib import actionlib", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.3396, 0.0189, 0, 0.66, 0.5556, 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_99367:ImportFrom_L19_C0", "label": "from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.3585, 0.0189, 0, 0.66, 0.5926, 440, 0, 2, 0, 0, 440, 0, 0], "semantic": {"name": "move_base_msgs.msg", "arg_names": [], "import_names": ["MoveBaseAction", "MoveBaseGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99367:ImportFrom_L20_C0", "label": "from geometry_msgs.msg import Twist", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.3774, 0.0189, 0, 0.66, 0.6296, 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_99367:ImportFrom_L21_C0", "label": "from geometry_msgs.msg import PointStamped", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.3962, 0.0189, 0, 0.66, 0.6667, 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_99367:ImportFrom_L22_C0", "label": "from geometry_msgs.msg import Point", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.4151, 0.0189, 0, 0.66, 0.7037, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Point"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99367:ImportFrom_L23_C0", "label": "from geometry_msgs.msg import PoseStamped", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.434, 0.0189, 0, 0.66, 0.7407, 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_99367:ImportFrom_L24_C0", "label": "from geometry_msgs.msg import Quaternion", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.4528, 0.0189, 0, 0.66, 0.7778, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Quaternion"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Quaternion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99367:ImportFrom_L25_C0", "label": "from geometry_msgs.msg import PoseWithCovarianceStamped", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.4717, 0.0189, 0, 0.66, 0.8148, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["PoseWithCovarianceStamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import PoseWithCovarianceStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99367:ImportFrom_L26_C0", "label": "from std_msgs.msg import Float64", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.4906, 0.0189, 0, 0.66, 0.8519, 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_99367:ImportFrom_L27_C0", "label": "from std_srvs.srv import Empty", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.5094, 0.0189, 0, 0.66, 0.8889, 261, 0, 1, 0, 0, 261, 0, 0], "semantic": {"name": "std_srvs.srv", "arg_names": [], "import_names": ["Empty"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_srvs.srv import Empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99367:Expr_L29_C0", "label": "init_node()", "type": "expression", "loc": [29, 29], "level": 0, "parent": null, "vector": [8, 0, 0.5472, 0.0189, 0, 0.66, 0.9259, 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( 'trial' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99367:Import_L31_C0", "label": "sim_capture import sim_capture", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.5849, 0.0189, 0, 0.66, 0.963, 365, 0, 1, 0, 0, 365, 0, 0], "semantic": {"name": "sim_capture", "arg_names": [], "import_names": ["sim_capture"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sim_capture"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99367:Assign_L33_C0", "label": "bp = BasePose()", "type": "assigned_variable", "loc": [33, 33], "level": 0, "parent": null, "vector": [14, 0, 0.6226, 0.0189, 0, 0.66, 1.0, 226, 3, 0, 0, 0, 540, 10, 1], "semantic": {"name": "bp", "arg_names": [], "import_names": [], "rhs_call_name": "BasePose", "annotation": ""}, "snippet": "bp = sim_capture.BasePose()"}]
[]
#!/usr/bin/python import roslib roslib.load_manifest('rfid_people_following') import rospy import rfid_people_following.db_rfid as db_rfid from rfid_people_following.srv import rfid_gui as gui_srv import time import string import pygame import pygame.display import pygame.locals import pygame.transform import numpy as np, math class ROS_UI_Robot(): def __init__(self, init=True): if init: try: print 'Initializing RFID UI on Robot' rospy.init_node('RFID_UI_Robot',anonymous=True) except rospy.ROSException: pass self.tag_pub = rospy.Publisher('/hrl/ele/UI_Robot',RFID_Interface) print 'RFID UI on Robot Running' print 'Connecting to RFID UI on PC' self.selected_tag = '' self.selection = [] rospy.Subscriber('/hrl/ele/UI_PC_Selection', RFID_Interface, self.selection_cb, None, 1) # def publish_tag_ids(self, tagIDs): # ''' tagIDs is a list of strings ''' # for tag in tagIDs: # rt = String() # rt.data = tag # self.tag_pub.publish( rt ) # time.sleep(0.2) # rt.data = '-1' # self.tag_pub.publish( rt ) # time.sleep(0.002) def publish_tag_ids(self, tagIDs): pub_msg = RFID_Interface() pub_msg.tagIDs = tagIDs pub_msg.humanread = [] pub_msg.actions = [] self.tag_pub.publish( pub_msg ) time.sleep(0.002) # def selection_cb(self, pc_msg): # self.selected_tag = pc_msg.data # print 'Received tag selection from UI: ', self.selected_tag # return self.selected_tag def selection_cb(self, rfid_msg): tagID = rfid_msg.tagIDs[0] action = rfid_msg.actions[0] humanread = rfid_msg.humanread[0] self.selection = [tagID, humanread, action] #print 'Received selection from UI: ', self.selection def receive_response(self): while self.selection == []: time.sleep(0.02) rv = self.selection self.selection = [] return rv # def receive_response(self): # rt = String() # rt = self.listener.read() # return rt.data class RFID_GUI(): def __init__(self, graphical=False, db = None): try: rospy.init_node('rfid_gui',anonymous=True) except rospy.ROSException: pass rospy.logout( 'rfid_gui: Initializing' ) self.graphical = graphical self.images_path = 'db_images/' self.db = db self._srv = rospy.Service( '/rfid_gui/select', gui_srv, self.gui_response ) rospy.logout( 'rfid_gui: Waiting for service calls.' ) def gui_response(self, request): keys = request.keys keys = [ k for k in keys if self.db.has_key( k ) ] humanread = [ self.db[ k ]['humanread'] for k in keys ] imgs = [ self.db[ k ]['img'] for k in keys ] if len( keys ) == 0: rospy.logout( 'rfid_gui: No items to select from. Fail.' ) return False, '' # elif len( keys ) == 1: # rospy.logout( 'rfid_gui: Only one to select from. Autoreturn: %s' % keys[0] ) # return True, keys[0] # Get the selection (returned as RFID_Interface message) if self.graphical: success, selection = self.get_selection_graphical( keys, humanread, imgs ) else: success, selection = self.get_selection_text( keys, humanread, imgs ) return int(success), selection def get_selection_text( self, keys, humanread, imgs ): # keys has at least one items. ind = -1 while ind.__class__ != (1).__class__ or ind < 0 or ind > len( keys ) - 1: print 'Make a selection:' for i, hr in enumerate( humanread ): print '\t(%d) %s' % (i, hr) resp = raw_input() try: ind = string.atoi( resp ) except: ind = '' pass rospy.logout( 'rfid_gui: Returning selection: %s' % humanread[ ind ] ) return True, keys[ ind ] def smart_scale(self, image): ims = np.array(image.get_size(),dtype='float') scale = self.imheight / np.max(ims) return pygame.transform.scale(image, tuple(ims*scale)) def calc_blit_loc(self, image, center_pos): ims = np.array(image.get_size(), dtype='float') horiz = center_pos[0] - self.imheight/2 + (self.imheight - ims[0]) / 2. vert = center_pos[1] - self.imheight/2 + (self.imheight - ims[1]) / 2. return (horiz, vert) def get_selection_graphical( self, keys, humanread, imgs ): # keys has at least one items. pygame.init() self.s_width = 600 self.s_height = 700 srf = pygame.display.set_mode((self.s_width,self.s_height)) fps = 100 loopFlag = True clk = pygame.time.Clock() obj = [srf, fps, clk] self.imheight = 175. w = self.s_width * 1.0 h = self.s_height * 1.0 blit_pos = [[ w/3-w/6, h/3-h/6], [ w/3-w/6+w/3, h/3-h/6], [ w/3-w/6+2*w/3, h/3-h/6], [ w/3-w/6, h/3-h/6+h/3], [ w/3-w/6+w/3, h/3-h/6+h/3], [ w/3-w/6+2*w/3, h/3-h/6+h/3], [ w/3-w/6, h/3-h/6+2*h/3], [ w/3-w/6+w/3, h/3-h/6+2*h/3], [ w/3-w/6+2*w/3, h/3-h/6+2*h/3]] images = [] surfaces = [] blit_loc = [] for i, k in enumerate(keys): rospy.logout( 'rfid_gui: Loading image: %s' % self.images_path + imgs[i] ) k_image = pygame.image.load(self.images_path + imgs[i]).convert() k_image = self.smart_scale(k_image) images.append( k_image ) blit_loc.append( blit_pos[i] ) #pygame.display.set_mode(tag_images[i].get_size()) #tag_surfaces.append(pygame.display.get_surface()) srf.blit(k_image, self.calc_blit_loc(k_image,blit_loc[i])) ind = self.get_selection( obj, images, humanread, blit_loc ) rospy.logout( 'rfid_gui: Returning selection: %s' % humanread[ ind ] ) return True, keys[ ind ] def put_bottom_text( self, srf, text ): font = pygame.font.Font(None, 25) box = font.render(text, 1,(10, 10, 10, 0)) ts = box.get_size() horiz = self.s_width / 2.0 - ts[0]/2.0 vt = self.s_height - 50.0 - ts[1]/2.0 srf.blit(box, (horiz, vt)) return True def draw_rect(self, srf, blit_loc): width = self.imheight * 1.10 height = self.imheight *1.10 horiz = blit_loc[0] - width / 2.0 vert = blit_loc[1] - height / 2.0 pygame.draw.rect(srf, (255, 0, 0), (horiz, vert, width, height)) width = self.imheight * 1.01 height = self.imheight *1.01 horiz = blit_loc[0] - width / 2.0 vert = blit_loc[1] - height / 2.0 pygame.draw.rect(srf, (255, 255, 255), (horiz, vert, width, height)) return True def get_selection( self, obj, images, humanread, blit_loc ): [srf, fps, clk] = obj loopFlag = True ind = 0 pos = (0,0) while loopFlag: # Clear the screen srf.fill((255,255,255)) diffs = np.array(blit_loc) - np.array(pos) ind = np.argmin( np.sum( np.power( diffs, 2.0 ), axis = 1 ) ) self.put_bottom_text( srf, humanread[ind] ) self.draw_rect(srf, blit_loc[ind]) for i, image in enumerate(images): srf.blit(image, self.calc_blit_loc(image,blit_loc[i])) #print 'going' pygame.display.flip() events = pygame.event.get() for e in events: if e.type==pygame.locals.QUIT: loopFlag=False if e.type==pygame.locals.KEYDOWN: if e.key == 27: # Esc loopFlag=False if e.type == pygame.locals.MOUSEMOTION: pos = e.pos if e.type==pygame.locals.MOUSEBUTTONDOWN: if e.button == 1: # left button pos = e.pos diffs = np.array(blit_loc) - np.array(pos) ind = np.argmin( np.sum( np.power( diffs, 2.0 ), axis = 1 ) ) loopFlag = False clk.tick(fps) srf.fill((255,255,255)) pygame.display.flip() clk.tick(fps) return ind # pc = ROS_UI_PC(init = False, graphical = True) # pc.get_selection_graphical(['LightSwitch1','LightSwitch1'], # ['lightswitch','LightSwitch1'], # [['on','off'],['on','off']]) if __name__ == '__main__': import optparse p = optparse.OptionParser() p.add_option('-d', action='store_true', dest='graphical', help='Use a graphical display.', default=False) opt, args = p.parse_args() gui = RFID_GUI( graphical = opt.graphical, db = db_rfid.db ) rospy.spin() # while True: # print 'Waiting for robot action(s)...\n' # pc.publish_selected_id() # pc.ids = [] # pc.ids_done = False # On the Robot's side: # ro = ROS_UI_Robot() # ro.publish_tag_ids(['one','two','hello']) # ro.receive_response()
ajibawa-2023/Python-Code-Large/train/row_99368
172
280
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0107, 0.0036, 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_99368:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0143, 0.0036, 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": "roslib.load_manifest('rfid_people_following')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0179, 0.0036, 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_99368:Import_L7_C0", "label": "rfid_people_following.db_rfid import db_rfid", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.025, 0.0036, 0, 0.66, 0.2143, 128, 0, 1, 0, 0, 128, 0, 0], "semantic": {"name": "rfid_people_following.db_rfid", "arg_names": [], "import_names": ["db_rfid"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rfid_people_following.db_rfid as db_rfid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:ImportFrom_L8_C0", "label": "from rfid_people_following.srv import gui_srv", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0286, 0.0036, 0, 0.66, 0.2857, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["gui_srv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import rfid_gui as gui_srv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Import_L10_C0", "label": "time import time", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0357, 0.0036, 0, 0.66, 0.3571, 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_99368:Import_L11_C0", "label": "string import string", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0393, 0.0036, 0, 0.66, 0.4286, 890, 0, 1, 0, 0, 890, 0, 0], "semantic": {"name": "string", "arg_names": [], "import_names": ["string"], "rhs_call_name": "", "annotation": ""}, "snippet": "import string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Import_L12_C0", "label": "pygame import pygame", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0429, 0.0036, 0, 0.66, 0.5, 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_99368:Import_L13_C0", "label": "pygame.display import pygame.display", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0464, 0.0036, 0, 0.66, 0.5714, 724, 0, 1, 0, 0, 724, 0, 0], "semantic": {"name": "pygame.display", "arg_names": [], "import_names": ["pygame.display"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pygame.display"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Import_L14_C0", "label": "pygame.locals import pygame.locals", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.05, 0.0036, 0, 0.66, 0.6429, 515, 0, 1, 0, 0, 515, 0, 0], "semantic": {"name": "pygame.locals", "arg_names": [], "import_names": ["pygame.locals"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pygame.locals"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Import_L15_C0", "label": "pygame.transform import pygame.transform", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0536, 0.0036, 0, 0.66, 0.7143, 35, 0, 1, 0, 0, 35, 0, 0], "semantic": {"name": "pygame.transform", "arg_names": [], "import_names": ["pygame.transform"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pygame.transform"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Import_L16_C0", "label": "numpy import np, math", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0571, 0.0036, 0, 0.66, 0.7857, 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_99368:ClassDef_L19_C0", "label": "ROS_UI_Robot", "type": "class", "loc": [19, 70], "level": 0, "parent": null, "vector": [3, 0, 0.1589, 0.1857, 0, 0.66, 0.8571, 953, 0, 4, 0, 0, 0, 0, 10], "semantic": {"name": "ROS_UI_Robot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ROS_UI_Robot():\n def __init__(self, init=True):\n if init:\n try:\n print('Initializing RFID UI on Robot')\n rospy.init_node('RFID_UI_Robot',anonymous=True)\n except rospy.ROSException:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L20_C4", "label": "__init__", "type": "function", "loc": [20, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L19_C0", "vector": [2, 1, 0.0946, 0.05, 1, 0.83, 0.0, 555, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self", "init"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, init=True):\n if init:\n try:\n print('Initializing RFID UI on Robot')\n rospy.init_node('RFID_UI_Robot',anonymous=True)\n except rospy.ROSException:\n pass\n self.tag_pub = rospy.Publisher('/hrl/ele/UI_Robot',RFID_Interface)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L21_C8", "label": "if", "type": "if", "loc": [21, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L20_C4", "vector": [4, 2, 0.0839, 0.0214, 2, 0.18, 0.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if init:\n try:\n print('Initializing RFID UI on Robot')\n rospy.init_node('RFID_UI_Robot',anonymous=True)\n except rospy.ROSException:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Try_L22_C12", "label": "try", "type": "try", "loc": [22, 26], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L21_C8", "vector": [7, 3, 0.0857, 0.0179, 3, 0.52, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n print('Initializing RFID UI on Robot')\n rospy.init_node('RFID_UI_Robot',anonymous=True)\n except rospy.ROSException:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L23_C16", "label": "print()", "type": "expression", "loc": [23, 23], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:Try_L22_C12", "vector": [8, 4, 0.0821, 0.0036, 4, 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('Initializing RFID UI on Robot')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L24_C16", "label": "init_node()", "type": "expression", "loc": [24, 24], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:Try_L22_C12", "vector": [8, 4, 0.0857, 0.0036, 4, 0.85, 1.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('RFID_UI_Robot',anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L27_C8", "label": "self.tag_pub = Publisher()", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L20_C4", "vector": [14, 2, 0.0964, 0.0036, 2, 0.18, 0.1667, 716, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.tag_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.tag_pub = rospy.Publisher('/hrl/ele/UI_Robot',RFID_Interface)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L28_C8", "label": "print()", "type": "expression", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L20_C4", "vector": [8, 2, 0.1, 0.0036, 2, 0.18, 0.3333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('RFID UI on Robot Running')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L30_C8", "label": "print()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L20_C4", "vector": [8, 2, 0.1071, 0.0036, 2, 0.18, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Connecting to RFID UI on PC')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L31_C8", "label": "self.selected_tag =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L20_C4", "vector": [14, 2, 0.1107, 0.0036, 2, 0.18, 0.6667, 877, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.selected_tag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.selected_tag = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L32_C8", "label": "self.selection =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L20_C4", "vector": [14, 2, 0.1143, 0.0036, 2, 0.18, 0.8333, 779, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.selection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.selection = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L33_C8", "label": "Subscriber()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L20_C4", "vector": [8, 2, 0.1179, 0.0036, 2, 0.18, 1.0, 455, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/hrl/ele/UI_PC_Selection', RFID_Interface, self.selection_cb, None, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L45_C4", "label": "publish_tag_ids", "type": "function", "loc": [45, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L19_C0", "vector": [2, 1, 0.1732, 0.0286, 1, 0.83, 0.3333, 891, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "publish_tag_ids", "arg_names": ["self", "tagIDs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def publish_tag_ids(self, tagIDs):\n pub_msg = RFID_Interface()\n pub_msg.tagIDs = tagIDs\n pub_msg.humanread = []\n pub_msg.actions = []\n\n self.tag_pub.publish( pub_msg )\n time.sleep(0.002)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L46_C8", "label": "pub_msg = RFID_Interface()", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L45_C4", "vector": [14, 2, 0.1643, 0.0036, 2, 0.42, 0.0, 787, 3, 0, 0, 0, 197, 10, 1], "semantic": {"name": "pub_msg", "arg_names": [], "import_names": [], "rhs_call_name": "RFID_Interface", "annotation": ""}, "snippet": " pub_msg = RFID_Interface()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L47_C8", "label": "pub_msg.tagIDs =", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L45_C4", "vector": [14, 2, 0.1679, 0.0036, 2, 0.42, 0.2, 387, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pub_msg.tagIDs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pub_msg.tagIDs = tagIDs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L48_C8", "label": "pub_msg.humanread =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L45_C4", "vector": [14, 2, 0.1714, 0.0036, 2, 0.42, 0.4, 878, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pub_msg.humanread", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pub_msg.humanread = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L49_C8", "label": "pub_msg.actions =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L45_C4", "vector": [14, 2, 0.175, 0.0036, 2, 0.42, 0.6, 739, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pub_msg.actions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pub_msg.actions = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L51_C8", "label": "publish()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L45_C4", "vector": [8, 2, 0.1821, 0.0036, 2, 0.42, 0.8, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.tag_pub.publish( pub_msg )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L52_C8", "label": "sleep()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L45_C4", "vector": [8, 2, 0.1857, 0.0036, 2, 0.42, 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(0.002)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L58_C4", "label": "selection_cb", "type": "function", "loc": [58, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L19_C0", "vector": [2, 1, 0.2143, 0.0179, 1, 0.83, 0.6667, 748, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "selection_cb", "arg_names": ["self", "rfid_msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def selection_cb(self, rfid_msg):\n tagID = rfid_msg.tagIDs[0]\n action = rfid_msg.actions[0]\n humanread = rfid_msg.humanread[0]\n self.selection = [tagID, humanread, action]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L59_C8", "label": "tagID =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L58_C4", "vector": [14, 2, 0.2107, 0.0036, 2, 0.7, 0.0, 904, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tagID", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tagID = rfid_msg.tagIDs[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L60_C8", "label": "action =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L58_C4", "vector": [14, 2, 0.2143, 0.0036, 2, 0.7, 0.3333, 422, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " action = rfid_msg.actions[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L61_C8", "label": "humanread =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L58_C4", "vector": [14, 2, 0.2179, 0.0036, 2, 0.7, 0.6667, 351, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "humanread", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " humanread = rfid_msg.humanread[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L62_C8", "label": "self.selection =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L58_C4", "vector": [14, 2, 0.2214, 0.0036, 2, 0.7, 1.0, 779, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.selection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.selection = [tagID, humanread, action]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L65_C4", "label": "receive_response", "type": "function", "loc": [65, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L19_C0", "vector": [2, 1, 0.2411, 0.0214, 1, 0.83, 1.0, 13, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "receive_response", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def receive_response(self):\n while self.selection == []:\n time.sleep(0.02)\n rv = self.selection\n self.selection = []\n return rv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L66_C8", "label": "while", "type": "while", "loc": [66, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L65_C4", "vector": [5, 2, 0.2375, 0.0071, 2, 0.25, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.selection == []:\n time.sleep(0.02)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L67_C12", "label": "sleep()", "type": "expression", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L66_C8", "vector": [8, 3, 0.2393, 0.0036, 3, 0.03, 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.02)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L68_C8", "label": "rv =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L65_C4", "vector": [14, 2, 0.2429, 0.0036, 2, 0.25, 0.3333, 222, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rv = self.selection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L69_C8", "label": "self.selection =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L65_C4", "vector": [14, 2, 0.2464, 0.0036, 2, 0.25, 0.6667, 779, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.selection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.selection = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Return_L70_C8", "label": "return", "type": "return", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L65_C4", "vector": [13, 2, 0.25, 0.0036, 2, 0.25, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L77_C0", "label": "RFID_GUI", "type": "class", "loc": [77, 249], "level": 0, "parent": null, "vector": [3, 0, 0.5821, 0.6179, 0, 0.66, 0.9286, 898, 0, 9, 0, 0, 0, 0, 66], "semantic": {"name": "RFID_GUI", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RFID_GUI():\n def __init__(self, graphical=False, db = None):\n try:\n rospy.init_node('rfid_gui',anonymous=True)\n except rospy.ROSException:\n pass\n\n rospy.logout( 'rfid_gui: Initializing' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L78_C4", "label": "__init__", "type": "function", "loc": [78, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L77_C0", "vector": [2, 1, 0.3036, 0.0536, 1, 0.83, 0.0, 555, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "graphical", "db"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, graphical=False, db = None):\n try:\n rospy.init_node('rfid_gui',anonymous=True)\n except rospy.ROSException:\n pass\n\n rospy.logout( 'rfid_gui: Initializing' )\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Try_L79_C8", "label": "try", "type": "try", "loc": [79, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L78_C4", "vector": [7, 2, 0.2875, 0.0143, 2, 0.36, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node('rfid_gui',anonymous=True)\n except rospy.ROSException:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L80_C12", "label": "init_node()", "type": "expression", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:Try_L79_C8", "vector": [8, 3, 0.2857, 0.0036, 3, 0.29, 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('rfid_gui',anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L84_C8", "label": "logout()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L78_C4", "vector": [8, 2, 0.3, 0.0036, 2, 0.36, 0.1667, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'rfid_gui: Initializing' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L86_C8", "label": "self.graphical =", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L78_C4", "vector": [14, 2, 0.3071, 0.0036, 2, 0.36, 0.3333, 482, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.graphical", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.graphical = graphical"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L87_C8", "label": "self.images_path =", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L78_C4", "vector": [14, 2, 0.3107, 0.0036, 2, 0.36, 0.5, 96, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.images_path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.images_path = 'db_images/'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L88_C8", "label": "self.db =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L78_C4", "vector": [14, 2, 0.3143, 0.0036, 2, 0.36, 0.6667, 990, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.db", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.db = db"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L90_C8", "label": "self._srv = Service()", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L78_C4", "vector": [14, 2, 0.3214, 0.0036, 2, 0.36, 0.8333, 225, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self._srv", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self._srv = rospy.Service( '/rfid_gui/select', gui_srv, self.gui_response )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L92_C8", "label": "logout()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L78_C4", "vector": [8, 2, 0.3286, 0.0036, 2, 0.36, 1.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'rfid_gui: Waiting for service calls.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L94_C4", "label": "gui_response", "type": "function", "loc": [94, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L77_C0", "vector": [2, 1, 0.3714, 0.075, 1, 0.83, 0.125, 667, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "gui_response", "arg_names": ["self", "request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def gui_response(self, request):\n keys = request.keys\n\n keys = [ k for k in keys if self.db.has_key( k ) ]\n humanread = [ self.db[ k ]['humanread'] for k in keys ]\n imgs = [ self.db[ k ]['img'] for k in keys ]\n\n if len( keys ) == 0:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L95_C8", "label": "keys =", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L94_C4", "vector": [14, 2, 0.3393, 0.0036, 2, 0.78, 0.0, 204, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "keys", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " keys = request.keys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L97_C8", "label": "keys =", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L94_C4", "vector": [14, 2, 0.3464, 0.0036, 2, 0.78, 0.1667, 204, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "keys", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " keys = [ k for k in keys if self.db.has_key( k ) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L98_C8", "label": "humanread =", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L94_C4", "vector": [14, 2, 0.35, 0.0036, 2, 0.78, 0.3333, 351, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "humanread", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " humanread = [ self.db[ k ]['humanread'] for k in keys ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L99_C8", "label": "imgs =", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L94_C4", "vector": [14, 2, 0.3536, 0.0036, 2, 0.78, 0.5, 344, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "imgs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " imgs = [ self.db[ k ]['img'] for k in keys ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L101_C8", "label": "if", "type": "if", "loc": [101, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L94_C4", "vector": [4, 2, 0.3643, 0.0107, 2, 0.78, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len( keys ) == 0:\n rospy.logout( 'rfid_gui: No items to select from. Fail.' )\n return False, ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L102_C12", "label": "logout()", "type": "expression", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L101_C8", "vector": [8, 3, 0.3643, 0.0036, 3, 0.99, 0.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'rfid_gui: No items to select from. Fail.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Return_L103_C12", "label": "return", "type": "return", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L101_C8", "vector": [13, 3, 0.3679, 0.0036, 3, 0.99, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False, ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L109_C8", "label": "if", "type": "if", "loc": [109, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L94_C4", "vector": [4, 2, 0.3946, 0.0143, 2, 0.78, 0.8333, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.graphical:\n success, selection = self.get_selection_graphical( keys, humanread, imgs )\n else:\n success, selection = self.get_selection_text( keys, humanread, imgs )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L110_C12", "label": "success, selection = get_selection_graphical()", "type": "assigned_variable", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L109_C8", "vector": [14, 3, 0.3929, 0.0036, 3, 0.69, 0.0, 796, 3, 3, 0, 0, 653, 10, 1], "semantic": {"name": "success, selection", "arg_names": [], "import_names": [], "rhs_call_name": "get_selection_graphical", "annotation": ""}, "snippet": " success, selection = self.get_selection_graphical( keys, humanread, imgs )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L112_C12", "label": "success, selection = get_selection_text()", "type": "assigned_variable", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L109_C8", "vector": [14, 3, 0.4, 0.0036, 3, 0.69, 1.0, 796, 3, 3, 0, 0, 935, 10, 1], "semantic": {"name": "success, selection", "arg_names": [], "import_names": [], "rhs_call_name": "get_selection_text", "annotation": ""}, "snippet": " success, selection = self.get_selection_text( keys, humanread, imgs )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Return_L114_C8", "label": "return", "type": "return", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L94_C4", "vector": [13, 2, 0.4071, 0.0036, 2, 0.78, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return int(success), selection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L117_C4", "label": "get_selection_text", "type": "function", "loc": [117, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L77_C0", "vector": [2, 1, 0.4429, 0.0536, 1, 0.83, 0.25, 935, 0, 4, 1, 0, 0, 0, 7], "semantic": {"name": "get_selection_text", "arg_names": ["self", "keys", "humanread", "imgs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_selection_text( self, keys, humanread, imgs ):\n # keys has at least one items.\n ind = -1\n while ind.__class__ != (1).__class__ or ind < 0 or ind > len( keys ) - 1:\n print('Make a selection:')\n for i, hr in enumerate( humanread ):\n print('\\t(%d) %s' % (i, hr))\n resp = raw_input()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L119_C8", "label": "ind =", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L117_C4", "vector": [14, 2, 0.425, 0.0036, 2, 0.73, 0.0, 680, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ind", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ind = -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L120_C8", "label": "while", "type": "while", "loc": [120, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L117_C4", "vector": [5, 2, 0.4446, 0.0357, 2, 0.73, 0.3333, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while ind.__class__ != (1).__class__ or ind < 0 or ind > len( keys ) - 1:\n print('Make a selection:')\n for i, hr in enumerate( humanread ):\n print('\\t(%d) %s' % (i, hr))\n resp = raw_input()\n try:\n ind = string.atoi( resp )\n except:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L121_C12", "label": "print()", "type": "expression", "loc": [121, 121], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L120_C8", "vector": [8, 3, 0.4321, 0.0036, 3, 0.75, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Make a selection:')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L122_C12", "label": "for i, hr", "type": "for", "loc": [122, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L120_C8", "vector": [6, 3, 0.4375, 0.0071, 3, 0.75, 0.3333, 885, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i, hr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, hr in enumerate( humanread ):\n print('\\t(%d) %s' % (i, hr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L123_C16", "label": "print()", "type": "expression", "loc": [123, 123], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L122_C12", "vector": [8, 4, 0.4393, 0.0036, 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('\\t(%d) %s' % (i, hr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L124_C12", "label": "resp = raw_input()", "type": "assigned_variable", "loc": [124, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L120_C8", "vector": [14, 3, 0.4429, 0.0036, 3, 0.75, 0.6667, 48, 3, 0, 0, 0, 821, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " resp = raw_input()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Try_L125_C12", "label": "try", "type": "try", "loc": [125, 129], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L120_C8", "vector": [7, 3, 0.4536, 0.0179, 3, 0.75, 1.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n ind = string.atoi( resp )\n except:\n ind = ''\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L126_C16", "label": "ind = atoi()", "type": "assigned_variable", "loc": [126, 126], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:Try_L125_C12", "vector": [14, 4, 0.45, 0.0036, 4, 0.34, 0.0, 680, 3, 1, 0, 0, 360, 10, 1], "semantic": {"name": "ind", "arg_names": [], "import_names": [], "rhs_call_name": "atoi", "annotation": ""}, "snippet": " ind = string.atoi( resp )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L128_C16", "label": "ind =", "type": "assigned_variable", "loc": [128, 128], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:Try_L125_C12", "vector": [14, 4, 0.4571, 0.0036, 4, 0.34, 0.0, 680, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ind", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ind = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L130_C8", "label": "logout()", "type": "expression", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L117_C4", "vector": [8, 2, 0.4643, 0.0036, 2, 0.73, 0.6667, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'rfid_gui: Returning selection: %s' % humanread[ ind ] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Return_L131_C8", "label": "return", "type": "return", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L117_C4", "vector": [13, 2, 0.4679, 0.0036, 2, 0.73, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True, keys[ ind ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L133_C4", "label": "smart_scale", "type": "function", "loc": [133, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L77_C0", "vector": [2, 1, 0.4804, 0.0143, 1, 0.83, 0.375, 642, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "smart_scale", "arg_names": ["self", "image"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def smart_scale(self, image):\n ims = np.array(image.get_size(),dtype='float')\n scale = self.imheight / np.max(ims)\n return pygame.transform.scale(image, tuple(ims*scale))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L134_C8", "label": "ims = array()", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L133_C4", "vector": [14, 2, 0.4786, 0.0036, 2, 0.86, 0.0, 526, 3, 2, 0, 0, 80, 10, 2], "semantic": {"name": "ims", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " ims = np.array(image.get_size(),dtype='float')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L135_C8", "label": "scale =", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L133_C4", "vector": [14, 2, 0.4821, 0.0036, 2, 0.86, 0.5, 18, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "scale", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scale = self.imheight / np.max(ims)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Return_L136_C8", "label": "return", "type": "return", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L133_C4", "vector": [13, 2, 0.4857, 0.0036, 2, 0.86, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pygame.transform.scale(image, tuple(ims*scale))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L138_C4", "label": "calc_blit_loc", "type": "function", "loc": [138, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L77_C0", "vector": [2, 1, 0.5, 0.0179, 1, 0.83, 0.5, 445, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "calc_blit_loc", "arg_names": ["self", "image", "center_pos"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def calc_blit_loc(self, image, center_pos):\n ims = np.array(image.get_size(), dtype='float')\n horiz = center_pos[0] - self.imheight/2 + (self.imheight - ims[0]) / 2.\n vert = center_pos[1] - self.imheight/2 + (self.imheight - ims[1]) / 2.\n return (horiz, vert)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L139_C8", "label": "ims = array()", "type": "assigned_variable", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L138_C4", "vector": [14, 2, 0.4964, 0.0036, 2, 0.87, 0.0, 526, 3, 2, 0, 0, 80, 10, 2], "semantic": {"name": "ims", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " ims = np.array(image.get_size(), dtype='float')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L140_C8", "label": "horiz =", "type": "assigned_variable", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L138_C4", "vector": [14, 2, 0.5, 0.0036, 2, 0.87, 0.3333, 492, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "horiz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " horiz = center_pos[0] - self.imheight/2 + (self.imheight - ims[0]) / 2."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L141_C8", "label": "vert =", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L138_C4", "vector": [14, 2, 0.5036, 0.0036, 2, 0.87, 0.6667, 128, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vert", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vert = center_pos[1] - self.imheight/2 + (self.imheight - ims[1]) / 2."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Return_L142_C8", "label": "return", "type": "return", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L138_C4", "vector": [13, 2, 0.5071, 0.0036, 2, 0.87, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (horiz, vert)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "label": "get_selection_graphical", "type": "function", "loc": [144, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L77_C0", "vector": [2, 1, 0.5839, 0.1429, 1, 0.83, 0.625, 653, 0, 4, 1, 0, 0, 0, 14], "semantic": {"name": "get_selection_graphical", "arg_names": ["self", "keys", "humanread", "imgs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_selection_graphical( self, keys, humanread, imgs ):\n # keys has at least one items.\n pygame.init()\n self.s_width = 600\n self.s_height = 700\n srf = pygame.display.set_mode((self.s_width,self.s_height))\n fps = 100\n loopFlag = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L146_C8", "label": "init()", "type": "expression", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "vector": [8, 2, 0.5214, 0.0036, 2, 0.43, 0.0, 319, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init", "arg_names": [], "import_names": [], "rhs_call_name": "init", "annotation": ""}, "snippet": " pygame.init()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L147_C8", "label": "self.s_width =", "type": "assigned_variable", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "vector": [14, 2, 0.525, 0.0036, 2, 0.43, 0.0556, 540, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.s_width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.s_width = 600"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L148_C8", "label": "self.s_height =", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "vector": [14, 2, 0.5286, 0.0036, 2, 0.43, 0.1111, 50, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.s_height", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.s_height = 700"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L149_C8", "label": "srf = set_mode()", "type": "assigned_variable", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "vector": [14, 2, 0.5321, 0.0036, 2, 0.43, 0.1667, 820, 3, 1, 0, 0, 255, 10, 1], "semantic": {"name": "srf", "arg_names": [], "import_names": [], "rhs_call_name": "set_mode", "annotation": ""}, "snippet": " srf = pygame.display.set_mode((self.s_width,self.s_height))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L150_C8", "label": "fps =", "type": "assigned_variable", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "vector": [14, 2, 0.5357, 0.0036, 2, 0.43, 0.2222, 376, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "fps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fps = 100"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L151_C8", "label": "loopFlag =", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "vector": [14, 2, 0.5393, 0.0036, 2, 0.43, 0.2778, 143, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "loopFlag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " loopFlag = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L152_C8", "label": "clk = Clock()", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "vector": [14, 2, 0.5429, 0.0036, 2, 0.43, 0.3333, 134, 3, 0, 0, 0, 725, 10, 1], "semantic": {"name": "clk", "arg_names": [], "import_names": [], "rhs_call_name": "Clock", "annotation": ""}, "snippet": " clk = pygame.time.Clock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L153_C8", "label": "obj =", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "vector": [14, 2, 0.5464, 0.0036, 2, 0.43, 0.3889, 505, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " obj = [srf, fps, clk]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L154_C8", "label": "self.imheight =", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "vector": [14, 2, 0.55, 0.0036, 2, 0.43, 0.4444, 794, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.imheight", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.imheight = 175."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L156_C8", "label": "w =", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "vector": [14, 2, 0.5571, 0.0036, 2, 0.43, 0.5, 549, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " w = self.s_width * 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L157_C8", "label": "h =", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "vector": [14, 2, 0.5607, 0.0036, 2, 0.43, 0.5556, 686, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h = self.s_height * 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L158_C8", "label": "blit_pos =", "type": "assigned_variable", "loc": [158, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "vector": [14, 2, 0.5786, 0.0321, 2, 0.43, 0.6111, 600, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "blit_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " blit_pos = [[ w/3-w/6, h/3-h/6],\n [ w/3-w/6+w/3, h/3-h/6],\n [ w/3-w/6+2*w/3, h/3-h/6],\n [ w/3-w/6, h/3-h/6+h/3],\n [ w/3-w/6+w/3, h/3-h/6+h/3],\n [ w/3-w/6+2*w/3, h/3-h/6+h/3],\n [ w/3-w/6, h/3-h/6+2*h/3],\n [ w/3-w/6+w/3, h/3-h/6+2*h/3],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L167_C8", "label": "images =", "type": "assigned_variable", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "vector": [14, 2, 0.5964, 0.0036, 2, 0.43, 0.6667, 734, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "images", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " images = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L168_C8", "label": "surfaces =", "type": "assigned_variable", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "vector": [14, 2, 0.6, 0.0036, 2, 0.43, 0.7222, 467, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "surfaces", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " surfaces = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L169_C8", "label": "blit_loc =", "type": "assigned_variable", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "vector": [14, 2, 0.6036, 0.0036, 2, 0.43, 0.7778, 210, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "blit_loc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " blit_loc = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L170_C8", "label": "for i, k", "type": "for", "loc": [170, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "vector": [6, 2, 0.6214, 0.0321, 2, 0.43, 0.8333, 992, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "i, k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, k in enumerate(keys):\n rospy.logout( 'rfid_gui: Loading image: %s' % self.images_path + imgs[i] )\n k_image = pygame.image.load(self.images_path + imgs[i]).convert()\n k_image = self.smart_scale(k_image)\n images.append( k_image )\n blit_loc.append( blit_pos[i] )\n #pygame.display.set_mode(tag_images[i].get_size())\n #tag_surfaces.append(pygame.display.get_surface())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L171_C12", "label": "logout()", "type": "expression", "loc": [171, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L170_C8", "vector": [8, 3, 0.6107, 0.0036, 3, 0.58, 0.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'rfid_gui: Loading image: %s' % self.images_path + imgs[i] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L172_C12", "label": "k_image = convert()", "type": "assigned_variable", "loc": [172, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L170_C8", "vector": [14, 3, 0.6143, 0.0036, 3, 0.58, 0.2, 981, 3, 0, 0, 0, 438, 10, 2], "semantic": {"name": "k_image", "arg_names": [], "import_names": [], "rhs_call_name": "convert", "annotation": ""}, "snippet": " k_image = pygame.image.load(self.images_path + imgs[i]).convert()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L173_C12", "label": "k_image = smart_scale()", "type": "assigned_variable", "loc": [173, 173], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L170_C8", "vector": [14, 3, 0.6179, 0.0036, 3, 0.58, 0.4, 981, 3, 1, 0, 0, 642, 10, 1], "semantic": {"name": "k_image", "arg_names": [], "import_names": [], "rhs_call_name": "smart_scale", "annotation": ""}, "snippet": " k_image = self.smart_scale(k_image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L174_C12", "label": "append()", "type": "expression", "loc": [174, 174], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L170_C8", "vector": [8, 3, 0.6214, 0.0036, 3, 0.58, 0.6, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " images.append( k_image )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L175_C12", "label": "append()", "type": "expression", "loc": [175, 175], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L170_C8", "vector": [8, 3, 0.625, 0.0036, 3, 0.58, 0.8, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " blit_loc.append( blit_pos[i] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L178_C12", "label": "blit()", "type": "expression", "loc": [178, 178], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L170_C8", "vector": [8, 3, 0.6357, 0.0036, 3, 0.58, 1.0, 951, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "blit", "arg_names": [], "import_names": [], "rhs_call_name": "blit", "annotation": ""}, "snippet": " srf.blit(k_image, self.calc_blit_loc(k_image,blit_loc[i]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L180_C8", "label": "ind = get_selection()", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "vector": [14, 2, 0.6429, 0.0036, 2, 0.43, 0.8889, 680, 3, 4, 0, 0, 365, 10, 1], "semantic": {"name": "ind", "arg_names": [], "import_names": [], "rhs_call_name": "get_selection", "annotation": ""}, "snippet": " ind = self.get_selection( obj, images, humanread, blit_loc )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L182_C8", "label": "logout()", "type": "expression", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "vector": [8, 2, 0.65, 0.0036, 2, 0.43, 0.9444, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'rfid_gui: Returning selection: %s' % humanread[ ind ] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Return_L183_C8", "label": "return", "type": "return", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "vector": [13, 2, 0.6536, 0.0036, 2, 0.43, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True, keys[ ind ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L185_C4", "label": "put_bottom_text", "type": "function", "loc": [185, 192], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L77_C0", "vector": [2, 1, 0.6732, 0.0286, 1, 0.83, 0.75, 876, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "put_bottom_text", "arg_names": ["self", "srf", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def put_bottom_text( self, srf, text ):\n font = pygame.font.Font(None, 25)\n box = font.render(text, 1,(10, 10, 10, 0))\n ts = box.get_size()\n horiz = self.s_width / 2.0 - ts[0]/2.0\n vt = self.s_height - 50.0 - ts[1]/2.0\n srf.blit(box, (horiz, vt))\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L186_C8", "label": "font = Font()", "type": "assigned_variable", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L185_C4", "vector": [14, 2, 0.6643, 0.0036, 2, 0.62, 0.0, 768, 3, 2, 0, 0, 69, 10, 1], "semantic": {"name": "font", "arg_names": [], "import_names": [], "rhs_call_name": "Font", "annotation": ""}, "snippet": " font = pygame.font.Font(None, 25)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L187_C8", "label": "box = render()", "type": "assigned_variable", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L185_C4", "vector": [14, 2, 0.6679, 0.0036, 2, 0.62, 0.1667, 918, 3, 3, 0, 0, 24, 10, 1], "semantic": {"name": "box", "arg_names": [], "import_names": [], "rhs_call_name": "render", "annotation": ""}, "snippet": " box = font.render(text, 1,(10, 10, 10, 0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L188_C8", "label": "ts = get_size()", "type": "assigned_variable", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L185_C4", "vector": [14, 2, 0.6714, 0.0036, 2, 0.62, 0.3333, 278, 3, 0, 0, 0, 932, 10, 1], "semantic": {"name": "ts", "arg_names": [], "import_names": [], "rhs_call_name": "get_size", "annotation": ""}, "snippet": " ts = box.get_size()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L189_C8", "label": "horiz =", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L185_C4", "vector": [14, 2, 0.675, 0.0036, 2, 0.62, 0.5, 492, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "horiz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " horiz = self.s_width / 2.0 - ts[0]/2.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L190_C8", "label": "vt =", "type": "assigned_variable", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L185_C4", "vector": [14, 2, 0.6786, 0.0036, 2, 0.62, 0.6667, 360, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vt = self.s_height - 50.0 - ts[1]/2.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L191_C8", "label": "blit()", "type": "expression", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L185_C4", "vector": [8, 2, 0.6821, 0.0036, 2, 0.62, 0.8333, 951, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "blit", "arg_names": [], "import_names": [], "rhs_call_name": "blit", "annotation": ""}, "snippet": " srf.blit(box, (horiz, vt))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Return_L192_C8", "label": "return", "type": "return", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L185_C4", "vector": [13, 2, 0.6857, 0.0036, 2, 0.62, 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_99368:FunctionDef_L194_C4", "label": "draw_rect", "type": "function", "loc": [194, 205], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L77_C0", "vector": [2, 1, 0.7125, 0.0429, 1, 0.83, 0.875, 177, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "draw_rect", "arg_names": ["self", "srf", "blit_loc"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def draw_rect(self, srf, blit_loc):\n width = self.imheight * 1.10\n height = self.imheight *1.10\n horiz = blit_loc[0] - width / 2.0\n vert = blit_loc[1] - height / 2.0\n pygame.draw.rect(srf, (255, 0, 0), (horiz, vert, width, height))\n width = self.imheight * 1.01\n height = self.imheight *1.01"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L195_C8", "label": "width =", "type": "assigned_variable", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L194_C4", "vector": [14, 2, 0.6964, 0.0036, 2, 0.39, 0.0, 989, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " width = self.imheight * 1.10"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L196_C8", "label": "height =", "type": "assigned_variable", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L194_C4", "vector": [14, 2, 0.7, 0.0036, 2, 0.39, 0.1, 751, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "height", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " height = self.imheight *1.10"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L197_C8", "label": "horiz =", "type": "assigned_variable", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L194_C4", "vector": [14, 2, 0.7036, 0.0036, 2, 0.39, 0.2, 492, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "horiz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " horiz = blit_loc[0] - width / 2.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L198_C8", "label": "vert =", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L194_C4", "vector": [14, 2, 0.7071, 0.0036, 2, 0.39, 0.3, 128, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vert", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vert = blit_loc[1] - height / 2.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L199_C8", "label": "rect()", "type": "expression", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L194_C4", "vector": [8, 2, 0.7107, 0.0036, 2, 0.39, 0.4, 902, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "rect", "arg_names": [], "import_names": [], "rhs_call_name": "rect", "annotation": ""}, "snippet": " pygame.draw.rect(srf, (255, 0, 0), (horiz, vert, width, height))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L200_C8", "label": "width =", "type": "assigned_variable", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L194_C4", "vector": [14, 2, 0.7143, 0.0036, 2, 0.39, 0.5, 989, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " width = self.imheight * 1.01"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L201_C8", "label": "height =", "type": "assigned_variable", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L194_C4", "vector": [14, 2, 0.7179, 0.0036, 2, 0.39, 0.6, 751, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "height", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " height = self.imheight *1.01"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L202_C8", "label": "horiz =", "type": "assigned_variable", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L194_C4", "vector": [14, 2, 0.7214, 0.0036, 2, 0.39, 0.7, 492, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "horiz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " horiz = blit_loc[0] - width / 2.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L203_C8", "label": "vert =", "type": "assigned_variable", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L194_C4", "vector": [14, 2, 0.725, 0.0036, 2, 0.39, 0.8, 128, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vert", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vert = blit_loc[1] - height / 2.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L204_C8", "label": "rect()", "type": "expression", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L194_C4", "vector": [8, 2, 0.7286, 0.0036, 2, 0.39, 0.9, 902, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "rect", "arg_names": [], "import_names": [], "rhs_call_name": "rect", "annotation": ""}, "snippet": " pygame.draw.rect(srf, (255, 255, 255), (horiz, vert, width, height))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Return_L205_C8", "label": "return", "type": "return", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L194_C4", "vector": [13, 2, 0.7321, 0.0036, 2, 0.39, 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_99368:FunctionDef_L207_C4", "label": "get_selection", "type": "function", "loc": [207, 249], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L77_C0", "vector": [2, 1, 0.8143, 0.1536, 1, 0.83, 1.0, 365, 0, 5, 1, 0, 0, 0, 22], "semantic": {"name": "get_selection", "arg_names": ["self", "obj", "images", "humanread", "blit_loc"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_selection( self, obj, images, humanread, blit_loc ):\n [srf, fps, clk] = obj\n loopFlag = True\n ind = 0\n pos = (0,0)\n while loopFlag:\n # Clear the screen\n srf.fill((255,255,255))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L208_C8", "label": "assign", "type": "assigned_variable", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L207_C4", "vector": [14, 2, 0.7429, 0.0036, 2, 0.08, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " [srf, fps, clk] = obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L209_C8", "label": "loopFlag =", "type": "assigned_variable", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L207_C4", "vector": [14, 2, 0.7464, 0.0036, 2, 0.08, 0.125, 143, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "loopFlag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " loopFlag = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L210_C8", "label": "ind =", "type": "assigned_variable", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L207_C4", "vector": [14, 2, 0.75, 0.0036, 2, 0.08, 0.25, 680, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "ind", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ind = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L211_C8", "label": "pos =", "type": "assigned_variable", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L207_C4", "vector": [14, 2, 0.7536, 0.0036, 2, 0.08, 0.375, 627, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = (0,0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L212_C8", "label": "while", "type": "while", "loc": [212, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L207_C4", "vector": [5, 2, 0.8161, 0.1214, 2, 0.08, 0.5, 0, 2, 0, 0, 0, 0, 0, 19], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while loopFlag:\n # Clear the screen\n srf.fill((255,255,255))\n\n diffs = np.array(blit_loc) - np.array(pos)\n ind = np.argmin( np.sum( np.power( diffs, 2.0 ), axis = 1 ) )\n\n self.put_bottom_text( srf, humanread[ind] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L214_C12", "label": "fill()", "type": "expression", "loc": [214, 214], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L212_C8", "vector": [8, 3, 0.7643, 0.0036, 3, 0.35, 0.0, 346, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "fill", "arg_names": [], "import_names": [], "rhs_call_name": "fill", "annotation": ""}, "snippet": " srf.fill((255,255,255))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L216_C12", "label": "diffs =", "type": "assigned_variable", "loc": [216, 216], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L212_C8", "vector": [14, 3, 0.7714, 0.0036, 3, 0.35, 0.1111, 809, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "diffs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " diffs = np.array(blit_loc) - np.array(pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L217_C12", "label": "ind = argmin()", "type": "assigned_variable", "loc": [217, 217], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L212_C8", "vector": [14, 3, 0.775, 0.0036, 3, 0.35, 0.2222, 680, 3, 1, 0, 0, 879, 10, 3], "semantic": {"name": "ind", "arg_names": [], "import_names": [], "rhs_call_name": "argmin", "annotation": ""}, "snippet": " ind = np.argmin( np.sum( np.power( diffs, 2.0 ), axis = 1 ) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L219_C12", "label": "put_bottom_text()", "type": "expression", "loc": [219, 219], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L212_C8", "vector": [8, 3, 0.7821, 0.0036, 3, 0.35, 0.3333, 876, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "put_bottom_text", "arg_names": [], "import_names": [], "rhs_call_name": "put_bottom_text", "annotation": ""}, "snippet": " self.put_bottom_text( srf, humanread[ind] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L220_C12", "label": "draw_rect()", "type": "expression", "loc": [220, 220], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L212_C8", "vector": [8, 3, 0.7857, 0.0036, 3, 0.35, 0.4444, 177, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "draw_rect", "arg_names": [], "import_names": [], "rhs_call_name": "draw_rect", "annotation": ""}, "snippet": " self.draw_rect(srf, blit_loc[ind])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L222_C12", "label": "for i, image", "type": "for", "loc": [222, 223], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L212_C8", "vector": [6, 3, 0.7946, 0.0071, 3, 0.35, 0.5556, 693, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i, image", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, image in enumerate(images):\n srf.blit(image, self.calc_blit_loc(image,blit_loc[i]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L223_C16", "label": "blit()", "type": "expression", "loc": [223, 223], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L222_C12", "vector": [8, 4, 0.7964, 0.0036, 4, 0.9, 0.0, 951, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "blit", "arg_names": [], "import_names": [], "rhs_call_name": "blit", "annotation": ""}, "snippet": " srf.blit(image, self.calc_blit_loc(image,blit_loc[i]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L226_C12", "label": "flip()", "type": "expression", "loc": [226, 226], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L212_C8", "vector": [8, 3, 0.8071, 0.0036, 3, 0.35, 0.6667, 677, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "flip", "arg_names": [], "import_names": [], "rhs_call_name": "flip", "annotation": ""}, "snippet": " pygame.display.flip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L228_C12", "label": "events = get()", "type": "assigned_variable", "loc": [228, 228], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L212_C8", "vector": [14, 3, 0.8143, 0.0036, 3, 0.35, 0.7778, 830, 3, 0, 0, 0, 607, 10, 1], "semantic": {"name": "events", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " events = pygame.event.get()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L229_C12", "label": "for e", "type": "for", "loc": [229, 243], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L212_C8", "vector": [6, 3, 0.8429, 0.0536, 3, 0.35, 0.8889, 175, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "e", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for e in events:\n if e.type==pygame.locals.QUIT:\n loopFlag=False\n if e.type==pygame.locals.KEYDOWN:\n if e.key == 27: # Esc\n loopFlag=False\n if e.type == pygame.locals.MOUSEMOTION:\n pos = e.pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L230_C16", "label": "if", "type": "if", "loc": [230, 231], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L229_C12", "vector": [4, 4, 0.8232, 0.0071, 4, 0.73, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if e.type==pygame.locals.QUIT:\n loopFlag=False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L231_C20", "label": "loopFlag =", "type": "assigned_variable", "loc": [231, 231], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L230_C16", "vector": [14, 5, 0.825, 0.0036, 5, 0.6, 0.0, 143, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "loopFlag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " loopFlag=False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L232_C16", "label": "if", "type": "if", "loc": [232, 234], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L229_C12", "vector": [4, 4, 0.8321, 0.0107, 4, 0.73, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if e.type==pygame.locals.KEYDOWN:\n if e.key == 27: # Esc\n loopFlag=False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L233_C20", "label": "if", "type": "if", "loc": [233, 234], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L232_C16", "vector": [4, 5, 0.8339, 0.0071, 5, 0.86, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if e.key == 27: # Esc\n loopFlag=False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L234_C24", "label": "loopFlag =", "type": "assigned_variable", "loc": [234, 234], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L233_C20", "vector": [14, 6, 0.8357, 0.0036, 6, 0.65, 0.0, 143, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "loopFlag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " loopFlag=False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L235_C16", "label": "if", "type": "if", "loc": [235, 236], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L229_C12", "vector": [4, 4, 0.8411, 0.0071, 4, 0.73, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if e.type == pygame.locals.MOUSEMOTION:\n pos = e.pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L236_C20", "label": "pos =", "type": "assigned_variable", "loc": [236, 236], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L235_C16", "vector": [14, 5, 0.8429, 0.0036, 5, 0.42, 0.0, 627, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = e.pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L237_C16", "label": "if", "type": "if", "loc": [237, 243], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L229_C12", "vector": [4, 4, 0.8571, 0.025, 4, 0.73, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if e.type==pygame.locals.MOUSEBUTTONDOWN:\n if e.button == 1:\n # left button\n pos = e.pos\n diffs = np.array(blit_loc) - np.array(pos)\n ind = np.argmin( np.sum( np.power( diffs, 2.0 ), axis = 1 ) )\n loopFlag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L238_C20", "label": "if", "type": "if", "loc": [238, 243], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L237_C16", "vector": [4, 5, 0.8589, 0.0214, 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 e.button == 1:\n # left button\n pos = e.pos\n diffs = np.array(blit_loc) - np.array(pos)\n ind = np.argmin( np.sum( np.power( diffs, 2.0 ), axis = 1 ) )\n loopFlag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L240_C24", "label": "pos =", "type": "assigned_variable", "loc": [240, 240], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L238_C20", "vector": [14, 6, 0.8571, 0.0036, 6, 0.01, 0.0, 627, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = e.pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L241_C24", "label": "diffs =", "type": "assigned_variable", "loc": [241, 241], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L238_C20", "vector": [14, 6, 0.8607, 0.0036, 6, 0.01, 0.3333, 809, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "diffs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " diffs = np.array(blit_loc) - np.array(pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L242_C24", "label": "ind = argmin()", "type": "assigned_variable", "loc": [242, 242], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L238_C20", "vector": [14, 6, 0.8643, 0.0036, 6, 0.01, 0.6667, 680, 3, 1, 0, 0, 879, 10, 3], "semantic": {"name": "ind", "arg_names": [], "import_names": [], "rhs_call_name": "argmin", "annotation": ""}, "snippet": " ind = np.argmin( np.sum( np.power( diffs, 2.0 ), axis = 1 ) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L243_C24", "label": "loopFlag =", "type": "assigned_variable", "loc": [243, 243], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L238_C20", "vector": [14, 6, 0.8679, 0.0036, 6, 0.01, 1.0, 143, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "loopFlag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " loopFlag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L245_C12", "label": "tick()", "type": "expression", "loc": [245, 245], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L212_C8", "vector": [8, 3, 0.875, 0.0036, 3, 0.35, 1.0, 133, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "tick", "arg_names": [], "import_names": [], "rhs_call_name": "tick", "annotation": ""}, "snippet": " clk.tick(fps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L246_C8", "label": "fill()", "type": "expression", "loc": [246, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L207_C4", "vector": [8, 2, 0.8786, 0.0036, 2, 0.08, 0.625, 346, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "fill", "arg_names": [], "import_names": [], "rhs_call_name": "fill", "annotation": ""}, "snippet": " srf.fill((255,255,255))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L247_C8", "label": "flip()", "type": "expression", "loc": [247, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L207_C4", "vector": [8, 2, 0.8821, 0.0036, 2, 0.08, 0.75, 677, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "flip", "arg_names": [], "import_names": [], "rhs_call_name": "flip", "annotation": ""}, "snippet": " pygame.display.flip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L248_C8", "label": "tick()", "type": "expression", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L207_C4", "vector": [8, 2, 0.8857, 0.0036, 2, 0.08, 0.875, 133, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "tick", "arg_names": [], "import_names": [], "rhs_call_name": "tick", "annotation": ""}, "snippet": " clk.tick(fps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Return_L249_C8", "label": "return", "type": "return", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L207_C4", "vector": [13, 2, 0.8893, 0.0036, 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 ind"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L258_C0", "label": "if", "type": "if", "loc": [258, 267], "level": 0, "parent": null, "vector": [4, 0, 0.9375, 0.0357, 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 optparse\n\n p = optparse.OptionParser()\n p.add_option('-d', action='store_true', dest='graphical',\n help='Use a graphical display.', default=False)\n opt, args = p.parse_args()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Import_L259_C4", "label": "optparse import optparse", "type": "import", "loc": [259, 259], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L258_C0", "vector": [1, 1, 0.925, 0.0036, 1, 0.03, 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_99368:Assign_L261_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [261, 261], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L258_C0", "vector": [14, 1, 0.9321, 0.0036, 1, 0.03, 0.2, 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_99368:Expr_L262_C4", "label": "add_option()", "type": "expression", "loc": [262, 263], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L258_C0", "vector": [8, 1, 0.9375, 0.0071, 1, 0.03, 0.4, 176, 3, 5, 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_true', dest='graphical',\n help='Use a graphical display.', default=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L264_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [264, 264], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L258_C0", "vector": [14, 1, 0.9429, 0.0036, 1, 0.03, 0.6, 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_99368:Assign_L266_C4", "label": "gui = RFID_GUI()", "type": "assigned_variable", "loc": [266, 266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L258_C0", "vector": [14, 1, 0.95, 0.0036, 1, 0.03, 0.8, 22, 3, 2, 0, 0, 898, 10, 1], "semantic": {"name": "gui", "arg_names": [], "import_names": [], "rhs_call_name": "RFID_GUI", "annotation": ""}, "snippet": " gui = RFID_GUI( graphical = opt.graphical, db = db_rfid.db )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L267_C4", "label": "spin()", "type": "expression", "loc": [267, 267], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L258_C0", "vector": [8, 1, 0.9536, 0.0036, 1, 0.03, 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_99368:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L21_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Try_L22_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:Try_L22_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L23_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:Try_L22_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L24_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Return_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Try_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:Try_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L101_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L101_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Return_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Return_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L117_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L117_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L120_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L121_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L120_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L122_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L123_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L120_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L124_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L120_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Try_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:Try_L125_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L126_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:Try_L125_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L128_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L117_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L117_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Return_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Return_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Return_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L170_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L171_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L170_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L170_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L173_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L170_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L174_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L170_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L175_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L170_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L178_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Return_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Return_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Return_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L207_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L207_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L207_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L207_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L207_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L207_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L212_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L214_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L212_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L216_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L212_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L217_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L212_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L219_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L212_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L220_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L212_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L222_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L222_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L223_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L212_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L226_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L212_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L228_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L212_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L229_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L229_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L230_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L230_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L231_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L229_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L232_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L232_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L233_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L233_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L234_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L229_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L235_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L235_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L236_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:For_L229_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L237_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L237_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L238_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L238_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L240_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L238_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L241_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L238_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L242_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L238_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L243_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:While_L212_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L245_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L207_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L207_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L247_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L207_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:FunctionDef_L207_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Return_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L258_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Import_L259_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L258_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L258_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L262_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L258_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L264_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L258_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Assign_L266_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99368:If_L258_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99368:Expr_L267_C4"}]
import subprocess as sb import os class CmdProcess: def __init__(self, cmd_list): self.cmd_list= cmd_list self.process = None def run(self): self.process = sb.Popen(self.cmd_list) def kill(self): os.system('kill -2 %d' % self.process.pid)
ajibawa-2023/Python-Code-Large/train/row_99369
10
14
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99369:Import_L1_C0", "label": "subprocess import sb", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0714, 0.0714, 0, 0.66, 0.0, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["sb"], "rhs_call_name": "", "annotation": ""}, "snippet": "import subprocess as sb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99369:Import_L2_C0", "label": "os import os", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0714, 0, 0.66, 0.5, 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_99369:ClassDef_L4_C0", "label": "CmdProcess", "type": "class", "loc": [4, 14], "level": 0, "parent": null, "vector": [3, 0, 0.6429, 0.7857, 0, 0.66, 1.0, 248, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "CmdProcess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CmdProcess:\n \n def __init__(self, cmd_list):\n self.cmd_list= cmd_list\n self.process = None\n\n def run(self):\n self.process = sb.Popen(self.cmd_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99369:FunctionDef_L6_C4", "label": "__init__", "type": "function", "loc": [6, 8], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99369:ClassDef_L4_C0", "vector": [2, 1, 0.5, 0.2143, 1, 0.08, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "cmd_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, cmd_list):\n self.cmd_list= cmd_list\n self.process = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99369:Assign_L7_C8", "label": "self.cmd_list =", "type": "assigned_variable", "loc": [7, 7], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99369:FunctionDef_L6_C4", "vector": [14, 2, 0.5, 0.0714, 2, 0.36, 0.0, 760, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cmd_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cmd_list= cmd_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99369:Assign_L8_C8", "label": "self.process =", "type": "assigned_variable", "loc": [8, 8], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99369:FunctionDef_L6_C4", "vector": [14, 2, 0.5714, 0.0714, 2, 0.36, 1.0, 789, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.process", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.process = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99369:FunctionDef_L10_C4", "label": "run", "type": "function", "loc": [10, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99369:ClassDef_L4_C0", "vector": [2, 1, 0.75, 0.1429, 1, 0.08, 0.5, 679, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run(self):\n self.process = sb.Popen(self.cmd_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99369:Assign_L11_C8", "label": "self.process = Popen()", "type": "assigned_variable", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99369:FunctionDef_L10_C4", "vector": [14, 2, 0.7857, 0.0714, 2, 0.94, 0.0, 789, 3, 1, 0, 0, 568, 10, 1], "semantic": {"name": "self.process", "arg_names": [], "import_names": [], "rhs_call_name": "Popen", "annotation": ""}, "snippet": " self.process = sb.Popen(self.cmd_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99369:FunctionDef_L13_C4", "label": "kill", "type": "function", "loc": [13, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99369:ClassDef_L4_C0", "vector": [2, 1, 0.9643, 0.1429, 1, 0.08, 1.0, 173, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "kill", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def kill(self):\n os.system('kill -2 %d' % self.process.pid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99369:Expr_L14_C8", "label": "system()", "type": "expression", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99369:FunctionDef_L13_C4", "vector": [8, 2, 1.0, 0.0714, 2, 0.42, 0.0, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": " os.system('kill -2 %d' % self.process.pid)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99369:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99369:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99369:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99369:Assign_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99369:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99369:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99369:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99369:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99369:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99369:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99369:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99369:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99369:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99369:Expr_L14_C8"}]
#! /usr/bin/python # Taken from Tiffany & Kelsey and readapted to my needs. import roslib roslib.load_manifest('hrl_pr2_lib') roslib.load_manifest('ar_pose') roslib.load_manifest('rfid_people_following') import rospy import tf import actionlib from actionlib_msgs.msg import GoalStatus from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal from geometry_msgs.msg import PointStamped from rfid_people_following.srv import FloatFloatFloatFloat_Int32 as arm_srv from ar_pose.msg import ARMarkers import time from threading import Thread import numpy as np, math def ctime(): return rospy.Time.now().to_time() def goal( frame, pos, d ): g = PointHeadGoal() g.target.header.frame_id = frame g.target.point.x = pos[0] g.target.point.y = pos[1] g.target.point.z = pos[2] g.min_duration = rospy.Duration( d ) # Note, looking @ head action source, it seems pointing_frame unimplemented... # Just account with a static offset (for now) where desired. return g class ARtagDetect(): def __init__( self ): try: rospy.init_node('ar_detect_tracker') except: # Parent already initialized pass self.found_tag = False self.settling = False self.last_pos = [ 0.54, 0.0, 0.35 ] self.last_logout = ctime() self.hc = actionlib.SimpleActionClient('/head_traj_controller/point_head_action', PointHeadAction) # headclient self.hc.wait_for_server() self.listener = tf.TransformListener() self.listener.waitForTransform('/torso_lift_link', '/openni_rgb_optical_frame', rospy.Time(0), timeout = rospy.Duration(100) ) self.artag_sub = rospy.Subscriber( '/artag_marker_handoff', ARMarkers, self.processARtag ) self.abort = False rospy.logout('ARtagDetect: Ready and Running.') def processARtag( self, msg ): if msg.markers != []: frame = msg.markers[0].header.frame_id p = msg.markers[0].pose.pose.position pt = PointStamped() pt.header.frame_id = frame pt.point.x = p.x pt.point.y = p.y pt.point.z = p.z pt.header.stamp = rospy.Time(0) try: pt_bl = self.listener.transformPoint( '/torso_lift_link', pt ) pbl = pt_bl.point # pointing_frame manual offset (should actually be on p.y, # but this is a good approximation with less noise in robot frame). pbl.z = pbl.z - 0.2 self.last_pos = [ pbl.x, pbl.y, pbl.z ] if not self.found_tag: self.hc.cancel_all_goals() # stop searching self.found_tag = True except: print pt rospy.logout( 'ARtagDetect: Transform failed' ) return False else: if not self.found_tag and ctime() - self.last_logout > 3.0: rospy.logout( 'ARtag still undetected...' ) self.last_logout = ctime() def scan( self ): rate = rospy.Rate(10) self.hc.send_goal( goal( 'torso_lift_link', [0.54, 0.2, 0.25], 2.0 )) self.hc.wait_for_result() rospy.logout('ARtagDetect: starting sweep') cmds = [ [0.54, -0.2, 0.25], [0.54, 0.2, -0.10], [0.54, -0.2, 0.0], [0.54, 0.2, 0.20], [0.54, -0.2, 0.30], [0.54, 0.0, 0.35] ] q_rate = rospy.Rate(30) for cmd in cmds: self.hc.send_goal( goal( 'torso_lift_link', cmd, 6.0 )) self.hc.wait_for_result( rospy.Duration( 6.0 )) if self.found_tag or self.abort: break if not self.found_tag or self.abort: self.hc.cancel_all_goals() # just in case self.hc.send_goal( goal( 'torso_lift_link', [0.54, 0.0, 0.35], 2.0 )) self.hc.wait_for_result() return (False, 'torso_lift_link', self.last_pos) self.hc.cancel_all_goals() # just in case rate.sleep() rospy.logout('ARtagDetect: Tag detected!') self.settling = True settle = ctime() pos = list( self.last_pos ) #while not rospy.is_shutdown(): while ctime() - settle < 1.5 and not self.abort: self.hc.send_goal( goal( 'torso_lift_link', self.last_pos, 1.0 )) self.hc.stop_tracking_goal() if not np.allclose( pos, self.last_pos, rtol=0.15 ): # not settled within 5cm per axis? print 'Pos: ', pos, ' LastPos: ', self.last_pos settle = ctime() # reset counter pos = list( self.last_pos ) # reset basis pose rate.sleep() self.hc.cancel_all_goals() # just in case rate.sleep() # return (success, link, pose) rospy.logout( 'Tag found!' ) self.settling = False return (True, 'torso_lift_link', pos) class ARthread( Thread ): def __init__( self ): Thread.__init__( self ) self.should_run = True self.d = ARtagDetect() self.should_scan = False self.res = False, 'linkname', [1.0, 1.0, 1.0] self.success = False self.logtime = ctime() self.logtime1 = ctime() self.start() def run( self ): r = rospy.Rate( 10 ) while self.should_run and not rospy.is_shutdown(): if self.should_scan and not self.success: self.d.abort = False self.d.found_tag = False self.d.settling = False self.res = self.d.scan() self.success, link, pos = self.res r.sleep() def scan( self ): if ctime() - self.logtime > 3.0: self.logtime = ctime() rospy.logout('ARthread: started scanning') #self.res = False, 'linkname', [1.0, 1.0, 1.0] self.should_scan = True def found_tag( self ): return self.d.found_tag def settling( self ): return self.d.settling def abort( self ): if ctime() - self.logtime1 > 3.0: self.logtime1 = ctime() rospy.logout('ARthread: scanning aborted.') self.should_scan = False self.d.abort = True def stop( self ): self.should_run = False self.join(10) if (self.isAlive()): raise RuntimeError("ARNode: unable to stop thread") if __name__ == '__main__': ar = ARthread() print 'Starting scann' ar.scan() print 'Sleeping 10 sec.' time.sleep( 10.0 ) ar.abort() print 'Aborted...' print 'Result: ', ar.res ar.stop() # if __name__ == '__main__': # detector = ARtagDetect( ) # print 'done' # rospy.wait_for_service( '/rfid_handoff/handoff_pos' ) # print 'done1' # _hopos = rospy.ServiceProxy( '/rfid_handoff/handoff_pos', arm_srv ) # hopos = lambda x,y,z,a: _hopos( x,y,z,a ) # success, link, pos = detector.scan() # print 'Pos: ', pos # x,y,z = pos # ang = 0.0 # if success == True: # # hacky! Pull the handoff point (wrist) 36cm closer to robot in xy-plane # r = np.sqrt( x ** 2.0 + y ** 2.0 ) # theta = np.arctan2( y, x ) # r = r - 0.36 # x_new = r * np.cos( theta ) # print 'x_new: ', x_new # y_new = r * np.sin( theta ) # hopos( x_new, y_new, z + 0.20, ang )
ajibawa-2023/Python-Code-Large/train/row_99370
149
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_99370:Import_L4_C0", "label": "roslib import roslib", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0175, 0.0044, 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_99370:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0218, 0.0044, 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": "roslib.load_manifest('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0262, 0.0044, 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": "roslib.load_manifest('ar_pose')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0306, 0.0044, 0, 0.66, 0.1579, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('rfid_people_following')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Import_L8_C0", "label": "rospy import rospy", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0349, 0.0044, 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_99370:Import_L9_C0", "label": "tf import tf", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0393, 0.0044, 0, 0.66, 0.2632, 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_99370:Import_L10_C0", "label": "actionlib import actionlib", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0437, 0.0044, 0, 0.66, 0.3158, 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_99370:ImportFrom_L11_C0", "label": "from actionlib_msgs.msg import GoalStatus", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.048, 0.0044, 0, 0.66, 0.3684, 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_99370:ImportFrom_L12_C0", "label": "from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0524, 0.0044, 0, 0.66, 0.4211, 457, 0, 2, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["PointHeadAction", "PointHeadGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:ImportFrom_L13_C0", "label": "from geometry_msgs.msg import PointStamped", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0568, 0.0044, 0, 0.66, 0.4737, 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_99370:ImportFrom_L14_C0", "label": "from rfid_people_following.srv import arm_srv", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0611, 0.0044, 0, 0.66, 0.5263, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["arm_srv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import FloatFloatFloatFloat_Int32 as arm_srv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:ImportFrom_L15_C0", "label": "from ar_pose.msg import ARMarkers", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0655, 0.0044, 0, 0.66, 0.5789, 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_99370:Import_L17_C0", "label": "time import time", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0742, 0.0044, 0, 0.66, 0.6316, 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_99370:ImportFrom_L18_C0", "label": "from threading import Thread", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0786, 0.0044, 0, 0.66, 0.6842, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["Thread"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import Thread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Import_L19_C0", "label": "numpy import np, math", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.083, 0.0044, 0, 0.66, 0.7368, 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_99370:FunctionDef_L21_C0", "label": "ctime", "type": "function", "loc": [21, 22], "level": 0, "parent": null, "vector": [2, 0, 0.0939, 0.0087, 0, 0.66, 0.7895, 671, 0, 0, 1, 0, 0, 0, 2], "semantic": {"name": "ctime", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ctime():\n return rospy.Time.now().to_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Return_L22_C4", "label": "return", "type": "return", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L21_C0", "vector": [13, 1, 0.0961, 0.0044, 1, 0.52, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rospy.Time.now().to_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L24_C0", "label": "goal", "type": "function", "loc": [24, 33], "level": 0, "parent": null, "vector": [2, 0, 0.1245, 0.0437, 0, 0.66, 0.8421, 914, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "goal", "arg_names": ["frame", "pos", "d"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def goal( frame, pos, d ):\n g = PointHeadGoal()\n g.target.header.frame_id = frame\n g.target.point.x = pos[0]\n g.target.point.y = pos[1]\n g.target.point.z = pos[2]\n g.min_duration = rospy.Duration( d )\n # Note, looking @ head action source, it seems pointing_frame unimplemented..."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L25_C4", "label": "g = PointHeadGoal()", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L24_C0", "vector": [14, 1, 0.1092, 0.0044, 1, 0.83, 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_99370:Assign_L26_C4", "label": "g.target.header.frame_id =", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L24_C0", "vector": [14, 1, 0.1135, 0.0044, 1, 0.83, 0.1667, 758, 2, 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 = frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L27_C4", "label": "g.target.point.x =", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L24_C0", "vector": [14, 1, 0.1179, 0.0044, 1, 0.83, 0.3333, 493, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "g.target.point.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " g.target.point.x = pos[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L28_C4", "label": "g.target.point.y =", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L24_C0", "vector": [14, 1, 0.1223, 0.0044, 1, 0.83, 0.5, 219, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "g.target.point.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " g.target.point.y = pos[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L29_C4", "label": "g.target.point.z =", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L24_C0", "vector": [14, 1, 0.1266, 0.0044, 1, 0.83, 0.6667, 906, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "g.target.point.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " g.target.point.z = pos[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L30_C4", "label": "g.min_duration = Duration()", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L24_C0", "vector": [14, 1, 0.131, 0.0044, 1, 0.83, 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( d )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Return_L33_C4", "label": "return", "type": "return", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L24_C0", "vector": [13, 1, 0.1441, 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": " return g"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:ClassDef_L35_C0", "label": "ARtagDetect", "type": "class", "loc": [35, 143], "level": 0, "parent": null, "vector": [3, 0, 0.3886, 0.476, 0, 0.66, 0.8947, 189, 0, 3, 0, 0, 0, 0, 50], "semantic": {"name": "ARtagDetect", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ARtagDetect():\n def __init__( self ):\n try:\n rospy.init_node('ar_detect_tracker')\n except: # Parent already initialized\n pass\n\n self.found_tag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "label": "__init__", "type": "function", "loc": [36, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:ClassDef_L35_C0", "vector": [2, 1, 0.2052, 0.1004, 1, 0.2, 0.0, 555, 0, 1, 0, 0, 0, 0, 10], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self ):\n try:\n rospy.init_node('ar_detect_tracker')\n except: # Parent already initialized\n pass\n\n self.found_tag = False\n self.settling = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Try_L37_C8", "label": "try", "type": "try", "loc": [37, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "vector": [7, 2, 0.1681, 0.0175, 2, 0.0, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node('ar_detect_tracker')\n except: # Parent already initialized\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L38_C12", "label": "init_node()", "type": "expression", "loc": [38, 38], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:Try_L37_C8", "vector": [8, 3, 0.1659, 0.0044, 3, 0.49, 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_detect_tracker')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L42_C8", "label": "self.found_tag =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "vector": [14, 2, 0.1834, 0.0044, 2, 0.0, 0.0909, 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_99370:Assign_L43_C8", "label": "self.settling =", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "vector": [14, 2, 0.1878, 0.0044, 2, 0.0, 0.1818, 904, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.settling", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.settling = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L44_C8", "label": "self.last_pos =", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "vector": [14, 2, 0.1921, 0.0044, 2, 0.0, 0.2727, 908, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.last_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.last_pos = [ 0.54, 0.0, 0.35 ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L45_C8", "label": "self.last_logout = ctime()", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "vector": [14, 2, 0.1965, 0.0044, 2, 0.0, 0.3636, 568, 3, 0, 0, 0, 671, 10, 1], "semantic": {"name": "self.last_logout", "arg_names": [], "import_names": [], "rhs_call_name": "ctime", "annotation": ""}, "snippet": " self.last_logout = ctime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L47_C8", "label": "self.hc = SimpleActionClient()", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "vector": [14, 2, 0.2052, 0.0044, 2, 0.0, 0.4545, 96, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "self.hc", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.hc = actionlib.SimpleActionClient('/head_traj_controller/point_head_action', PointHeadAction) # headclient"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L48_C8", "label": "wait_for_server()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "vector": [8, 2, 0.2096, 0.0044, 2, 0.0, 0.5455, 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.hc.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L50_C8", "label": "self.listener = TransformListener()", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "vector": [14, 2, 0.2183, 0.0044, 2, 0.0, 0.6364, 686, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.listener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L51_C8", "label": "waitForTransform()", "type": "expression", "loc": [51, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "vector": [8, 2, 0.2249, 0.0087, 2, 0.0, 0.7273, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.listener.waitForTransform('/torso_lift_link', '/openni_rgb_optical_frame',\n rospy.Time(0), timeout = rospy.Duration(100) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L54_C8", "label": "self.artag_sub = Subscriber()", "type": "assigned_variable", "loc": [54, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "vector": [14, 2, 0.2402, 0.0131, 2, 0.0, 0.8182, 164, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "self.artag_sub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " self.artag_sub = rospy.Subscriber( '/artag_marker_handoff',\n ARMarkers,\n self.processARtag )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L57_C8", "label": "self.abort =", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "vector": [14, 2, 0.2489, 0.0044, 2, 0.0, 0.9091, 665, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.abort", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.abort = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L58_C8", "label": "logout()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "vector": [8, 2, 0.2533, 0.0044, 2, 0.0, 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('ARtagDetect: Ready and Running.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L60_C4", "label": "processARtag", "type": "function", "loc": [60, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:ClassDef_L35_C0", "vector": [2, 1, 0.3275, 0.1354, 1, 0.2, 0.5, 121, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "processARtag", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def processARtag( self, msg ):\n if msg.markers != []:\n frame = msg.markers[0].header.frame_id\n p = msg.markers[0].pose.pose.position\n\n pt = PointStamped()\n pt.header.frame_id = frame\n pt.point.x = p.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L61_C8", "label": "if", "type": "if", "loc": [61, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L60_C4", "vector": [4, 2, 0.3297, 0.131, 2, 0.28, 0.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg.markers != []:\n frame = msg.markers[0].header.frame_id\n p = msg.markers[0].pose.pose.position\n\n pt = PointStamped()\n pt.header.frame_id = frame\n pt.point.x = p.x\n pt.point.y = p.y "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L62_C12", "label": "frame =", "type": "assigned_variable", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L61_C8", "vector": [14, 3, 0.2707, 0.0044, 3, 0.08, 0.0, 313, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frame = msg.markers[0].header.frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L63_C12", "label": "p =", "type": "assigned_variable", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L61_C8", "vector": [14, 3, 0.2751, 0.0044, 3, 0.08, 0.1111, 491, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = msg.markers[0].pose.pose.position"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L65_C12", "label": "pt = PointStamped()", "type": "assigned_variable", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L61_C8", "vector": [14, 3, 0.2838, 0.0044, 3, 0.08, 0.2222, 989, 3, 0, 0, 0, 969, 10, 1], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "PointStamped", "annotation": ""}, "snippet": " pt = PointStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L66_C12", "label": "pt.header.frame_id =", "type": "assigned_variable", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L61_C8", "vector": [14, 3, 0.2882, 0.0044, 3, 0.08, 0.3333, 78, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt.header.frame_id = frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L67_C12", "label": "pt.point.x =", "type": "assigned_variable", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L61_C8", "vector": [14, 3, 0.2926, 0.0044, 3, 0.08, 0.4444, 984, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt.point.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt.point.x = p.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L68_C12", "label": "pt.point.y =", "type": "assigned_variable", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L61_C8", "vector": [14, 3, 0.2969, 0.0044, 3, 0.08, 0.5556, 973, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt.point.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt.point.y = p.y "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L69_C12", "label": "pt.point.z =", "type": "assigned_variable", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L61_C8", "vector": [14, 3, 0.3013, 0.0044, 3, 0.08, 0.6667, 715, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt.point.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt.point.z = p.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L70_C12", "label": "pt.header.stamp = Time()", "type": "assigned_variable", "loc": [70, 70], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L61_C8", "vector": [14, 3, 0.3057, 0.0044, 3, 0.08, 0.7778, 580, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "pt.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " pt.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Try_L72_C12", "label": "try", "type": "try", "loc": [72, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L61_C8", "vector": [7, 3, 0.3428, 0.0611, 3, 0.08, 0.8889, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n pt_bl = self.listener.transformPoint( '/torso_lift_link', pt )\n pbl = pt_bl.point\n # pointing_frame manual offset (should actually be on p.y,\n # but this is a good approximation with less noise in robot frame).\n pbl.z = pbl.z - 0.2 \n self.last_pos = [ pbl.x, pbl.y, pbl.z ]\n if not self.found_tag:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L73_C16", "label": "pt_bl = transformPoint()", "type": "assigned_variable", "loc": [73, 73], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:Try_L72_C12", "vector": [14, 4, 0.3188, 0.0044, 4, 0.08, 0.0, 853, 3, 2, 0, 0, 987, 10, 1], "semantic": {"name": "pt_bl", "arg_names": [], "import_names": [], "rhs_call_name": "transformPoint", "annotation": ""}, "snippet": " pt_bl = self.listener.transformPoint( '/torso_lift_link', pt )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L74_C16", "label": "pbl =", "type": "assigned_variable", "loc": [74, 74], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:Try_L72_C12", "vector": [14, 4, 0.3231, 0.0044, 4, 0.08, 0.2, 618, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pbl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pbl = pt_bl.point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L77_C16", "label": "pbl.z =", "type": "assigned_variable", "loc": [77, 77], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:Try_L72_C12", "vector": [14, 4, 0.3362, 0.0044, 4, 0.08, 0.4, 613, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pbl.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pbl.z = pbl.z - 0.2 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L78_C16", "label": "self.last_pos =", "type": "assigned_variable", "loc": [78, 78], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:Try_L72_C12", "vector": [14, 4, 0.3406, 0.0044, 4, 0.08, 0.6, 908, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.last_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.last_pos = [ pbl.x, pbl.y, pbl.z ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L79_C16", "label": "if", "type": "if", "loc": [79, 80], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:Try_L72_C12", "vector": [4, 4, 0.3472, 0.0087, 4, 0.08, 0.8, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.found_tag:\n self.hc.cancel_all_goals() # stop searching"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L80_C20", "label": "cancel_all_goals()", "type": "expression", "loc": [80, 80], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L79_C16", "vector": [8, 5, 0.3493, 0.0044, 5, 0.4, 0.0, 699, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel_all_goals", "arg_names": [], "import_names": [], "rhs_call_name": "cancel_all_goals", "annotation": ""}, "snippet": " self.hc.cancel_all_goals() # stop searching"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L81_C16", "label": "self.found_tag =", "type": "assigned_variable", "loc": [81, 81], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:Try_L72_C12", "vector": [14, 4, 0.3537, 0.0044, 4, 0.08, 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_99370:Expr_L83_C16", "label": "print()", "type": "expression", "loc": [83, 83], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:Try_L72_C12", "vector": [8, 4, 0.3624, 0.0044, 4, 0.08, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(pt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L84_C16", "label": "logout()", "type": "expression", "loc": [84, 84], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:Try_L72_C12", "vector": [8, 4, 0.3668, 0.0044, 4, 0.08, 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( 'ARtagDetect: Transform failed' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Return_L85_C16", "label": "return", "type": "return", "loc": [85, 85], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:Try_L72_C12", "vector": [13, 4, 0.3712, 0.0044, 4, 0.08, 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_99370:If_L88_C12", "label": "if", "type": "if", "loc": [88, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L61_C8", "vector": [4, 3, 0.3886, 0.0131, 3, 0.08, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.found_tag and ctime() - self.last_logout > 3.0:\n rospy.logout( 'ARtag still undetected...' )\n self.last_logout = ctime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L89_C16", "label": "logout()", "type": "expression", "loc": [89, 89], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L88_C12", "vector": [8, 4, 0.3886, 0.0044, 4, 0.61, 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( 'ARtag still undetected...' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L90_C16", "label": "self.last_logout = ctime()", "type": "assigned_variable", "loc": [90, 90], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L88_C12", "vector": [14, 4, 0.393, 0.0044, 4, 0.61, 1.0, 568, 3, 0, 0, 0, 671, 10, 1], "semantic": {"name": "self.last_logout", "arg_names": [], "import_names": [], "rhs_call_name": "ctime", "annotation": ""}, "snippet": " self.last_logout = ctime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "label": "scan", "type": "function", "loc": [92, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:ClassDef_L35_C0", "vector": [2, 1, 0.5131, 0.2271, 1, 0.2, 1.0, 202, 0, 1, 1, 0, 0, 0, 31], "semantic": {"name": "scan", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def scan( self ):\n rate = rospy.Rate(10)\n \n self.hc.send_goal( goal( 'torso_lift_link', [0.54, 0.2, 0.25], 2.0 ))\n self.hc.wait_for_result()\n rospy.logout('ARtagDetect: starting sweep')\n \n cmds = [ [0.54, -0.2, 0.25],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L93_C8", "label": "rate = Rate()", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "vector": [14, 2, 0.4061, 0.0044, 2, 0.6, 0.0, 477, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "rate", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " rate = rospy.Rate(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L95_C8", "label": "send_goal()", "type": "expression", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "vector": [8, 2, 0.4148, 0.0044, 2, 0.6, 0.0526, 184, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.hc.send_goal( goal( 'torso_lift_link', [0.54, 0.2, 0.25], 2.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L96_C8", "label": "wait_for_result()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "vector": [8, 2, 0.4192, 0.0044, 2, 0.6, 0.1053, 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.hc.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L97_C8", "label": "logout()", "type": "expression", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "vector": [8, 2, 0.4236, 0.0044, 2, 0.6, 0.1579, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('ARtagDetect: starting sweep')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L99_C8", "label": "cmds =", "type": "assigned_variable", "loc": [99, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "vector": [14, 2, 0.4432, 0.0262, 2, 0.6, 0.2105, 493, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "cmds", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cmds = [ [0.54, -0.2, 0.25],\n [0.54, 0.2, -0.10],\n [0.54, -0.2, 0.0],\n [0.54, 0.2, 0.20],\n [0.54, -0.2, 0.30],\n [0.54, 0.0, 0.35] ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L106_C8", "label": "q_rate = Rate()", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "vector": [14, 2, 0.4629, 0.0044, 2, 0.6, 0.2632, 460, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "q_rate", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " q_rate = rospy.Rate(30)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:For_L107_C8", "label": "for cmd", "type": "for", "loc": [107, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "vector": [6, 2, 0.476, 0.0218, 2, 0.6, 0.3158, 604, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "cmd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for cmd in cmds:\n self.hc.send_goal( goal( 'torso_lift_link', cmd, 6.0 ))\n self.hc.wait_for_result( rospy.Duration( 6.0 ))\n if self.found_tag or self.abort:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L108_C12", "label": "send_goal()", "type": "expression", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:For_L107_C8", "vector": [8, 3, 0.4716, 0.0044, 3, 0.12, 0.0, 184, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.hc.send_goal( goal( 'torso_lift_link', cmd, 6.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L109_C12", "label": "wait_for_result()", "type": "expression", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:For_L107_C8", "vector": [8, 3, 0.476, 0.0044, 3, 0.12, 0.5, 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.hc.wait_for_result( rospy.Duration( 6.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L110_C12", "label": "if", "type": "if", "loc": [110, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:For_L107_C8", "vector": [4, 3, 0.4825, 0.0087, 3, 0.12, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.found_tag or self.abort:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L113_C8", "label": "if", "type": "if", "loc": [113, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "vector": [4, 2, 0.5022, 0.0218, 2, 0.6, 0.3684, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.found_tag or self.abort:\n self.hc.cancel_all_goals() # just in case\n self.hc.send_goal( goal( 'torso_lift_link', [0.54, 0.0, 0.35], 2.0 ))\n self.hc.wait_for_result()\n return (False, 'torso_lift_link', self.last_pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L114_C12", "label": "cancel_all_goals()", "type": "expression", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L113_C8", "vector": [8, 3, 0.4978, 0.0044, 3, 0.47, 0.0, 699, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel_all_goals", "arg_names": [], "import_names": [], "rhs_call_name": "cancel_all_goals", "annotation": ""}, "snippet": " self.hc.cancel_all_goals() # just in case"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L115_C12", "label": "send_goal()", "type": "expression", "loc": [115, 115], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L113_C8", "vector": [8, 3, 0.5022, 0.0044, 3, 0.47, 0.3333, 184, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.hc.send_goal( goal( 'torso_lift_link', [0.54, 0.0, 0.35], 2.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L116_C12", "label": "wait_for_result()", "type": "expression", "loc": [116, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L113_C8", "vector": [8, 3, 0.5066, 0.0044, 3, 0.47, 0.6667, 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.hc.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Return_L117_C12", "label": "return", "type": "return", "loc": [117, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L113_C8", "vector": [13, 3, 0.5109, 0.0044, 3, 0.47, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (False, 'torso_lift_link', self.last_pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L119_C8", "label": "cancel_all_goals()", "type": "expression", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "vector": [8, 2, 0.5197, 0.0044, 2, 0.6, 0.4211, 699, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel_all_goals", "arg_names": [], "import_names": [], "rhs_call_name": "cancel_all_goals", "annotation": ""}, "snippet": " self.hc.cancel_all_goals() # just in case"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L120_C8", "label": "sleep()", "type": "expression", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "vector": [8, 2, 0.524, 0.0044, 2, 0.6, 0.4737, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L122_C8", "label": "logout()", "type": "expression", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "vector": [8, 2, 0.5328, 0.0044, 2, 0.6, 0.5263, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('ARtagDetect: Tag detected!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L123_C8", "label": "self.settling =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "vector": [14, 2, 0.5371, 0.0044, 2, 0.6, 0.5789, 904, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.settling", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.settling = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L125_C8", "label": "settle = ctime()", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "vector": [14, 2, 0.5459, 0.0044, 2, 0.6, 0.6316, 684, 3, 0, 0, 0, 671, 10, 1], "semantic": {"name": "settle", "arg_names": [], "import_names": [], "rhs_call_name": "ctime", "annotation": ""}, "snippet": " settle = ctime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L126_C8", "label": "pos = list()", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "vector": [14, 2, 0.5502, 0.0044, 2, 0.6, 0.6842, 627, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " pos = list( self.last_pos )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:While_L129_C8", "label": "while", "type": "while", "loc": [129, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "vector": [5, 2, 0.5786, 0.0349, 2, 0.6, 0.7368, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while ctime() - settle < 1.5 and not self.abort:\n self.hc.send_goal( goal( 'torso_lift_link', self.last_pos, 1.0 ))\n self.hc.stop_tracking_goal()\n if not np.allclose( pos, self.last_pos, rtol=0.15 ): # not settled within 5cm per axis?\n print('Pos: ', pos, ' LastPos: ', self.last_pos)\n settle = ctime() # reset counter\n pos = list( self.last_pos ) # reset basis pose\n rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L130_C12", "label": "send_goal()", "type": "expression", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:While_L129_C8", "vector": [8, 3, 0.5677, 0.0044, 3, 0.8, 0.0, 184, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.hc.send_goal( goal( 'torso_lift_link', self.last_pos, 1.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L131_C12", "label": "stop_tracking_goal()", "type": "expression", "loc": [131, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:While_L129_C8", "vector": [8, 3, 0.5721, 0.0044, 3, 0.8, 0.3333, 765, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop_tracking_goal", "arg_names": [], "import_names": [], "rhs_call_name": "stop_tracking_goal", "annotation": ""}, "snippet": " self.hc.stop_tracking_goal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L132_C12", "label": "if", "type": "if", "loc": [132, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:While_L129_C8", "vector": [4, 3, 0.583, 0.0175, 3, 0.8, 0.6667, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not np.allclose( pos, self.last_pos, rtol=0.15 ): # not settled within 5cm per axis?\n print('Pos: ', pos, ' LastPos: ', self.last_pos)\n settle = ctime() # reset counter\n pos = list( self.last_pos ) # reset basis pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L133_C16", "label": "print()", "type": "expression", "loc": [133, 133], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L132_C12", "vector": [8, 4, 0.5808, 0.0044, 4, 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('Pos: ', pos, ' LastPos: ', self.last_pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L134_C16", "label": "settle = ctime()", "type": "assigned_variable", "loc": [134, 134], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L132_C12", "vector": [14, 4, 0.5852, 0.0044, 4, 0.06, 0.5, 684, 3, 0, 0, 0, 671, 10, 1], "semantic": {"name": "settle", "arg_names": [], "import_names": [], "rhs_call_name": "ctime", "annotation": ""}, "snippet": " settle = ctime() # reset counter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L135_C16", "label": "pos = list()", "type": "assigned_variable", "loc": [135, 135], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L132_C12", "vector": [14, 4, 0.5895, 0.0044, 4, 0.06, 1.0, 627, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " pos = list( self.last_pos ) # reset basis pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L136_C12", "label": "sleep()", "type": "expression", "loc": [136, 136], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:While_L129_C8", "vector": [8, 3, 0.5939, 0.0044, 3, 0.8, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L138_C8", "label": "cancel_all_goals()", "type": "expression", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "vector": [8, 2, 0.6026, 0.0044, 2, 0.6, 0.7895, 699, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel_all_goals", "arg_names": [], "import_names": [], "rhs_call_name": "cancel_all_goals", "annotation": ""}, "snippet": " self.hc.cancel_all_goals() # just in case"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L139_C8", "label": "sleep()", "type": "expression", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "vector": [8, 2, 0.607, 0.0044, 2, 0.6, 0.8421, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L141_C8", "label": "logout()", "type": "expression", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "vector": [8, 2, 0.6157, 0.0044, 2, 0.6, 0.8947, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'Tag found!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L142_C8", "label": "self.settling =", "type": "assigned_variable", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "vector": [14, 2, 0.6201, 0.0044, 2, 0.6, 0.9474, 904, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.settling", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.settling = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Return_L143_C8", "label": "return", "type": "return", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "vector": [13, 2, 0.6245, 0.0044, 2, 0.6, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (True, 'torso_lift_link', pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:ClassDef_L146_C0", "label": "ARthread", "type": "class", "loc": [146, 195], "level": 0, "parent": null, "vector": [3, 0, 0.7445, 0.2183, 0, 0.66, 0.9474, 275, 0, 7, 0, 0, 134, 0, 18], "semantic": {"name": "ARthread", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ARthread( Thread ):\n def __init__( self ):\n Thread.__init__( self )\n self.should_run = True\n\n self.d = ARtagDetect()\n self.should_scan = False\n self.res = False, 'linkname', [1.0, 1.0, 1.0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L147_C4", "label": "__init__", "type": "function", "loc": [147, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:ClassDef_L146_C0", "vector": [2, 1, 0.6659, 0.0524, 1, 0.6, 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 Thread.__init__( self )\n self.should_run = True\n\n self.d = ARtagDetect()\n self.should_scan = False\n self.res = False, 'linkname', [1.0, 1.0, 1.0]\n self.success = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L148_C8", "label": "__init__()", "type": "expression", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L147_C4", "vector": [8, 2, 0.6463, 0.0044, 2, 0.16, 0.0, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Thread.__init__( self )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L149_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L147_C4", "vector": [14, 2, 0.6507, 0.0044, 2, 0.16, 0.125, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L151_C8", "label": "self.d = ARtagDetect()", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L147_C4", "vector": [14, 2, 0.6594, 0.0044, 2, 0.16, 0.25, 745, 3, 0, 0, 0, 189, 10, 1], "semantic": {"name": "self.d", "arg_names": [], "import_names": [], "rhs_call_name": "ARtagDetect", "annotation": ""}, "snippet": " self.d = ARtagDetect()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L152_C8", "label": "self.should_scan =", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L147_C4", "vector": [14, 2, 0.6638, 0.0044, 2, 0.16, 0.375, 876, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_scan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_scan = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L153_C8", "label": "self.res =", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L147_C4", "vector": [14, 2, 0.6681, 0.0044, 2, 0.16, 0.5, 548, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self.res", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.res = False, 'linkname', [1.0, 1.0, 1.0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L154_C8", "label": "self.success =", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L147_C4", "vector": [14, 2, 0.6725, 0.0044, 2, 0.16, 0.625, 905, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.success", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.success = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L155_C8", "label": "self.logtime = ctime()", "type": "assigned_variable", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L147_C4", "vector": [14, 2, 0.6769, 0.0044, 2, 0.16, 0.75, 750, 3, 0, 0, 0, 671, 10, 1], "semantic": {"name": "self.logtime", "arg_names": [], "import_names": [], "rhs_call_name": "ctime", "annotation": ""}, "snippet": " self.logtime = ctime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L156_C8", "label": "self.logtime1 = ctime()", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L147_C4", "vector": [14, 2, 0.6812, 0.0044, 2, 0.16, 0.875, 466, 3, 0, 0, 0, 671, 10, 1], "semantic": {"name": "self.logtime1", "arg_names": [], "import_names": [], "rhs_call_name": "ctime", "annotation": ""}, "snippet": " self.logtime1 = ctime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L158_C8", "label": "start()", "type": "expression", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L147_C4", "vector": [8, 2, 0.69, 0.0044, 2, 0.16, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L160_C4", "label": "run", "type": "function", "loc": [160, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:ClassDef_L146_C0", "vector": [2, 1, 0.7183, 0.0437, 1, 0.6, 0.1667, 679, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run( self ):\n r = rospy.Rate( 10 )\n while self.should_run and not rospy.is_shutdown():\n if self.should_scan and not self.success:\n self.d.abort = False\n self.d.found_tag = False\n self.d.settling = False\n self.res = self.d.scan()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L161_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L160_C4", "vector": [14, 2, 0.7031, 0.0044, 2, 0.07, 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_99370:While_L162_C8", "label": "while", "type": "while", "loc": [162, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L160_C4", "vector": [5, 2, 0.7227, 0.0349, 2, 0.07, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.should_run and not rospy.is_shutdown():\n if self.should_scan and not self.success:\n self.d.abort = False\n self.d.found_tag = False\n self.d.settling = False\n self.res = self.d.scan()\n self.success, link, pos = self.res\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L163_C12", "label": "if", "type": "if", "loc": [163, 168], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:While_L162_C8", "vector": [4, 3, 0.7227, 0.0262, 3, 0.02, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.should_scan and not self.success:\n self.d.abort = False\n self.d.found_tag = False\n self.d.settling = False\n self.res = self.d.scan()\n self.success, link, pos = self.res"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L164_C16", "label": "self.d.abort =", "type": "assigned_variable", "loc": [164, 164], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L163_C12", "vector": [14, 4, 0.7162, 0.0044, 4, 0.58, 0.0, 784, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.d.abort", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.d.abort = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L165_C16", "label": "self.d.found_tag =", "type": "assigned_variable", "loc": [165, 165], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L163_C12", "vector": [14, 4, 0.7205, 0.0044, 4, 0.58, 0.25, 590, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.d.found_tag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.d.found_tag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L166_C16", "label": "self.d.settling =", "type": "assigned_variable", "loc": [166, 166], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L163_C12", "vector": [14, 4, 0.7249, 0.0044, 4, 0.58, 0.5, 163, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.d.settling", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.d.settling = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L167_C16", "label": "self.res = scan()", "type": "assigned_variable", "loc": [167, 167], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L163_C12", "vector": [14, 4, 0.7293, 0.0044, 4, 0.58, 0.75, 548, 3, 0, 0, 0, 202, 10, 1], "semantic": {"name": "self.res", "arg_names": [], "import_names": [], "rhs_call_name": "scan", "annotation": ""}, "snippet": " self.res = self.d.scan()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L168_C16", "label": "link, pos =", "type": "assigned_variable", "loc": [168, 168], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L163_C12", "vector": [14, 4, 0.7336, 0.0044, 4, 0.58, 1.0, 50, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "link, pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.success, link, pos = self.res"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L169_C12", "label": "sleep()", "type": "expression", "loc": [169, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:While_L162_C8", "vector": [8, 3, 0.738, 0.0044, 3, 0.02, 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_99370:FunctionDef_L171_C4", "label": "scan", "type": "function", "loc": [171, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:ClassDef_L146_C0", "vector": [2, 1, 0.7576, 0.0262, 1, 0.6, 0.3333, 202, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "scan", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def scan( self ):\n if ctime() - self.logtime > 3.0:\n self.logtime = ctime()\n rospy.logout('ARthread: started scanning')\n #self.res = False, 'linkname', [1.0, 1.0, 1.0]\n self.should_scan = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L172_C8", "label": "if", "type": "if", "loc": [172, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L171_C4", "vector": [4, 2, 0.7555, 0.0131, 2, 0.08, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ctime() - self.logtime > 3.0:\n self.logtime = ctime()\n rospy.logout('ARthread: started scanning')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L173_C12", "label": "self.logtime = ctime()", "type": "assigned_variable", "loc": [173, 173], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L172_C8", "vector": [14, 3, 0.7555, 0.0044, 3, 0.14, 0.0, 750, 3, 0, 0, 0, 671, 10, 1], "semantic": {"name": "self.logtime", "arg_names": [], "import_names": [], "rhs_call_name": "ctime", "annotation": ""}, "snippet": " self.logtime = ctime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L174_C12", "label": "logout()", "type": "expression", "loc": [174, 174], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L172_C8", "vector": [8, 3, 0.7598, 0.0044, 3, 0.14, 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('ARthread: started scanning')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L176_C8", "label": "self.should_scan =", "type": "assigned_variable", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L171_C4", "vector": [14, 2, 0.7686, 0.0044, 2, 0.08, 1.0, 876, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_scan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_scan = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L178_C4", "label": "found_tag", "type": "function", "loc": [178, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:ClassDef_L146_C0", "vector": [2, 1, 0.7795, 0.0087, 1, 0.6, 0.5, 273, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "found_tag", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def found_tag( self ):\n return self.d.found_tag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Return_L179_C8", "label": "return", "type": "return", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L178_C4", "vector": [13, 2, 0.7817, 0.0044, 2, 0.52, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.d.found_tag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L181_C4", "label": "settling", "type": "function", "loc": [181, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:ClassDef_L146_C0", "vector": [2, 1, 0.7926, 0.0087, 1, 0.6, 0.6667, 978, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "settling", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def settling( self ):\n return self.d.settling"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Return_L182_C8", "label": "return", "type": "return", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L181_C4", "vector": [13, 2, 0.7948, 0.0044, 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.d.settling"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L184_C4", "label": "abort", "type": "function", "loc": [184, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:ClassDef_L146_C0", "vector": [2, 1, 0.8144, 0.0262, 1, 0.6, 0.8333, 299, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "abort", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def abort( self ):\n if ctime() - self.logtime1 > 3.0:\n self.logtime1 = ctime()\n rospy.logout('ARthread: scanning aborted.')\n self.should_scan = False\n self.d.abort = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L185_C8", "label": "if", "type": "if", "loc": [185, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L184_C4", "vector": [4, 2, 0.8122, 0.0131, 2, 0.3, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ctime() - self.logtime1 > 3.0:\n self.logtime1 = ctime()\n rospy.logout('ARthread: scanning aborted.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L186_C12", "label": "self.logtime1 = ctime()", "type": "assigned_variable", "loc": [186, 186], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L185_C8", "vector": [14, 3, 0.8122, 0.0044, 3, 0.96, 0.0, 466, 3, 0, 0, 0, 671, 10, 1], "semantic": {"name": "self.logtime1", "arg_names": [], "import_names": [], "rhs_call_name": "ctime", "annotation": ""}, "snippet": " self.logtime1 = ctime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L187_C12", "label": "logout()", "type": "expression", "loc": [187, 187], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L185_C8", "vector": [8, 3, 0.8166, 0.0044, 3, 0.96, 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('ARthread: scanning aborted.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L188_C8", "label": "self.should_scan =", "type": "assigned_variable", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L184_C4", "vector": [14, 2, 0.821, 0.0044, 2, 0.3, 0.5, 876, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_scan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_scan = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L189_C8", "label": "self.d.abort =", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L184_C4", "vector": [14, 2, 0.8253, 0.0044, 2, 0.3, 1.0, 784, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.d.abort", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.d.abort = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L191_C4", "label": "stop", "type": "function", "loc": [191, 195], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:ClassDef_L146_C0", "vector": [2, 1, 0.8428, 0.0218, 1, 0.6, 1.0, 343, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "stop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop( self ):\n self.should_run = False\n self.join(10)\n if (self.isAlive()):\n raise RuntimeError(\"ARNode: unable to stop thread\") "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L192_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L191_C4", "vector": [14, 2, 0.8384, 0.0044, 2, 0.96, 0.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L193_C8", "label": "join()", "type": "expression", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L191_C4", "vector": [8, 2, 0.8428, 0.0044, 2, 0.96, 0.5, 933, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.join(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L194_C8", "label": "if", "type": "if", "loc": [194, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L191_C4", "vector": [4, 2, 0.8493, 0.0087, 2, 0.96, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.isAlive()):\n raise RuntimeError(\"ARNode: unable to stop thread\") "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L197_C0", "label": "if", "type": "if", "loc": [197, 206], "level": 0, "parent": null, "vector": [4, 0, 0.8799, 0.0437, 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 ar = ARthread()\n print('Starting scann')\n ar.scan()\n print('Sleeping 10 sec.')\n time.sleep( 10.0 )\n ar.abort()\n print('Aborted...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L198_C4", "label": "ar = ARthread()", "type": "assigned_variable", "loc": [198, 198], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L197_C0", "vector": [14, 1, 0.8646, 0.0044, 1, 0.4, 0.0, 940, 3, 0, 0, 0, 275, 10, 1], "semantic": {"name": "ar", "arg_names": [], "import_names": [], "rhs_call_name": "ARthread", "annotation": ""}, "snippet": " ar = ARthread()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L199_C4", "label": "print()", "type": "expression", "loc": [199, 199], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L197_C0", "vector": [8, 1, 0.869, 0.0044, 1, 0.4, 0.125, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Starting scann')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L200_C4", "label": "scan()", "type": "expression", "loc": [200, 200], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L197_C0", "vector": [8, 1, 0.8734, 0.0044, 1, 0.4, 0.25, 202, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "scan", "arg_names": [], "import_names": [], "rhs_call_name": "scan", "annotation": ""}, "snippet": " ar.scan()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L201_C4", "label": "print()", "type": "expression", "loc": [201, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L197_C0", "vector": [8, 1, 0.8777, 0.0044, 1, 0.4, 0.375, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Sleeping 10 sec.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L202_C4", "label": "sleep()", "type": "expression", "loc": [202, 202], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L197_C0", "vector": [8, 1, 0.8821, 0.0044, 1, 0.4, 0.5, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep( 10.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L203_C4", "label": "abort()", "type": "expression", "loc": [203, 203], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L197_C0", "vector": [8, 1, 0.8865, 0.0044, 1, 0.4, 0.625, 299, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "abort", "arg_names": [], "import_names": [], "rhs_call_name": "abort", "annotation": ""}, "snippet": " ar.abort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L204_C4", "label": "print()", "type": "expression", "loc": [204, 204], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L197_C0", "vector": [8, 1, 0.8908, 0.0044, 1, 0.4, 0.75, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Aborted...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L205_C4", "label": "print()", "type": "expression", "loc": [205, 205], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L197_C0", "vector": [8, 1, 0.8952, 0.0044, 1, 0.4, 0.875, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Result: ', ar.res)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L206_C4", "label": "stop()", "type": "expression", "loc": [206, 206], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L197_C0", "vector": [8, 1, 0.8996, 0.0044, 1, 0.4, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " ar.stop()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Return_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Return_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Try_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:Try_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L38_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L70_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Try_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:Try_L72_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L73_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:Try_L72_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L74_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:Try_L72_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L77_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:Try_L72_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L78_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:Try_L72_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L79_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L79_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L80_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:Try_L72_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L81_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:Try_L72_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L83_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:Try_L72_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L84_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:Try_L72_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Return_L85_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L88_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L89_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L88_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L90_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:For_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:For_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:For_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:For_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L113_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L113_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L115_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L113_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L113_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Return_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:While_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:While_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:While_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L131_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:While_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L132_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L132_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L133_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L132_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L134_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L132_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L135_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:While_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L136_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Return_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:ClassDef_L146_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:ClassDef_L146_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L160_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L160_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:While_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:While_L162_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L163_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L163_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L164_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L163_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L165_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L163_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L166_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L163_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L167_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L163_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L168_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:While_L162_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L169_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:ClassDef_L146_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L171_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L172_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L173_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L172_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L174_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L171_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:ClassDef_L146_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Return_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:ClassDef_L146_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Return_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:ClassDef_L146_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L185_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L186_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L185_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L187_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:ClassDef_L146_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L191_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L197_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Assign_L198_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L197_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L197_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L200_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L197_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L201_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L197_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L202_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L197_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L203_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L197_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L204_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L197_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99370:If_L197_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99370:Expr_L206_C4"}]
#! /usr/bin/python # Directly stolen from Tiffany. Thanks! ;-) import roslib roslib.load_manifest('hrl_pr2_lib') import rospy import actionlib from actionlib_msgs.msg import * from pr2_controllers_msgs.msg import * from geometry_msgs.msg import * import numpy as np import dynamic_reconfigure.client #to turn on/off projector try: rospy.init_node('tmp_headmove') except: pass 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(1.0) self.client.send_goal(self.goal) self.client.wait_for_result() if self.client.get_state() == GoalStatus.SUCCEEDED: print "Succeeded" else: print "Failed" #Borrowed from Kelsey's hrl_pr2_lib/simple_grasp_learner.py def change_projector_mode(self, on): client = dynamic_reconfigure.client.Client("camera_synchronizer_node") node_config = client.get_configuration() node_config["projector_mode"] = 2 if on: node_config["narrow_stereo_trig_mode"] = 3 else: node_config["narrow_stereo_trig_mode"] = 4 client.update_configuration(node_config) if __name__ == '__main__': head = Head() pos = np.matrix([.54, 0.0, 0.9]).T head.set_pose(pos) #rospy.sleep(5.0) #rospy.logout('Moved the head, done pausing.') head.change_projector_mode(False)
ajibawa-2023/Python-Code-Large/train/row_99371
39
58
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Import_L4_C0", "label": "roslib import roslib", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.069, 0.0172, 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_99371:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0862, 0.0172, 0, 0.66, 0.0909, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Import_L6_C0", "label": "rospy import rospy", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1034, 0.0172, 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_99371:Import_L7_C0", "label": "actionlib import actionlib", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1207, 0.0172, 0, 0.66, 0.2727, 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_99371:ImportFrom_L8_C0", "label": "from actionlib_msgs.msg import *", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1379, 0.0172, 0, 0.66, 0.3636, 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_99371:ImportFrom_L9_C0", "label": "from pr2_controllers_msgs.msg import *", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1552, 0.0172, 0, 0.66, 0.4545, 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_99371:ImportFrom_L10_C0", "label": "from geometry_msgs.msg import *", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1724, 0.0172, 0, 0.66, 0.5455, 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_99371:Import_L11_C0", "label": "numpy import np", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1897, 0.0172, 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_99371:Import_L12_C0", "label": "dynamic_reconfigure.client import dynamic_reconfigure.client", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.2069, 0.0172, 0, 0.66, 0.7273, 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 \t#to turn on/off projector"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Try_L14_C0", "label": "try", "type": "try", "loc": [14, 17], "level": 0, "parent": null, "vector": [7, 0, 0.2672, 0.069, 0, 0.66, 0.8182, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n\trospy.init_node('tmp_headmove')\nexcept:\n\tpass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Expr_L15_C1", "label": "init_node()", "type": "expression", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:Try_L14_C0", "vector": [8, 1, 0.2586, 0.0172, 1, 0.21, 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": "\trospy.init_node('tmp_headmove')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:ClassDef_L19_C0", "label": "Head", "type": "class", "loc": [19, 50], "level": 0, "parent": null, "vector": [3, 0, 0.5948, 0.5517, 0, 0.66, 0.9091, 974, 0, 3, 0, 0, 0, 0, 12], "semantic": {"name": "Head", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Head():\n\tdef __init__(self ):\n\t#\trospy.init_node('move_the_head', anonymous=True)\n\t\tself.client = actionlib.SimpleActionClient('/head_traj_controller/point_head_action', PointHeadAction)\n\t\tself.client.wait_for_server()\n\t\tself.goal = PointHeadGoal()\n\n\tdef set_pose(self, pos):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L20_C1", "label": "__init__", "type": "function", "loc": [20, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:ClassDef_L19_C0", "vector": [2, 1, 0.3793, 0.0862, 1, 0.64, 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#\trospy.init_node('move_the_head', anonymous=True)\n\t\tself.client = actionlib.SimpleActionClient('/head_traj_controller/point_head_action', PointHeadAction)\n\t\tself.client.wait_for_server()\n\t\tself.goal = PointHeadGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L22_C2", "label": "self.client = SimpleActionClient()", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L20_C1", "vector": [14, 2, 0.3793, 0.0172, 2, 0.48, 0.0, 349, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "self.client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": "\t\tself.client = actionlib.SimpleActionClient('/head_traj_controller/point_head_action', PointHeadAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Expr_L23_C2", "label": "wait_for_server()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L20_C1", "vector": [8, 2, 0.3966, 0.0172, 2, 0.48, 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": "\t\tself.client.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L24_C2", "label": "self.goal = PointHeadGoal()", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L20_C1", "vector": [14, 2, 0.4138, 0.0172, 2, 0.48, 1.0, 143, 3, 0, 0, 0, 479, 10, 1], "semantic": {"name": "self.goal", "arg_names": [], "import_names": [], "rhs_call_name": "PointHeadGoal", "annotation": ""}, "snippet": "\t\tself.goal = PointHeadGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L26_C1", "label": "set_pose", "type": "function", "loc": [26, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:ClassDef_L19_C0", "vector": [2, 1, 0.5603, 0.2414, 1, 0.64, 0.5, 371, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "set_pose", "arg_names": ["self", "pos"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef set_pose(self, pos):\n\t\tself.goal.target.header.frame_id = 'torso_lift_link'\n\t\tself.goal.target.point.x = pos[0]\n\t\tself.goal.target.point.y = pos[1]\n\t\tself.goal.target.point.z = pos[2]\n\t\tself.goal.min_duration = rospy.Duration(1.0)\n\n\t\tself.client.send_goal(self.goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L27_C2", "label": "self.goal.target.header.frame_id =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L26_C1", "vector": [14, 2, 0.4655, 0.0172, 2, 0.46, 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": "\t\tself.goal.target.header.frame_id = 'torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L28_C2", "label": "self.goal.target.point.x =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L26_C1", "vector": [14, 2, 0.4828, 0.0172, 2, 0.46, 0.1429, 785, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.goal.target.point.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.goal.target.point.x = pos[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L29_C2", "label": "self.goal.target.point.y =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L26_C1", "vector": [14, 2, 0.5, 0.0172, 2, 0.46, 0.2857, 853, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.goal.target.point.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.goal.target.point.y = pos[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L30_C2", "label": "self.goal.target.point.z =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L26_C1", "vector": [14, 2, 0.5172, 0.0172, 2, 0.46, 0.4286, 227, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.goal.target.point.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.goal.target.point.z = pos[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L31_C2", "label": "self.goal.min_duration = Duration()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L26_C1", "vector": [14, 2, 0.5345, 0.0172, 2, 0.46, 0.5714, 446, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "self.goal.min_duration", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": "\t\tself.goal.min_duration = rospy.Duration(1.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Expr_L33_C2", "label": "send_goal()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L26_C1", "vector": [8, 2, 0.569, 0.0172, 2, 0.46, 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": "\t\tself.client.send_goal(self.goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Expr_L34_C2", "label": "wait_for_result()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L26_C1", "vector": [8, 2, 0.5862, 0.0172, 2, 0.46, 0.8571, 328, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_result", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_result", "annotation": ""}, "snippet": "\t\tself.client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:If_L36_C2", "label": "if", "type": "if", "loc": [36, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L26_C1", "vector": [4, 2, 0.6466, 0.069, 2, 0.46, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif self.client.get_state() == GoalStatus.SUCCEEDED:\n\t\t\tprint(\"Succeeded\")\n\t\telse:\n\t\t\tprint(\"Failed\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Expr_L37_C3", "label": "print()", "type": "expression", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:If_L36_C2", "vector": [8, 3, 0.6379, 0.0172, 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": "\t\t\tprint(\"Succeeded\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Expr_L39_C3", "label": "print()", "type": "expression", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:If_L36_C2", "vector": [8, 3, 0.6724, 0.0172, 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": "\t\t\tprint(\"Failed\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L42_C1", "label": "change_projector_mode", "type": "function", "loc": [42, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:ClassDef_L19_C0", "vector": [2, 1, 0.7931, 0.1552, 1, 0.64, 1.0, 446, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "change_projector_mode", "arg_names": ["self", "on"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef change_projector_mode(self, on):\n\t\tclient = dynamic_reconfigure.client.Client(\"camera_synchronizer_node\")\n\t\tnode_config = client.get_configuration()\n\t\tnode_config[\"projector_mode\"] = 2\n\t\tif on:\n\t\t\tnode_config[\"narrow_stereo_trig_mode\"] = 3\n\t\telse:\n\t\t\tnode_config[\"narrow_stereo_trig_mode\"] = 4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L43_C2", "label": "client = Client()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L42_C1", "vector": [14, 2, 0.7414, 0.0172, 2, 0.96, 0.0, 608, 3, 1, 0, 0, 412, 10, 1], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "Client", "annotation": ""}, "snippet": "\t\tclient = dynamic_reconfigure.client.Client(\"camera_synchronizer_node\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L44_C2", "label": "node_config = get_configuration()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L42_C1", "vector": [14, 2, 0.7586, 0.0172, 2, 0.96, 0.25, 333, 3, 0, 0, 0, 942, 10, 1], "semantic": {"name": "node_config", "arg_names": [], "import_names": [], "rhs_call_name": "get_configuration", "annotation": ""}, "snippet": "\t\tnode_config = client.get_configuration()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L45_C2", "label": "assign", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L42_C1", "vector": [14, 2, 0.7759, 0.0172, 2, 0.96, 0.5, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tnode_config[\"projector_mode\"] = 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:If_L46_C2", "label": "if", "type": "if", "loc": [46, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L42_C1", "vector": [4, 2, 0.819, 0.069, 2, 0.96, 0.75, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif on:\n\t\t\tnode_config[\"narrow_stereo_trig_mode\"] = 3\n\t\telse:\n\t\t\tnode_config[\"narrow_stereo_trig_mode\"] = 4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L47_C3", "label": "assign", "type": "assigned_variable", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:If_L46_C2", "vector": [14, 3, 0.8103, 0.0172, 3, 0.3, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tnode_config[\"narrow_stereo_trig_mode\"] = 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L49_C3", "label": "assign", "type": "assigned_variable", "loc": [49, 49], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:If_L46_C2", "vector": [14, 3, 0.8448, 0.0172, 3, 0.3, 1.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tnode_config[\"narrow_stereo_trig_mode\"] = 4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Expr_L50_C2", "label": "update_configuration()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L42_C1", "vector": [8, 2, 0.8621, 0.0172, 2, 0.96, 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": "\t\tclient.update_configuration(node_config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:If_L53_C0", "label": "if", "type": "if", "loc": [53, 58], "level": 0, "parent": null, "vector": [4, 0, 0.9569, 0.1034, 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\thead = Head()\n\thead.set_pose(pos)\n\t#rospy.sleep(5.0)\n\t#rospy.logout('Moved the head, done pausing.')\n\thead.change_projector_mode(False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L54_C1", "label": "head = Head()", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:If_L53_C0", "vector": [14, 1, 0.931, 0.0172, 1, 0.59, 0.0, 217, 3, 0, 0, 0, 974, 10, 1], "semantic": {"name": "head", "arg_names": [], "import_names": [], "rhs_call_name": "Head", "annotation": ""}, "snippet": "\thead = Head()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Expr_L55_C1", "label": "set_pose()", "type": "expression", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:If_L53_C0", "vector": [8, 1, 0.9483, 0.0172, 1, 0.59, 0.5, 371, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_pose", "arg_names": [], "import_names": [], "rhs_call_name": "set_pose", "annotation": ""}, "snippet": "\thead.set_pose(pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99371:Expr_L58_C1", "label": "change_projector_mode()", "type": "expression", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99371:If_L53_C0", "vector": [8, 1, 1.0, 0.0172, 1, 0.59, 1.0, 446, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "change_projector_mode", "arg_names": [], "import_names": [], "rhs_call_name": "change_projector_mode", "annotation": ""}, "snippet": "\thead.change_projector_mode(False)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99371:Try_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:Expr_L15_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L20_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L20_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L22_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L20_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:Expr_L23_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L20_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L24_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L26_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L26_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L27_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L26_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L28_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L26_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L29_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L26_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L26_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L26_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:Expr_L33_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L26_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:Expr_L34_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L26_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:If_L36_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:If_L36_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:Expr_L37_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:If_L36_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:Expr_L39_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L42_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L42_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L43_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L42_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L44_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L42_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L45_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L42_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:If_L46_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:If_L46_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L47_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:If_L46_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L49_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:FunctionDef_L42_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:Expr_L50_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:If_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:Assign_L54_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:If_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:Expr_L55_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99371:If_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99371:Expr_L58_C1"}]
#! /usr/bin/python import time import roslib roslib.load_manifest('rospy') roslib.load_manifest('geometry_msgs') roslib.load_manifest('std_msgs') roslib.load_manifest('hrl_rfid') roslib.load_manifest('robotis') roslib.load_manifest('rfid_people_following') import time import rospy from geometry_msgs.msg import Twist from std_msgs.msg import Float64 from rfid_people_following.srv import StringInt32_Int32 from rfid_people_following.srv import Int32_Int32 from rfid_people_following.srv import StringInt32_Int32Response from std_srvs.srv import Empty import numpy as np, math import os import hrl_rfid.ros_M5e_client as rmc import robotis.ros_robotis as rr from threading import Thread from collections import deque SCORE_BUFFER_LEN = 5 SCORE_BUFFER_MOVE = 3 # number of checked buffer elements that must not be -1. ANGLE_FILTER_LEN = 5 ANGLE_SLEW = math.radians( 10 ) def ctime(): return rospy.Time.now().to_time() class ServoNode( ): def __init__( self ): rospy.logout('servo_node: Initializing') try: rospy.init_node('servo_node') except: pass # Unfold "ears" to servo positions self.p_left = rr.ROS_Robotis_Client( 'left_pan' ) self.t_left = rr.ROS_Robotis_Client( 'left_tilt' ) self.p_right = rr.ROS_Robotis_Client( 'right_pan' ) self.t_right = rr.ROS_Robotis_Client( 'right_tilt' ) # Use assisted teleop as pseudo-callback to see if valid movement: self.scores = deque() self.og_pub = rospy.Publisher( 'assisted_teleop_check', Twist ) self.og_sub = rospy.Subscriber( 'assisted_teleop_score', Float64, self.og_score_cb ) self.command_pub = rospy.Publisher( 'rfid_cmd_vel', Twist ) self._service_servo = rospy.Service('/rfid_servo/servo', StringInt32_Int32, self.run ) self._service_stop = rospy.Service('/rfid_servo/stop', Empty, self.servo_stop ) self._service_stop = rospy.Service('/rfid_servo/abort', Empty, self.servo_abort ) self._service_stop_next_obs = rospy.Service('/rfid_servo/stop_next_obs', Int32_Int32, self.stop_request ) self.stop_next_obs = False # run forever self.should_run = True self.abort = False rospy.logout( 'servo_node: Service ready and waiting' ) def stop_request( self, msg = None ): #self.stop_next_obs = bool( msg.data ) self.stop_next_obs = not self.stop_next_obs rospy.logout( 'servo_node: Stop after next obstacle flag set to %s' % str( self.stop_next_obs )) return True def servo_stop( self, msg = None ): # Note... should now be called "toggle" self.should_run = not self.should_run rospy.logout( 'servo_node: Toggled should_run to %s' % str( self.should_run )) def servo_abort( self, msg = None ): # Note... should now be called "toggle" self.abort = True rospy.logout( 'servo_node: Aborting!' ) def og_score_cb( self, msg ): self.scores.append( msg.data ) if len( self.scores ) > SCORE_BUFFER_LEN: self.scores.popleft() def run( self, request ): rospy.logout( 'servo_node: Called for tagid: \'%s\', continous: %d' % (request.data, request.cont) ) # Move Antennas into Servo mode self.t_left.move_angle( 0.0, math.radians(30), blocking = False ) self.t_right.move_angle( 0.0, math.radians(30), blocking = False ) self.p_left.move_angle( math.radians(-40), math.radians(30), blocking = False ) self.p_right.move_angle( math.radians(40), math.radians(30), blocking = True ) while self.p_left.is_moving() or self.p_right.is_moving(): #time.sleep( 0.01 ) # Not such a good idea when doing simulation. rospy.sleep( 0.05 ) self.stop_next_obs = bool( request.cont ) self.should_run = True self.abort = False # Startup RFID reads self.rp = rfid_poller( request.data ) rospy.logout('servo_node: Running') rate = rospy.Rate( 15.0 ) zed = deque([ 0.0 ]) last_zed = 0.0 #self.scores = deque() last_print = ctime() while self.should_run and not rospy.is_shutdown(): rate.sleep() left, right = self.rp.values #zed.append( 0.07 * (left - right)/5.0 ) zed.append( 0.10 * (left - right)/5.0 ) if len( zed ) > ANGLE_FILTER_LEN: zed.popleft() target_zed = np.mean( zed ) new_zed = last_zed + np.clip( target_zed - last_zed, -1.0 * ANGLE_SLEW, ANGLE_SLEW ) last_zed = new_zed check = Twist() check.linear.x = 0.1 check.angular.z = new_zed self.og_pub.publish( check ) move_command = Twist() if self.abort: self.should_run = False elif len( self.scores ) < SCORE_BUFFER_LEN: rospy.logout( 'servo_node: Score buffer filling: %d of %d' % (len(self.scores), SCORE_BUFFER_LEN) ) elif sum([ i != -1 for i in self.scores]) < SCORE_BUFFER_MOVE: # Check for tag detected! if ctime() - last_print > 1.0: rospy.logout( 'servo_node: Obstacle detected' ) last_print = ctime() if self.stop_next_obs: # Stop after next obstacle detected self.should_run = False elif len( zed ) < ANGLE_FILTER_LEN: rospy.logout( 'servo_node: Angle buffer filling' ) else: move_command.linear.x = check.linear.x move_command.angular.z = check.angular.z self.command_pub.publish( move_command ) # When servo node shuts down... self.command_pub.publish( Twist() ) # Halt the base self.rp.stop() # Stop the reader # Return servos to home position self.t_left.move_angle( 0.0, math.radians(10), blocking = False ) self.t_right.move_angle( 0.0, math.radians(10), blocking = False ) self.p_left.move_angle( -1.350, math.radians(10), blocking = False ) if not (os.environ.has_key('ROBOT') and os.environ['ROBOT'] == 'sim'): self.p_right.move_angle( 1.350, math.radians(10), blocking = False ) else: self.p_right.move_angle( 1.350, math.radians(10), blocking = True ) rospy.logout('servo_node: Returning') return StringInt32_Int32Response( int( True )) class ServoNodeClient(): def __init__( self, service_name = '/rfid_servo/servo' ): rospy.logout( 'servo_node_client: Waiting for service: \'%s\'' % service_name ) rospy.wait_for_service( service_name ) rospy.logout( 'servo_node_client: Service ready.' ) self._servo_service = rospy.ServiceProxy( service_name, StringInt32_Int32 ) def servo( self, tagid, continuous_operation = True ): return self._servo_service( tagid, int( continuous_operation )) class rfid_poller( Thread ): def __init__( self, tagid ): Thread.__init__( self ) self.reader = rmc.ROS_M5e_Client('ears') self.reader.track_mode( tagid ) self.should_run = True self.values = [75.0, 75.0] self.start() def stop( self ): self.should_run = False self.join(3) if (self.isAlive()): raise RuntimeError("rfid_poller: Unable to stop thread") def run( self ): rospy.logout( 'rfid_poller: Starting' ) while self.should_run and not rospy.is_shutdown(): left = np.clip( self.reader.read('EleLeftEar')[-1], 75.0, 110.0 ) right = np.clip( self.reader.read('EleRightEar')[-1], 75.0, 110.0 ) self.values = [left, right] try: # Shut it down to conserve power. Something of a race condition (exception) self.reader.stop() except: pass rospy.logout( 'rfid_poller: Exiting' ) if __name__ == '__main__': sn = ServoNode() rospy.spin()
ajibawa-2023/Python-Code-Large/train/row_99372
151
219
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Import_L2_C0", "label": "time import time", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0091, 0.0046, 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_99372:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0137, 0.0046, 0, 0.66, 0.0333, 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_99372:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0183, 0.0046, 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('rospy')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0228, 0.0046, 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('geometry_msgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0274, 0.0046, 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('std_msgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.032, 0.0046, 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_rfid')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0365, 0.0046, 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('robotis')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L9_C0", "label": "load_manifest()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0411, 0.0046, 0, 0.66, 0.2333, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('rfid_people_following')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Import_L11_C0", "label": "time import time", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0502, 0.0046, 0, 0.66, 0.2667, 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_99372:Import_L12_C0", "label": "rospy import rospy", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0548, 0.0046, 0, 0.66, 0.3, 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_99372:ImportFrom_L13_C0", "label": "from geometry_msgs.msg import Twist", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0594, 0.0046, 0, 0.66, 0.3333, 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_99372:ImportFrom_L14_C0", "label": "from std_msgs.msg import Float64", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0639, 0.0046, 0, 0.66, 0.3667, 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_99372:ImportFrom_L15_C0", "label": "from rfid_people_following.srv import StringInt32_Int32", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0685, 0.0046, 0, 0.66, 0.4, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["StringInt32_Int32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import StringInt32_Int32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:ImportFrom_L16_C0", "label": "from rfid_people_following.srv import Int32_Int32", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0731, 0.0046, 0, 0.66, 0.4333, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["Int32_Int32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import Int32_Int32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:ImportFrom_L17_C0", "label": "from rfid_people_following.srv import StringInt32_Int32Response", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0776, 0.0046, 0, 0.66, 0.4667, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["StringInt32_Int32Response"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import StringInt32_Int32Response"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:ImportFrom_L18_C0", "label": "from std_srvs.srv import Empty", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0822, 0.0046, 0, 0.66, 0.5, 261, 0, 1, 0, 0, 261, 0, 0], "semantic": {"name": "std_srvs.srv", "arg_names": [], "import_names": ["Empty"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_srvs.srv import Empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Import_L20_C0", "label": "numpy import np, math", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0913, 0.0046, 0, 0.66, 0.5333, 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_99372:Import_L21_C0", "label": "os import os", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0959, 0.0046, 0, 0.66, 0.5667, 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_99372:Import_L23_C0", "label": "hrl_rfid.ros_M5e_client import rmc", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.105, 0.0046, 0, 0.66, 0.6, 460, 0, 1, 0, 0, 460, 0, 0], "semantic": {"name": "hrl_rfid.ros_M5e_client", "arg_names": [], "import_names": ["rmc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_rfid.ros_M5e_client as rmc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Import_L24_C0", "label": "robotis.ros_robotis import rr", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.1096, 0.0046, 0, 0.66, 0.6333, 570, 0, 1, 0, 0, 570, 0, 0], "semantic": {"name": "robotis.ros_robotis", "arg_names": [], "import_names": ["rr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import robotis.ros_robotis as rr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:ImportFrom_L26_C0", "label": "from threading import Thread", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.1187, 0.0046, 0, 0.66, 0.6667, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["Thread"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import Thread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:ImportFrom_L27_C0", "label": "from collections import deque", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.1233, 0.0046, 0, 0.66, 0.7, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "collections", "arg_names": [], "import_names": ["deque"], "rhs_call_name": "", "annotation": ""}, "snippet": "from collections import deque"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L29_C0", "label": "SCORE_BUFFER_LEN =", "type": "assigned_variable", "loc": [29, 29], "level": 0, "parent": null, "vector": [14, 0, 0.1324, 0.0046, 0, 0.66, 0.7333, 775, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "SCORE_BUFFER_LEN", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SCORE_BUFFER_LEN = 5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L30_C0", "label": "SCORE_BUFFER_MOVE =", "type": "assigned_variable", "loc": [30, 30], "level": 0, "parent": null, "vector": [14, 0, 0.137, 0.0046, 0, 0.66, 0.7667, 124, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "SCORE_BUFFER_MOVE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SCORE_BUFFER_MOVE = 3 # number of checked buffer elements that must not be -1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L31_C0", "label": "ANGLE_FILTER_LEN =", "type": "assigned_variable", "loc": [31, 31], "level": 0, "parent": null, "vector": [14, 0, 0.1416, 0.0046, 0, 0.66, 0.8, 686, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "ANGLE_FILTER_LEN", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ANGLE_FILTER_LEN = 5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L32_C0", "label": "ANGLE_SLEW = radians()", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 0.1461, 0.0046, 0, 0.66, 0.8333, 981, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "ANGLE_SLEW", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": "ANGLE_SLEW = math.radians( 10 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L34_C0", "label": "ctime", "type": "function", "loc": [34, 35], "level": 0, "parent": null, "vector": [2, 0, 0.1575, 0.0091, 0, 0.66, 0.8667, 671, 0, 0, 1, 0, 0, 0, 2], "semantic": {"name": "ctime", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ctime():\n return rospy.Time.now().to_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Return_L35_C4", "label": "return", "type": "return", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L34_C0", "vector": [13, 1, 0.1598, 0.0046, 1, 0.87, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rospy.Time.now().to_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L37_C0", "label": "ServoNode", "type": "class", "loc": [37, 169], "level": 0, "parent": null, "vector": [3, 0, 0.4703, 0.6073, 0, 0.66, 0.9, 654, 0, 6, 0, 0, 0, 0, 80], "semantic": {"name": "ServoNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ServoNode( ):\n def __init__( self ):\n rospy.logout('servo_node: Initializing')\n try:\n rospy.init_node('servo_node')\n except:\n pass\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "label": "__init__", "type": "function", "loc": [38, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L37_C0", "vector": [2, 1, 0.2374, 0.1324, 1, 0.33, 0.0, 555, 0, 1, 0, 0, 0, 0, 15], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self ):\n rospy.logout('servo_node: Initializing')\n try:\n rospy.init_node('servo_node')\n except:\n pass\n\n # Unfold \"ears\" to servo positions"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L39_C8", "label": "logout()", "type": "expression", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "vector": [8, 2, 0.1781, 0.0046, 2, 0.32, 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('servo_node: Initializing')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Try_L40_C8", "label": "try", "type": "try", "loc": [40, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "vector": [7, 2, 0.1895, 0.0183, 2, 0.32, 0.0588, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node('servo_node')\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L41_C12", "label": "init_node()", "type": "expression", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:Try_L40_C8", "vector": [8, 3, 0.1872, 0.0046, 3, 0.71, 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('servo_node')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L46_C8", "label": "self.p_left = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "vector": [14, 2, 0.21, 0.0046, 2, 0.32, 0.1176, 577, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "self.p_left", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " self.p_left = rr.ROS_Robotis_Client( 'left_pan' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L47_C8", "label": "self.t_left = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "vector": [14, 2, 0.2146, 0.0046, 2, 0.32, 0.1765, 624, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "self.t_left", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " self.t_left = rr.ROS_Robotis_Client( 'left_tilt' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L48_C8", "label": "self.p_right = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "vector": [14, 2, 0.2192, 0.0046, 2, 0.32, 0.2353, 972, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "self.p_right", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " self.p_right = rr.ROS_Robotis_Client( 'right_pan' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L49_C8", "label": "self.t_right = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "vector": [14, 2, 0.2237, 0.0046, 2, 0.32, 0.2941, 359, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "self.t_right", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " self.t_right = rr.ROS_Robotis_Client( 'right_tilt' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L53_C8", "label": "self.scores = deque()", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "vector": [14, 2, 0.242, 0.0046, 2, 0.32, 0.3529, 516, 3, 0, 0, 0, 650, 10, 1], "semantic": {"name": "self.scores", "arg_names": [], "import_names": [], "rhs_call_name": "deque", "annotation": ""}, "snippet": " self.scores = deque()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L54_C8", "label": "self.og_pub = Publisher()", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "vector": [14, 2, 0.2466, 0.0046, 2, 0.32, 0.4118, 19, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.og_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.og_pub = rospy.Publisher( 'assisted_teleop_check', Twist )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L55_C8", "label": "self.og_sub = Subscriber()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "vector": [14, 2, 0.2511, 0.0046, 2, 0.32, 0.4706, 117, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "self.og_sub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " self.og_sub = rospy.Subscriber( 'assisted_teleop_score', Float64, self.og_score_cb )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L56_C8", "label": "self.command_pub = Publisher()", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "vector": [14, 2, 0.2557, 0.0046, 2, 0.32, 0.5294, 513, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.command_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.command_pub = rospy.Publisher( 'rfid_cmd_vel', Twist )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L57_C8", "label": "self._service_servo = Service()", "type": "assigned_variable", "loc": [57, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "vector": [14, 2, 0.2648, 0.0137, 2, 0.32, 0.5882, 917, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self._service_servo", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self._service_servo = rospy.Service('/rfid_servo/servo', \n StringInt32_Int32,\n self.run )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L60_C8", "label": "self._service_stop = Service()", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "vector": [14, 2, 0.274, 0.0046, 2, 0.32, 0.6471, 720, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self._service_stop", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self._service_stop = rospy.Service('/rfid_servo/stop', Empty, self.servo_stop )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L61_C8", "label": "self._service_stop = Service()", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "vector": [14, 2, 0.2785, 0.0046, 2, 0.32, 0.7059, 720, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self._service_stop", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self._service_stop = rospy.Service('/rfid_servo/abort', Empty, self.servo_abort )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L62_C8", "label": "self._service_stop_next_obs = Service()", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "vector": [14, 2, 0.2831, 0.0046, 2, 0.32, 0.7647, 306, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self._service_stop_next_obs", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self._service_stop_next_obs = rospy.Service('/rfid_servo/stop_next_obs', Int32_Int32, self.stop_request )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L63_C8", "label": "self.stop_next_obs =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "vector": [14, 2, 0.2877, 0.0046, 2, 0.32, 0.8235, 577, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.stop_next_obs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.stop_next_obs = False # run forever"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L64_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "vector": [14, 2, 0.2922, 0.0046, 2, 0.32, 0.8824, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L65_C8", "label": "self.abort =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "vector": [14, 2, 0.2968, 0.0046, 2, 0.32, 0.9412, 665, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.abort", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.abort = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L66_C8", "label": "logout()", "type": "expression", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "vector": [8, 2, 0.3014, 0.0046, 2, 0.32, 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( 'servo_node: Service ready and waiting' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L68_C4", "label": "stop_request", "type": "function", "loc": [68, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L37_C0", "vector": [2, 1, 0.3196, 0.0228, 1, 0.33, 0.2, 720, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "stop_request", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop_request( self, msg = None ):\n #self.stop_next_obs = bool( msg.data )\n self.stop_next_obs = not self.stop_next_obs\n rospy.logout( 'servo_node: Stop after next obstacle flag set to %s' % str( self.stop_next_obs ))\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L70_C8", "label": "self.stop_next_obs =", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L68_C4", "vector": [14, 2, 0.3196, 0.0046, 2, 0.7, 0.0, 577, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.stop_next_obs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.stop_next_obs = not self.stop_next_obs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L71_C8", "label": "logout()", "type": "expression", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L68_C4", "vector": [8, 2, 0.3242, 0.0046, 2, 0.7, 0.5, 525, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'servo_node: Stop after next obstacle flag set to %s' % str( self.stop_next_obs ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Return_L72_C8", "label": "return", "type": "return", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L68_C4", "vector": [13, 2, 0.3288, 0.0046, 2, 0.7, 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_99372:FunctionDef_L74_C4", "label": "servo_stop", "type": "function", "loc": [74, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L37_C0", "vector": [2, 1, 0.3447, 0.0183, 1, 0.33, 0.4, 88, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "servo_stop", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def servo_stop( self, msg = None ):\n # Note... should now be called \"toggle\"\n self.should_run = not self.should_run\n rospy.logout( 'servo_node: Toggled should_run to %s' % str( self.should_run ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L76_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L74_C4", "vector": [14, 2, 0.347, 0.0046, 2, 0.29, 0.0, 736, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = not self.should_run"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L77_C8", "label": "logout()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L74_C4", "vector": [8, 2, 0.3516, 0.0046, 2, 0.29, 1.0, 525, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'servo_node: Toggled should_run to %s' % str( self.should_run ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L79_C4", "label": "servo_abort", "type": "function", "loc": [79, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L37_C0", "vector": [2, 1, 0.3676, 0.0183, 1, 0.33, 0.6, 813, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "servo_abort", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def servo_abort( self, msg = None ):\n # Note... should now be called \"toggle\"\n self.abort = True\n rospy.logout( 'servo_node: Aborting!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L81_C8", "label": "self.abort =", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L79_C4", "vector": [14, 2, 0.3699, 0.0046, 2, 0.11, 0.0, 665, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.abort", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.abort = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L82_C8", "label": "logout()", "type": "expression", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L79_C4", "vector": [8, 2, 0.3744, 0.0046, 2, 0.11, 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( 'servo_node: Aborting!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L84_C4", "label": "og_score_cb", "type": "function", "loc": [84, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L37_C0", "vector": [2, 1, 0.3904, 0.0183, 1, 0.33, 0.8, 236, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "og_score_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def og_score_cb( self, msg ):\n self.scores.append( msg.data )\n if len( self.scores ) > SCORE_BUFFER_LEN:\n self.scores.popleft()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L85_C8", "label": "append()", "type": "expression", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L84_C4", "vector": [8, 2, 0.3881, 0.0046, 2, 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": " self.scores.append( msg.data )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L86_C8", "label": "if", "type": "if", "loc": [86, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L84_C4", "vector": [4, 2, 0.395, 0.0091, 2, 0.62, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len( self.scores ) > SCORE_BUFFER_LEN:\n self.scores.popleft()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L87_C12", "label": "popleft()", "type": "expression", "loc": [87, 87], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L86_C8", "vector": [8, 3, 0.3973, 0.0046, 3, 0.5, 0.0, 285, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "popleft", "arg_names": [], "import_names": [], "rhs_call_name": "popleft", "annotation": ""}, "snippet": " self.scores.popleft()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "label": "run", "type": "function", "loc": [89, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L37_C0", "vector": [2, 1, 0.589, 0.3699, 1, 0.33, 1.0, 679, 0, 2, 1, 0, 0, 0, 57], "semantic": {"name": "run", "arg_names": ["self", "request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run( self, request ):\n rospy.logout( 'servo_node: Called for tagid: \\'%s\\', continous: %d' % (request.data, request.cont) )\n\n # Move Antennas into Servo mode\n self.t_left.move_angle( 0.0, math.radians(30), blocking = False )\n self.t_right.move_angle( 0.0, math.radians(30), blocking = False )\n self.p_left.move_angle( math.radians(-40), math.radians(30), blocking = False )\n self.p_right.move_angle( math.radians(40), math.radians(30), blocking = True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L90_C8", "label": "logout()", "type": "expression", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "vector": [8, 2, 0.411, 0.0046, 2, 0.46, 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( 'servo_node: Called for tagid: \\'%s\\', continous: %d' % (request.data, request.cont) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L93_C8", "label": "move_angle()", "type": "expression", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "vector": [8, 2, 0.4247, 0.0046, 2, 0.46, 0.0435, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.t_left.move_angle( 0.0, math.radians(30), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L94_C8", "label": "move_angle()", "type": "expression", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "vector": [8, 2, 0.4292, 0.0046, 2, 0.46, 0.087, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.t_right.move_angle( 0.0, math.radians(30), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L95_C8", "label": "move_angle()", "type": "expression", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "vector": [8, 2, 0.4338, 0.0046, 2, 0.46, 0.1304, 293, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.p_left.move_angle( math.radians(-40), math.radians(30), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L96_C8", "label": "move_angle()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "vector": [8, 2, 0.4384, 0.0046, 2, 0.46, 0.1739, 293, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.p_right.move_angle( math.radians(40), math.radians(30), blocking = True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L98_C8", "label": "while", "type": "while", "loc": [98, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "vector": [5, 2, 0.4521, 0.0137, 2, 0.46, 0.2174, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.p_left.is_moving() or self.p_right.is_moving():\n #time.sleep( 0.01 ) # Not such a good idea when doing simulation.\n rospy.sleep( 0.05 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L100_C12", "label": "sleep()", "type": "expression", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L98_C8", "vector": [8, 3, 0.4566, 0.0046, 3, 0.87, 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.05 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L102_C8", "label": "self.stop_next_obs = bool()", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "vector": [14, 2, 0.4658, 0.0046, 2, 0.46, 0.2609, 577, 3, 1, 0, 0, 337, 10, 1], "semantic": {"name": "self.stop_next_obs", "arg_names": [], "import_names": [], "rhs_call_name": "bool", "annotation": ""}, "snippet": " self.stop_next_obs = bool( request.cont )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L103_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "vector": [14, 2, 0.4703, 0.0046, 2, 0.46, 0.3043, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L104_C8", "label": "self.abort =", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "vector": [14, 2, 0.4749, 0.0046, 2, 0.46, 0.3478, 665, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.abort", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.abort = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L107_C8", "label": "self.rp = rfid_poller()", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "vector": [14, 2, 0.4886, 0.0046, 2, 0.46, 0.3913, 429, 3, 1, 0, 0, 763, 10, 1], "semantic": {"name": "self.rp", "arg_names": [], "import_names": [], "rhs_call_name": "rfid_poller", "annotation": ""}, "snippet": " self.rp = rfid_poller( request.data )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L109_C8", "label": "logout()", "type": "expression", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "vector": [8, 2, 0.4977, 0.0046, 2, 0.46, 0.4348, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('servo_node: Running')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L110_C8", "label": "rate = Rate()", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "vector": [14, 2, 0.5023, 0.0046, 2, 0.46, 0.4783, 477, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "rate", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " rate = rospy.Rate( 15.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L111_C8", "label": "zed = deque()", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "vector": [14, 2, 0.5068, 0.0046, 2, 0.46, 0.5217, 246, 3, 1, 0, 0, 650, 10, 1], "semantic": {"name": "zed", "arg_names": [], "import_names": [], "rhs_call_name": "deque", "annotation": ""}, "snippet": " zed = deque([ 0.0 ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L112_C8", "label": "last_zed =", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "vector": [14, 2, 0.5114, 0.0046, 2, 0.46, 0.5652, 104, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "last_zed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " last_zed = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L114_C8", "label": "last_print = ctime()", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "vector": [14, 2, 0.5205, 0.0046, 2, 0.46, 0.6087, 457, 3, 0, 0, 0, 671, 10, 1], "semantic": {"name": "last_print", "arg_names": [], "import_names": [], "rhs_call_name": "ctime", "annotation": ""}, "snippet": " last_print = ctime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "label": "while", "type": "while", "loc": [116, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "vector": [5, 2, 0.6142, 0.1735, 2, 0.46, 0.6522, 0, 0, 0, 0, 0, 0, 0, 20], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.should_run and not rospy.is_shutdown():\n rate.sleep()\n left, right = self.rp.values\n\n #zed.append( 0.07 * (left - right)/5.0 )\n zed.append( 0.10 * (left - right)/5.0 )\n if len( zed ) > ANGLE_FILTER_LEN:\n zed.popleft()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L117_C12", "label": "sleep()", "type": "expression", "loc": [117, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "vector": [8, 3, 0.5342, 0.0046, 3, 0.75, 0.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L118_C12", "label": "left, right =", "type": "assigned_variable", "loc": [118, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "vector": [14, 3, 0.5388, 0.0046, 3, 0.75, 0.0769, 628, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "left, right", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " left, right = self.rp.values"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L121_C12", "label": "append()", "type": "expression", "loc": [121, 121], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "vector": [8, 3, 0.5525, 0.0046, 3, 0.75, 0.1538, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " zed.append( 0.10 * (left - right)/5.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L122_C12", "label": "if", "type": "if", "loc": [122, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "vector": [4, 3, 0.5594, 0.0091, 3, 0.75, 0.2308, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len( zed ) > ANGLE_FILTER_LEN:\n zed.popleft()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L123_C16", "label": "popleft()", "type": "expression", "loc": [123, 123], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L122_C12", "vector": [8, 4, 0.5616, 0.0046, 4, 0.72, 0.0, 285, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "popleft", "arg_names": [], "import_names": [], "rhs_call_name": "popleft", "annotation": ""}, "snippet": " zed.popleft()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L125_C12", "label": "target_zed = mean()", "type": "assigned_variable", "loc": [125, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "vector": [14, 3, 0.5708, 0.0046, 3, 0.75, 0.3077, 922, 3, 1, 0, 0, 856, 10, 1], "semantic": {"name": "target_zed", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " target_zed = np.mean( zed )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L126_C12", "label": "new_zed =", "type": "assigned_variable", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "vector": [14, 3, 0.5753, 0.0046, 3, 0.75, 0.3846, 111, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "new_zed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_zed = last_zed + np.clip( target_zed - last_zed, -1.0 * ANGLE_SLEW, ANGLE_SLEW )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L127_C12", "label": "last_zed =", "type": "assigned_variable", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "vector": [14, 3, 0.5799, 0.0046, 3, 0.75, 0.4615, 104, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "last_zed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " last_zed = new_zed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L129_C12", "label": "check = Twist()", "type": "assigned_variable", "loc": [129, 129], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "vector": [14, 3, 0.589, 0.0046, 3, 0.75, 0.5385, 803, 3, 0, 0, 0, 9, 10, 1], "semantic": {"name": "check", "arg_names": [], "import_names": [], "rhs_call_name": "Twist", "annotation": ""}, "snippet": " check = Twist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L130_C12", "label": "check.linear.x =", "type": "assigned_variable", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "vector": [14, 3, 0.5936, 0.0046, 3, 0.75, 0.6154, 860, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "check.linear.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " check.linear.x = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L131_C12", "label": "check.angular.z =", "type": "assigned_variable", "loc": [131, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "vector": [14, 3, 0.5982, 0.0046, 3, 0.75, 0.6923, 781, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "check.angular.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " check.angular.z = new_zed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L132_C12", "label": "publish()", "type": "expression", "loc": [132, 132], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "vector": [8, 3, 0.6027, 0.0046, 3, 0.75, 0.7692, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.og_pub.publish( check )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L134_C12", "label": "move_command = Twist()", "type": "assigned_variable", "loc": [134, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "vector": [14, 3, 0.6119, 0.0046, 3, 0.75, 0.8462, 175, 3, 0, 0, 0, 9, 10, 1], "semantic": {"name": "move_command", "arg_names": [], "import_names": [], "rhs_call_name": "Twist", "annotation": ""}, "snippet": " move_command = Twist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L136_C12", "label": "if", "type": "if", "loc": [136, 151], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "vector": [4, 3, 0.6553, 0.0731, 3, 0.75, 0.9231, 0, 7, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.abort:\n self.should_run = False\n elif len( self.scores ) < SCORE_BUFFER_LEN:\n rospy.logout( 'servo_node: Score buffer filling: %d of %d' % (len(self.scores), SCORE_BUFFER_LEN) )\n elif sum([ i != -1 for i in self.scores]) < SCORE_BUFFER_MOVE:\n # Check for tag detected!\n if ctime() - last_print > 1.0:\n rospy.logout( 'servo_node: Obstacle detected' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L137_C16", "label": "self.should_run =", "type": "assigned_variable", "loc": [137, 137], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L136_C12", "vector": [14, 4, 0.6256, 0.0046, 4, 0.57, 0.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L138_C12", "label": "if", "type": "if", "loc": [138, 151], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L136_C12", "vector": [4, 4, 0.6598, 0.0639, 4, 0.57, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif len( self.scores ) < SCORE_BUFFER_LEN:\n rospy.logout( 'servo_node: Score buffer filling: %d of %d' % (len(self.scores), SCORE_BUFFER_LEN) )\n elif sum([ i != -1 for i in self.scores]) < SCORE_BUFFER_MOVE:\n # Check for tag detected!\n if ctime() - last_print > 1.0:\n rospy.logout( 'servo_node: Obstacle detected' )\n last_print = ctime()\n if self.stop_next_obs: # Stop after next obstacle detected"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L139_C16", "label": "logout()", "type": "expression", "loc": [139, 139], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L138_C12", "vector": [8, 5, 0.6347, 0.0046, 5, 0.66, 0.0, 525, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'servo_node: Score buffer filling: %d of %d' % (len(self.scores), SCORE_BUFFER_LEN) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L140_C12", "label": "if", "type": "if", "loc": [140, 151], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L138_C12", "vector": [4, 5, 0.6644, 0.0548, 5, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif sum([ i != -1 for i in self.scores]) < SCORE_BUFFER_MOVE:\n # Check for tag detected!\n if ctime() - last_print > 1.0:\n rospy.logout( 'servo_node: Obstacle detected' )\n last_print = ctime()\n if self.stop_next_obs: # Stop after next obstacle detected\n self.should_run = False\n elif len( zed ) < ANGLE_FILTER_LEN:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L142_C16", "label": "if", "type": "if", "loc": [142, 144], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L140_C12", "vector": [4, 6, 0.653, 0.0137, 6, 0.06, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ctime() - last_print > 1.0:\n rospy.logout( 'servo_node: Obstacle detected' )\n last_print = ctime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L143_C20", "label": "logout()", "type": "expression", "loc": [143, 143], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L142_C16", "vector": [8, 7, 0.653, 0.0046, 7, 0.44, 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( 'servo_node: Obstacle detected' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L144_C20", "label": "last_print = ctime()", "type": "assigned_variable", "loc": [144, 144], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L142_C16", "vector": [14, 7, 0.6575, 0.0046, 7, 0.44, 1.0, 457, 3, 0, 0, 0, 671, 10, 1], "semantic": {"name": "last_print", "arg_names": [], "import_names": [], "rhs_call_name": "ctime", "annotation": ""}, "snippet": " last_print = ctime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L145_C16", "label": "if", "type": "if", "loc": [145, 146], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L140_C12", "vector": [4, 6, 0.6644, 0.0091, 6, 0.06, 0.5, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.stop_next_obs: # Stop after next obstacle detected\n self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L146_C20", "label": "self.should_run =", "type": "assigned_variable", "loc": [146, 146], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L145_C16", "vector": [14, 7, 0.6667, 0.0046, 7, 0.53, 0.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L147_C12", "label": "if", "type": "if", "loc": [147, 151], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L140_C12", "vector": [4, 6, 0.6804, 0.0228, 6, 0.06, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif len( zed ) < ANGLE_FILTER_LEN:\n rospy.logout( 'servo_node: Angle buffer filling' )\n else:\n move_command.linear.x = check.linear.x\n move_command.angular.z = check.angular.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L148_C16", "label": "logout()", "type": "expression", "loc": [148, 148], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L147_C12", "vector": [8, 7, 0.6758, 0.0046, 7, 0.4, 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( 'servo_node: Angle buffer filling' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L150_C16", "label": "move_command.linear.x =", "type": "assigned_variable", "loc": [150, 150], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L147_C12", "vector": [14, 7, 0.6849, 0.0046, 7, 0.4, 0.5, 56, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "move_command.linear.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " move_command.linear.x = check.linear.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L151_C16", "label": "move_command.angular.z =", "type": "assigned_variable", "loc": [151, 151], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L147_C12", "vector": [14, 7, 0.6895, 0.0046, 7, 0.4, 1.0, 153, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "move_command.angular.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " move_command.angular.z = check.angular.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L153_C12", "label": "publish()", "type": "expression", "loc": [153, 153], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "vector": [8, 3, 0.6986, 0.0046, 3, 0.75, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.command_pub.publish( move_command )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L156_C8", "label": "publish()", "type": "expression", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "vector": [8, 2, 0.7123, 0.0046, 2, 0.46, 0.6957, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.command_pub.publish( Twist() ) # Halt the base"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L157_C8", "label": "stop()", "type": "expression", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "vector": [8, 2, 0.7169, 0.0046, 2, 0.46, 0.7391, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " self.rp.stop() # Stop the reader"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L160_C8", "label": "move_angle()", "type": "expression", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "vector": [8, 2, 0.7306, 0.0046, 2, 0.46, 0.7826, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.t_left.move_angle( 0.0, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L161_C8", "label": "move_angle()", "type": "expression", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "vector": [8, 2, 0.7352, 0.0046, 2, 0.46, 0.8261, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.t_right.move_angle( 0.0, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L162_C8", "label": "move_angle()", "type": "expression", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "vector": [8, 2, 0.7397, 0.0046, 2, 0.46, 0.8696, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.p_left.move_angle( -1.350, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L163_C8", "label": "if", "type": "if", "loc": [163, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "vector": [4, 2, 0.7511, 0.0183, 2, 0.46, 0.913, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (os.environ.has_key('ROBOT') and os.environ['ROBOT'] == 'sim'):\n self.p_right.move_angle( 1.350, math.radians(10), blocking = False )\n else:\n self.p_right.move_angle( 1.350, math.radians(10), blocking = True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L164_C12", "label": "move_angle()", "type": "expression", "loc": [164, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L163_C8", "vector": [8, 3, 0.7489, 0.0046, 3, 0.75, 0.0, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.p_right.move_angle( 1.350, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L166_C12", "label": "move_angle()", "type": "expression", "loc": [166, 166], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L163_C8", "vector": [8, 3, 0.758, 0.0046, 3, 0.75, 1.0, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.p_right.move_angle( 1.350, math.radians(10), blocking = True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L168_C8", "label": "logout()", "type": "expression", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "vector": [8, 2, 0.7671, 0.0046, 2, 0.46, 0.9565, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('servo_node: Returning')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Return_L169_C8", "label": "return", "type": "return", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "vector": [13, 2, 0.7717, 0.0046, 2, 0.46, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return StringInt32_Int32Response( int( True ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L172_C0", "label": "ServoNodeClient", "type": "class", "loc": [172, 181], "level": 0, "parent": null, "vector": [3, 0, 0.8059, 0.0457, 0, 0.66, 0.9333, 563, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "ServoNodeClient", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ServoNodeClient():\n def __init__( self, service_name = '/rfid_servo/servo' ):\n rospy.logout( 'servo_node_client: Waiting for service: \\'%s\\'' % service_name )\n rospy.wait_for_service( service_name )\n rospy.logout( 'servo_node_client: Service ready.' )\n \n self._servo_service = rospy.ServiceProxy( service_name, StringInt32_Int32 )\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L173_C4", "label": "__init__", "type": "function", "loc": [173, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L172_C0", "vector": [2, 1, 0.8014, 0.0274, 1, 0.54, 0.0, 555, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "service_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, service_name = '/rfid_servo/servo' ):\n rospy.logout( 'servo_node_client: Waiting for service: \\'%s\\'' % service_name )\n rospy.wait_for_service( service_name )\n rospy.logout( 'servo_node_client: Service ready.' )\n \n self._servo_service = rospy.ServiceProxy( service_name, StringInt32_Int32 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L174_C8", "label": "logout()", "type": "expression", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L173_C4", "vector": [8, 2, 0.7945, 0.0046, 2, 0.9, 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( 'servo_node_client: Waiting for service: \\'%s\\'' % service_name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L175_C8", "label": "wait_for_service()", "type": "expression", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L173_C4", "vector": [8, 2, 0.7991, 0.0046, 2, 0.9, 0.3333, 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( service_name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L176_C8", "label": "logout()", "type": "expression", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L173_C4", "vector": [8, 2, 0.8037, 0.0046, 2, 0.9, 0.6667, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'servo_node_client: Service ready.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L178_C8", "label": "self._servo_service = ServiceProxy()", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L173_C4", "vector": [14, 2, 0.8128, 0.0046, 2, 0.9, 1.0, 1, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._servo_service", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._servo_service = rospy.ServiceProxy( service_name, StringInt32_Int32 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L180_C4", "label": "servo", "type": "function", "loc": [180, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L172_C0", "vector": [2, 1, 0.8242, 0.0091, 1, 0.54, 1.0, 604, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "servo", "arg_names": ["self", "tagid", "continuous_operation"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def servo( self, tagid, continuous_operation = True ):\n return self._servo_service( tagid, int( continuous_operation ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Return_L181_C8", "label": "return", "type": "return", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L180_C4", "vector": [13, 2, 0.8265, 0.0046, 2, 0.52, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._servo_service( tagid, int( continuous_operation ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L184_C0", "label": "rfid_poller", "type": "class", "loc": [184, 209], "level": 0, "parent": null, "vector": [3, 0, 0.8973, 0.1187, 0, 0.66, 0.9667, 763, 0, 3, 0, 0, 134, 0, 15], "semantic": {"name": "rfid_poller", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class rfid_poller( Thread ):\n def __init__( self, tagid ):\n Thread.__init__( self )\n self.reader = rmc.ROS_M5e_Client('ears')\n self.reader.track_mode( tagid )\n self.should_run = True\n self.values = [75.0, 75.0]\n self.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L185_C4", "label": "__init__", "type": "function", "loc": [185, 191], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L184_C0", "vector": [2, 1, 0.8584, 0.032, 1, 0.47, 0.0, 555, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "tagid"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, tagid ):\n Thread.__init__( self )\n self.reader = rmc.ROS_M5e_Client('ears')\n self.reader.track_mode( tagid )\n self.should_run = True\n self.values = [75.0, 75.0]\n self.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L186_C8", "label": "__init__()", "type": "expression", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L185_C4", "vector": [8, 2, 0.8493, 0.0046, 2, 0.4, 0.0, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Thread.__init__( self )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L187_C8", "label": "self.reader = ROS_M5e_Client()", "type": "assigned_variable", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L185_C4", "vector": [14, 2, 0.8539, 0.0046, 2, 0.4, 0.2, 536, 3, 1, 0, 0, 479, 10, 1], "semantic": {"name": "self.reader", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_M5e_Client", "annotation": ""}, "snippet": " self.reader = rmc.ROS_M5e_Client('ears')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L188_C8", "label": "track_mode()", "type": "expression", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L185_C4", "vector": [8, 2, 0.8584, 0.0046, 2, 0.4, 0.4, 884, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "track_mode", "arg_names": [], "import_names": [], "rhs_call_name": "track_mode", "annotation": ""}, "snippet": " self.reader.track_mode( tagid )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L189_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L185_C4", "vector": [14, 2, 0.863, 0.0046, 2, 0.4, 0.6, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L190_C8", "label": "self.values =", "type": "assigned_variable", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L185_C4", "vector": [14, 2, 0.8676, 0.0046, 2, 0.4, 0.8, 397, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.values", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.values = [75.0, 75.0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L191_C8", "label": "start()", "type": "expression", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L185_C4", "vector": [8, 2, 0.8721, 0.0046, 2, 0.4, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L193_C4", "label": "stop", "type": "function", "loc": [193, 197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L184_C0", "vector": [2, 1, 0.8904, 0.0228, 1, 0.47, 0.5, 343, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "stop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop( self ):\n self.should_run = False\n self.join(3)\n if (self.isAlive()):\n raise RuntimeError(\"rfid_poller: Unable to stop thread\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L194_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L193_C4", "vector": [14, 2, 0.8858, 0.0046, 2, 0.81, 0.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L195_C8", "label": "join()", "type": "expression", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L193_C4", "vector": [8, 2, 0.8904, 0.0046, 2, 0.81, 0.5, 933, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.join(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L196_C8", "label": "if", "type": "if", "loc": [196, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L193_C4", "vector": [4, 2, 0.8973, 0.0091, 2, 0.81, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.isAlive()):\n raise RuntimeError(\"rfid_poller: Unable to stop thread\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L199_C4", "label": "run", "type": "function", "loc": [199, 209], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L184_C0", "vector": [2, 1, 0.9315, 0.0502, 1, 0.47, 1.0, 679, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run( self ):\n rospy.logout( 'rfid_poller: Starting' )\n while self.should_run and not rospy.is_shutdown():\n left = np.clip( self.reader.read('EleLeftEar')[-1], 75.0, 110.0 )\n right = np.clip( self.reader.read('EleRightEar')[-1], 75.0, 110.0 )\n self.values = [left, right]\n try: # Shut it down to conserve power. Something of a race condition (exception)\n self.reader.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L200_C8", "label": "logout()", "type": "expression", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L199_C4", "vector": [8, 2, 0.9132, 0.0046, 2, 0.68, 0.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'rfid_poller: Starting' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L201_C8", "label": "while", "type": "while", "loc": [201, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L199_C4", "vector": [5, 2, 0.9247, 0.0183, 2, 0.68, 0.3333, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.should_run and not rospy.is_shutdown():\n left = np.clip( self.reader.read('EleLeftEar')[-1], 75.0, 110.0 )\n right = np.clip( self.reader.read('EleRightEar')[-1], 75.0, 110.0 )\n self.values = [left, right]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L202_C12", "label": "left = clip()", "type": "assigned_variable", "loc": [202, 202], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L201_C8", "vector": [14, 3, 0.9224, 0.0046, 3, 0.98, 0.0, 605, 3, 3, 0, 0, 689, 10, 2], "semantic": {"name": "left", "arg_names": [], "import_names": [], "rhs_call_name": "clip", "annotation": ""}, "snippet": " left = np.clip( self.reader.read('EleLeftEar')[-1], 75.0, 110.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L203_C12", "label": "right = clip()", "type": "assigned_variable", "loc": [203, 203], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L201_C8", "vector": [14, 3, 0.9269, 0.0046, 3, 0.98, 0.5, 724, 3, 3, 0, 0, 689, 10, 2], "semantic": {"name": "right", "arg_names": [], "import_names": [], "rhs_call_name": "clip", "annotation": ""}, "snippet": " right = np.clip( self.reader.read('EleRightEar')[-1], 75.0, 110.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L204_C12", "label": "self.values =", "type": "assigned_variable", "loc": [204, 204], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L201_C8", "vector": [14, 3, 0.9315, 0.0046, 3, 0.98, 1.0, 397, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.values", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.values = [left, right]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Try_L205_C8", "label": "try", "type": "try", "loc": [205, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L199_C4", "vector": [7, 2, 0.9429, 0.0183, 2, 0.68, 0.6667, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try: # Shut it down to conserve power. Something of a race condition (exception)\n self.reader.stop()\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L206_C12", "label": "stop()", "type": "expression", "loc": [206, 206], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:Try_L205_C8", "vector": [8, 3, 0.9406, 0.0046, 3, 0.01, 0.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " self.reader.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L209_C8", "label": "logout()", "type": "expression", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L199_C4", "vector": [8, 2, 0.9543, 0.0046, 2, 0.68, 1.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'rfid_poller: Exiting' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L216_C0", "label": "if", "type": "if", "loc": [216, 218], "level": 0, "parent": null, "vector": [4, 0, 0.9909, 0.0137, 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 sn = ServoNode()\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L217_C4", "label": "sn = ServoNode()", "type": "assigned_variable", "loc": [217, 217], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L216_C0", "vector": [14, 1, 0.9909, 0.0046, 1, 0.81, 0.0, 981, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "sn", "arg_names": [], "import_names": [], "rhs_call_name": "ServoNode", "annotation": ""}, "snippet": " sn = ServoNode()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L218_C4", "label": "spin()", "type": "expression", "loc": [218, 218], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L216_C0", "vector": [8, 1, 0.9954, 0.0046, 1, 0.81, 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_99372:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Return_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Try_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:Try_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Return_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L86_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L118_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L121_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L122_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L123_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L129_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L131_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L132_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L134_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L136_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L136_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L137_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L136_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L138_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L138_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L139_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L138_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L140_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L142_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L142_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L143_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L142_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L144_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L140_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L145_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L145_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L146_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L140_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L147_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L148_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L147_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L150_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L147_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L151_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L153_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L164_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L166_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Return_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Return_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L184_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L184_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L193_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L193_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L193_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L193_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:ClassDef_L184_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L201_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L202_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L201_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L203_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:While_L201_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L204_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Try_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:Try_L205_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L206_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L216_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Assign_L217_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99372:If_L216_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99372:Expr_L218_C4"}]
# ROS imports import roslib roslib.load_manifest('rfid_people_following') roslib.load_manifest('robotis') import rospy from std_msgs.msg import Float64 from robotis.srv import None_Float from robotis.srv import None_FloatResponse from robotis.srv import MoveAng from robotis.srv import MoveAngResponse from robotis.srv import None_Int32 from robotis.srv import None_Int32Response import time import numpy as np, math from threading import Thread def standard_rad(t): if t > 0: return ((t + np.pi) % (np.pi * 2)) - np.pi else: return ((t - np.pi) % (np.pi * -2)) + np.pi class USB2Dynamixel_Device(): ''' Class that manages serial port contention between servos on same bus ''' def __init__( self, dev_name = '/dev/ttyUSB0', baudrate = 57600 ): self.dev_name = dev_name class Robotis_Servo( Thread ): ''' Class to use a robotis RX-28 or RX-64 servo. ''' def __init__(self, USB2Dynamixel, servo_id ): ''' USB2Dynamixel - USB2Dynamixel_Device object to handle serial port. Handles threadsafe operation for multiple servos servo_id - servo ids connected to USB2Dynamixel 1,2,3,4 ... (1 to 253) [0 is broadcast if memory serves] ''' Thread.__init__( self ) try: rospy.init_node( 'RobotisServo_'+str(servo_id) ) except rospy.ROSException: pass self.should_run = True self.is_moving_flag = False self.curr_angle = 0.0 self.rate = 0.0 self.des_angle = 0.0 self.max_speed = math.radians( 50 ) self.dyn = USB2Dynamixel # ID exists on bus? self.servo_id = servo_id self.start() def is_moving(self): ''' returns True if servo is moving. ''' return self.is_moving_flag def write_address(self, address, data): ''' writes data at the address. data = [n1,n2 ...] list of numbers. return [n1,n2 ...] (list of return parameters) ''' return def read_angle(self): ''' returns the current servo angle (radians) ''' return self.curr_angle def move_angle(self, ang, angvel=None, blocking=True): ''' move to angle (radians) ''' self.rate = angvel self.des_angle = ang rospy.sleep( 0.05 ) while blocking and self.is_moving_flag: rospy.sleep( 0.05 ) return def run( self ): #last_time = time.time() last_time = rospy.Time.now().to_nsec() * 10**-9 while self.should_run and not rospy.is_shutdown(): rospy.sleep( 1.0 / 30.0 ) new_time = rospy.Time.now().to_nsec() * 10**-9 curr = self.curr_angle des = self.des_angle if curr == des: self.is_moving_flag = False else: ang_diff = standard_rad( des - curr ) move_mag = np.sign( ang_diff ) * (new_time - last_time) * self.rate new_ang = curr + move_mag if np.abs( ang_diff ) < np.abs( move_mag ): self.curr_angle = des self.is_moving_flag = False else: self.is_moving_flag = True self.curr_angle = new_ang last_time = new_time class ROS_Robotis_Server(): # This class provides ROS services for a select few lib_robotis functions def __init__(self, servo = None, name = '' ): if servo == None: raise RuntimeError( 'ROS_Robotis_Servo: No servo specified for server.\n' ) self.servo = servo self.name = name try: rospy.init_node( 'robotis_servo_' + self.name ) except rospy.ROSException: pass #self.servo.disable_torque() rospy.logout( 'ROS_Robotis_Servo: Starting Server /robotis/servo_' + self.name ) self.channel = rospy.Publisher('/robotis/servo_' + self.name, Float64) self.__service_ang = rospy.Service('/robotis/servo_' + name + '_readangle', None_Float, self.__cb_readangle) self.__service_ismove = rospy.Service('/robotis/servo_' + name + '_ismoving', None_Int32, self.__cb_ismoving) self.__service_moveang = rospy.Service('/robotis/servo_' + name + '_moveangle', MoveAng, self.__cb_moveangle) def __cb_readangle( self, request ): ang = self.update_server() return None_FloatResponse( ang ) def __cb_ismoving( self, request ): status = self.servo.is_moving() return None_Int32Response( int(status) ) def __cb_moveangle( self, request ): rospy.logout( 'RobotisServo: Move %s to angle %3.2f' % (self.name, math.degrees( request.angle ))) ang = request.angle angvel = request.angvel blocking = bool( request.blocking ) self.servo.move_angle( ang, angvel, blocking ) rospy.logout( 'RobotisServo: Move %s Done' % (self.name)) return MoveAngResponse() def update_server(self): ang = self.servo.read_angle() self.channel.publish( Float64(ang) ) return ang class ROS_Robotis_Poller( Thread ): # A utility class that will setup and poll a number of ROS_Robotis_Servos on one USB2Dynamixel def __init__( self, dev_name, ids, names ): Thread.__init__(self) self.should_run = True self.dev_name = dev_name self.ids = ids self.names = names for n in self.names: rospy.logout( 'ROS_Robotis_Servo: Starting Up /robotis/servo_' + n + ' on ' + self.dev_name ) self.dyn = USB2Dynamixel_Device( self.dev_name ) self.servos = [ Robotis_Servo( self.dyn, i ) for i in self.ids ] self.ros_servers = [ ROS_Robotis_Server( s, n ) for s,n in zip( self.servos, self.names ) ] rospy.logout( 'ROS_Robotis_Servo: Setup Complete on ' + self.dev_name ) self.start() def run( self ): while self.should_run: [ s.update_server() for s in self.ros_servers ] rospy.sleep(0.001) for n in self.names: rospy.logout( 'ROS_Robotis_Servo: Shutting Down /robotis/servo_' + n + ' on ' + self.dev_name ) def stop(self): self.should_run = False self.join(3) if (self.isAlive()): raise RuntimeError("ROS_Robotis_Servo: unable to stop thread") # Client should come from robotis package. All services defined.
ajibawa-2023/Python-Code-Large/train/row_99373
127
207
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0145, 0.0048, 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_99373:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0193, 0.0048, 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('rfid_people_following')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0242, 0.0048, 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": "roslib.load_manifest('robotis')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Import_L6_C0", "label": "rospy import rospy", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.029, 0.0048, 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_99373:ImportFrom_L8_C0", "label": "from std_msgs.msg import Float64", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0386, 0.0048, 0, 0.66, 0.2222, 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_99373:ImportFrom_L9_C0", "label": "from robotis.srv import None_Float", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0435, 0.0048, 0, 0.66, 0.2778, 727, 0, 1, 0, 0, 727, 0, 0], "semantic": {"name": "robotis.srv", "arg_names": [], "import_names": ["None_Float"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robotis.srv import None_Float"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:ImportFrom_L10_C0", "label": "from robotis.srv import None_FloatResponse", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0483, 0.0048, 0, 0.66, 0.3333, 727, 0, 1, 0, 0, 727, 0, 0], "semantic": {"name": "robotis.srv", "arg_names": [], "import_names": ["None_FloatResponse"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robotis.srv import None_FloatResponse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:ImportFrom_L11_C0", "label": "from robotis.srv import MoveAng", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0531, 0.0048, 0, 0.66, 0.3889, 727, 0, 1, 0, 0, 727, 0, 0], "semantic": {"name": "robotis.srv", "arg_names": [], "import_names": ["MoveAng"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robotis.srv import MoveAng"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:ImportFrom_L12_C0", "label": "from robotis.srv import MoveAngResponse", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.058, 0.0048, 0, 0.66, 0.4444, 727, 0, 1, 0, 0, 727, 0, 0], "semantic": {"name": "robotis.srv", "arg_names": [], "import_names": ["MoveAngResponse"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robotis.srv import MoveAngResponse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:ImportFrom_L13_C0", "label": "from robotis.srv import None_Int32", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0628, 0.0048, 0, 0.66, 0.5, 727, 0, 1, 0, 0, 727, 0, 0], "semantic": {"name": "robotis.srv", "arg_names": [], "import_names": ["None_Int32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robotis.srv import None_Int32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:ImportFrom_L14_C0", "label": "from robotis.srv import None_Int32Response", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0676, 0.0048, 0, 0.66, 0.5556, 727, 0, 1, 0, 0, 727, 0, 0], "semantic": {"name": "robotis.srv", "arg_names": [], "import_names": ["None_Int32Response"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robotis.srv import None_Int32Response"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Import_L16_C0", "label": "time import time", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0773, 0.0048, 0, 0.66, 0.6111, 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_99373:Import_L17_C0", "label": "numpy import np, math", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0821, 0.0048, 0, 0.66, 0.6667, 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_99373:ImportFrom_L18_C0", "label": "from threading import Thread", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0048, 0, 0.66, 0.7222, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["Thread"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import Thread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L20_C0", "label": "standard_rad", "type": "function", "loc": [20, 24], "level": 0, "parent": null, "vector": [2, 0, 0.1063, 0.0242, 0, 0.66, 0.7778, 54, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "standard_rad", "arg_names": ["t"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def standard_rad(t):\n if t > 0:\n return ((t + np.pi) % (np.pi * 2)) - np.pi\n else:\n return ((t - np.pi) % (np.pi * -2)) + np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L21_C4", "label": "if", "type": "if", "loc": [21, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L20_C0", "vector": [4, 1, 0.1087, 0.0193, 1, 0.41, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if t > 0:\n return ((t + np.pi) % (np.pi * 2)) - np.pi\n else:\n return ((t - np.pi) % (np.pi * -2)) + np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Return_L22_C8", "label": "return", "type": "return", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L21_C4", "vector": [13, 2, 0.1063, 0.0048, 2, 0.2, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ((t + np.pi) % (np.pi * 2)) - np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Return_L24_C8", "label": "return", "type": "return", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L21_C4", "vector": [13, 2, 0.1159, 0.0048, 2, 0.2, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ((t - np.pi) % (np.pi * -2)) + np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L27_C0", "label": "USB2Dynamixel_Device", "type": "class", "loc": [27, 31], "level": 0, "parent": null, "vector": [3, 0, 0.1401, 0.0242, 0, 0.66, 0.8333, 935, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "USB2Dynamixel_Device", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class USB2Dynamixel_Device():\n ''' Class that manages serial port contention between servos on same bus\n '''\n def __init__( self, dev_name = '/dev/ttyUSB0', baudrate = 57600 ):\n self.dev_name = dev_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L28_C4", "label": "expression", "type": "expression", "loc": [28, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L27_C0", "vector": [8, 1, 0.1377, 0.0097, 1, 0.92, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' Class that manages serial port contention between servos on same bus\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L30_C4", "label": "__init__", "type": "function", "loc": [30, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L27_C0", "vector": [2, 1, 0.1473, 0.0097, 1, 0.92, 1.0, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "dev_name", "baudrate"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, dev_name = '/dev/ttyUSB0', baudrate = 57600 ):\n self.dev_name = dev_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L31_C8", "label": "self.dev_name =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L30_C4", "vector": [14, 2, 0.1498, 0.0048, 2, 0.32, 0.0, 517, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.dev_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dev_name = dev_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L35_C0", "label": "Robotis_Servo", "type": "class", "loc": [35, 114], "level": 0, "parent": null, "vector": [3, 0, 0.3599, 0.3865, 0, 0.66, 0.8889, 124, 0, 6, 0, 0, 134, 0, 17], "semantic": {"name": "Robotis_Servo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Robotis_Servo( Thread ):\n ''' Class to use a robotis RX-28 or RX-64 servo.\n '''\n def __init__(self, USB2Dynamixel, servo_id ):\n ''' USB2Dynamixel - USB2Dynamixel_Device object to handle serial port.\n Handles threadsafe operation for multiple servos\n servo_id - servo ids connected to USB2Dynamixel 1,2,3,4 ... (1 to 253)\n [0 is broadcast if memory serves]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L36_C4", "label": "expression", "type": "expression", "loc": [36, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L35_C0", "vector": [8, 1, 0.1763, 0.0097, 1, 0.83, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' Class to use a robotis RX-28 or RX-64 servo.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "label": "__init__", "type": "function", "loc": [38, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L35_C0", "vector": [2, 1, 0.244, 0.1256, 1, 0.83, 0.1667, 555, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "__init__", "arg_names": ["self", "USB2Dynamixel", "servo_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, USB2Dynamixel, servo_id ):\n ''' USB2Dynamixel - USB2Dynamixel_Device object to handle serial port.\n Handles threadsafe operation for multiple servos\n servo_id - servo ids connected to USB2Dynamixel 1,2,3,4 ... (1 to 253)\n [0 is broadcast if memory serves]\n '''\n Thread.__init__( self )\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L39_C8", "label": "expression", "type": "expression", "loc": [39, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "vector": [8, 2, 0.1981, 0.0242, 2, 0.63, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' USB2Dynamixel - USB2Dynamixel_Device object to handle serial port.\n Handles threadsafe operation for multiple servos\n servo_id - servo ids connected to USB2Dynamixel 1,2,3,4 ... (1 to 253)\n [0 is broadcast if memory serves]\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L44_C8", "label": "__init__()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "vector": [8, 2, 0.2126, 0.0048, 2, 0.63, 0.0909, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Thread.__init__( self )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Try_L46_C8", "label": "try", "type": "try", "loc": [46, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "vector": [7, 2, 0.2295, 0.0193, 2, 0.63, 0.1818, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node( 'RobotisServo_'+str(servo_id) )\n except rospy.ROSException:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L47_C12", "label": "init_node()", "type": "expression", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:Try_L46_C8", "vector": [8, 3, 0.2271, 0.0048, 3, 0.78, 0.0, 463, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node( 'RobotisServo_'+str(servo_id) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L51_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "vector": [14, 2, 0.2464, 0.0048, 2, 0.63, 0.2727, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L52_C8", "label": "self.is_moving_flag =", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "vector": [14, 2, 0.2512, 0.0048, 2, 0.63, 0.3636, 421, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_moving_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_moving_flag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L53_C8", "label": "self.curr_angle =", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "vector": [14, 2, 0.256, 0.0048, 2, 0.63, 0.4545, 106, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.curr_angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.curr_angle = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L54_C8", "label": "self.rate =", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "vector": [14, 2, 0.2609, 0.0048, 2, 0.63, 0.5455, 6, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.rate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rate = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L55_C8", "label": "self.des_angle =", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "vector": [14, 2, 0.2657, 0.0048, 2, 0.63, 0.6364, 880, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.des_angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.des_angle = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L56_C8", "label": "self.max_speed = radians()", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "vector": [14, 2, 0.2705, 0.0048, 2, 0.63, 0.7273, 434, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "self.max_speed", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " self.max_speed = math.radians( 50 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L59_C8", "label": "self.dyn =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "vector": [14, 2, 0.285, 0.0048, 2, 0.63, 0.8182, 868, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.dyn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dyn = USB2Dynamixel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L62_C8", "label": "self.servo_id =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "vector": [14, 2, 0.2995, 0.0048, 2, 0.63, 0.9091, 168, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.servo_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.servo_id = servo_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L63_C8", "label": "start()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "vector": [8, 2, 0.3043, 0.0048, 2, 0.63, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L65_C4", "label": "is_moving", "type": "function", "loc": [65, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L35_C0", "vector": [2, 1, 0.3213, 0.0193, 1, 0.83, 0.3333, 896, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_moving", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_moving(self):\n ''' returns True if servo is moving.\n '''\n return self.is_moving_flag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L66_C8", "label": "expression", "type": "expression", "loc": [66, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L65_C4", "vector": [8, 2, 0.3213, 0.0097, 2, 0.8, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' returns True if servo is moving.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Return_L68_C8", "label": "return", "type": "return", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L65_C4", "vector": [13, 2, 0.3285, 0.0048, 2, 0.8, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.is_moving_flag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L70_C4", "label": "write_address", "type": "function", "loc": [70, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L35_C0", "vector": [2, 1, 0.3502, 0.029, 1, 0.83, 0.5, 504, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "write_address", "arg_names": ["self", "address", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def write_address(self, address, data):\n ''' writes data at the address.\n data = [n1,n2 ...] list of numbers.\n return [n1,n2 ...] (list of return parameters)\n '''\n return "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L71_C8", "label": "expression", "type": "expression", "loc": [71, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L70_C4", "vector": [8, 2, 0.3502, 0.0193, 2, 0.7, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' writes data at the address.\n data = [n1,n2 ...] list of numbers.\n return [n1,n2 ...] (list of return parameters)\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Return_L75_C8", "label": "return", "type": "return", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L70_C4", "vector": [13, 2, 0.3623, 0.0048, 2, 0.7, 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_99373:FunctionDef_L77_C4", "label": "read_angle", "type": "function", "loc": [77, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L35_C0", "vector": [2, 1, 0.3792, 0.0193, 1, 0.83, 0.6667, 27, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "read_angle", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def read_angle(self):\n ''' returns the current servo angle (radians)\n '''\n return self.curr_angle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L78_C8", "label": "expression", "type": "expression", "loc": [78, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L77_C4", "vector": [8, 2, 0.3792, 0.0097, 2, 0.4, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' returns the current servo angle (radians)\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Return_L80_C8", "label": "return", "type": "return", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L77_C4", "vector": [13, 2, 0.3865, 0.0048, 2, 0.4, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.curr_angle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L82_C4", "label": "move_angle", "type": "function", "loc": [82, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L35_C0", "vector": [2, 1, 0.4155, 0.0435, 1, 0.83, 0.8333, 293, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": ["self", "ang", "angvel", "blocking"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_angle(self, ang, angvel=None, blocking=True):\n ''' move to angle (radians)\n '''\n self.rate = angvel\n self.des_angle = ang\n rospy.sleep( 0.05 )\n while blocking and self.is_moving_flag:\n rospy.sleep( 0.05 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L83_C8", "label": "expression", "type": "expression", "loc": [83, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L82_C4", "vector": [8, 2, 0.4034, 0.0097, 2, 0.78, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' move to angle (radians)\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L85_C8", "label": "self.rate =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L82_C4", "vector": [14, 2, 0.4106, 0.0048, 2, 0.78, 0.2, 6, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rate = angvel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L86_C8", "label": "self.des_angle =", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L82_C4", "vector": [14, 2, 0.4155, 0.0048, 2, 0.78, 0.4, 880, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.des_angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.des_angle = ang"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L87_C8", "label": "sleep()", "type": "expression", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L82_C4", "vector": [8, 2, 0.4203, 0.0048, 2, 0.78, 0.6, 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_99373:While_L88_C8", "label": "while", "type": "while", "loc": [88, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L82_C4", "vector": [5, 2, 0.4275, 0.0097, 2, 0.78, 0.8, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while blocking and self.is_moving_flag:\n rospy.sleep( 0.05 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L89_C12", "label": "sleep()", "type": "expression", "loc": [89, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:While_L88_C8", "vector": [8, 3, 0.43, 0.0048, 3, 0.3, 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.05 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Return_L90_C8", "label": "return", "type": "return", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L82_C4", "vector": [13, 2, 0.4348, 0.0048, 2, 0.78, 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_99373:FunctionDef_L92_C4", "label": "run", "type": "function", "loc": [92, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L35_C0", "vector": [2, 1, 0.4976, 0.1111, 1, 0.83, 1.0, 679, 0, 1, 0, 0, 0, 0, 10], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run( self ):\n #last_time = time.time()\n last_time = rospy.Time.now().to_nsec() * 10**-9\n while self.should_run and not rospy.is_shutdown():\n rospy.sleep( 1.0 / 30.0 )\n new_time = rospy.Time.now().to_nsec() * 10**-9\n curr = self.curr_angle\n des = self.des_angle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L94_C8", "label": "last_time =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L92_C4", "vector": [14, 2, 0.4541, 0.0048, 2, 0.02, 0.0, 211, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "last_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " last_time = rospy.Time.now().to_nsec() * 10**-9"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:While_L95_C8", "label": "while", "type": "while", "loc": [95, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L92_C4", "vector": [5, 2, 0.5048, 0.0966, 2, 0.02, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.should_run and not rospy.is_shutdown():\n rospy.sleep( 1.0 / 30.0 )\n new_time = rospy.Time.now().to_nsec() * 10**-9\n curr = self.curr_angle\n des = self.des_angle\n \n if curr == des:\n self.is_moving_flag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L96_C12", "label": "sleep()", "type": "expression", "loc": [96, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:While_L95_C8", "vector": [8, 3, 0.4638, 0.0048, 3, 0.77, 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.0 / 30.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L97_C12", "label": "new_time =", "type": "assigned_variable", "loc": [97, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:While_L95_C8", "vector": [14, 3, 0.4686, 0.0048, 3, 0.77, 0.2, 785, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "new_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_time = rospy.Time.now().to_nsec() * 10**-9"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L98_C12", "label": "curr =", "type": "assigned_variable", "loc": [98, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:While_L95_C8", "vector": [14, 3, 0.4734, 0.0048, 3, 0.77, 0.4, 503, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "curr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " curr = self.curr_angle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L99_C12", "label": "des =", "type": "assigned_variable", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:While_L95_C8", "vector": [14, 3, 0.4783, 0.0048, 3, 0.77, 0.6, 69, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "des", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " des = self.des_angle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L101_C12", "label": "if", "type": "if", "loc": [101, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:While_L95_C8", "vector": [4, 3, 0.5145, 0.058, 3, 0.77, 0.8, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if curr == des:\n self.is_moving_flag = False\n else:\n ang_diff = standard_rad( des - curr )\n move_mag = np.sign( ang_diff ) * (new_time - last_time) * self.rate\n new_ang = curr + move_mag\n if np.abs( ang_diff ) < np.abs( move_mag ):\n self.curr_angle = des"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L102_C16", "label": "self.is_moving_flag =", "type": "assigned_variable", "loc": [102, 102], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L101_C12", "vector": [14, 4, 0.4928, 0.0048, 4, 0.7, 0.0, 421, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_moving_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_moving_flag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L104_C16", "label": "ang_diff = standard_rad()", "type": "assigned_variable", "loc": [104, 104], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L101_C12", "vector": [14, 4, 0.5024, 0.0048, 4, 0.7, 0.25, 116, 3, 1, 0, 0, 54, 10, 1], "semantic": {"name": "ang_diff", "arg_names": [], "import_names": [], "rhs_call_name": "standard_rad", "annotation": ""}, "snippet": " ang_diff = standard_rad( des - curr )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L105_C16", "label": "move_mag =", "type": "assigned_variable", "loc": [105, 105], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L101_C12", "vector": [14, 4, 0.5072, 0.0048, 4, 0.7, 0.5, 8, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "move_mag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " move_mag = np.sign( ang_diff ) * (new_time - last_time) * self.rate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L106_C16", "label": "new_ang =", "type": "assigned_variable", "loc": [106, 106], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L101_C12", "vector": [14, 4, 0.5121, 0.0048, 4, 0.7, 0.75, 652, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "new_ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_ang = curr + move_mag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L107_C16", "label": "if", "type": "if", "loc": [107, 112], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L101_C12", "vector": [4, 4, 0.529, 0.029, 4, 0.7, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.abs( ang_diff ) < np.abs( move_mag ):\n self.curr_angle = des\n self.is_moving_flag = False\n else:\n self.is_moving_flag = True\n self.curr_angle = new_ang"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L108_C20", "label": "self.curr_angle =", "type": "assigned_variable", "loc": [108, 108], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L107_C16", "vector": [14, 5, 0.5217, 0.0048, 5, 0.91, 0.0, 106, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.curr_angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.curr_angle = des"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L109_C20", "label": "self.is_moving_flag =", "type": "assigned_variable", "loc": [109, 109], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L107_C16", "vector": [14, 5, 0.5266, 0.0048, 5, 0.91, 0.3333, 421, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_moving_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_moving_flag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L111_C20", "label": "self.is_moving_flag =", "type": "assigned_variable", "loc": [111, 111], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L107_C16", "vector": [14, 5, 0.5362, 0.0048, 5, 0.91, 0.6667, 421, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_moving_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_moving_flag = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L112_C20", "label": "self.curr_angle =", "type": "assigned_variable", "loc": [112, 112], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L107_C16", "vector": [14, 5, 0.5411, 0.0048, 5, 0.91, 1.0, 106, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.curr_angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.curr_angle = new_ang"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L114_C12", "label": "last_time =", "type": "assigned_variable", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:While_L95_C8", "vector": [14, 3, 0.5507, 0.0048, 3, 0.77, 1.0, 211, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "last_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " last_time = new_time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L117_C0", "label": "ROS_Robotis_Server", "type": "class", "loc": [117, 165], "level": 0, "parent": null, "vector": [3, 0, 0.6812, 0.2367, 0, 0.66, 0.9444, 693, 0, 5, 0, 0, 0, 0, 21], "semantic": {"name": "ROS_Robotis_Server", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ROS_Robotis_Server():\n # This class provides ROS services for a select few lib_robotis functions\n def __init__(self, servo = None, name = '' ):\n if servo == None:\n raise RuntimeError( 'ROS_Robotis_Servo: No servo specified for server.\\n' )\n\n self.servo = servo\n self.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L119_C4", "label": "__init__", "type": "function", "loc": [119, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L117_C0", "vector": [2, 1, 0.6329, 0.1208, 1, 0.65, 0.0, 555, 0, 3, 0, 0, 0, 0, 7], "semantic": {"name": "__init__", "arg_names": ["self", "servo", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, servo = None, name = '' ):\n if servo == None:\n raise RuntimeError( 'ROS_Robotis_Servo: No servo specified for server.\\n' )\n\n self.servo = servo\n self.name = name\n \n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L120_C8", "label": "if", "type": "if", "loc": [120, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L119_C4", "vector": [4, 2, 0.5821, 0.0097, 2, 0.56, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if servo == None:\n raise RuntimeError( 'ROS_Robotis_Servo: No servo specified for server.\\n' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L123_C8", "label": "self.servo =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L119_C4", "vector": [14, 2, 0.5942, 0.0048, 2, 0.56, 0.125, 172, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.servo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.servo = servo"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L124_C8", "label": "self.name =", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L119_C4", "vector": [14, 2, 0.599, 0.0048, 2, 0.56, 0.25, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Try_L126_C8", "label": "try", "type": "try", "loc": [126, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L119_C4", "vector": [7, 2, 0.6159, 0.0193, 2, 0.56, 0.375, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node( 'robotis_servo_' + self.name )\n except rospy.ROSException:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L127_C12", "label": "init_node()", "type": "expression", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:Try_L126_C8", "vector": [8, 3, 0.6135, 0.0048, 3, 0.48, 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( 'robotis_servo_' + self.name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L133_C8", "label": "logout()", "type": "expression", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L119_C4", "vector": [8, 2, 0.6425, 0.0048, 2, 0.56, 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( 'ROS_Robotis_Servo: Starting Server /robotis/servo_' + self.name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L134_C8", "label": "self.channel = Publisher()", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L119_C4", "vector": [14, 2, 0.6473, 0.0048, 2, 0.56, 0.625, 503, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.channel", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.channel = rospy.Publisher('/robotis/servo_' + self.name, Float64)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L136_C8", "label": "self.__service_ang = Service()", "type": "assigned_variable", "loc": [136, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L119_C4", "vector": [14, 2, 0.6594, 0.0097, 2, 0.56, 0.75, 182, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self.__service_ang", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self.__service_ang = rospy.Service('/robotis/servo_' + name + '_readangle',\n None_Float, self.__cb_readangle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L139_C8", "label": "self.__service_ismove = Service()", "type": "assigned_variable", "loc": [139, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L119_C4", "vector": [14, 2, 0.6739, 0.0097, 2, 0.56, 0.875, 913, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self.__service_ismove", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self.__service_ismove = rospy.Service('/robotis/servo_' + name + '_ismoving',\n None_Int32, self.__cb_ismoving)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L142_C8", "label": "self.__service_moveang = Service()", "type": "assigned_variable", "loc": [142, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L119_C4", "vector": [14, 2, 0.6884, 0.0097, 2, 0.56, 1.0, 463, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self.__service_moveang", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self.__service_moveang = rospy.Service('/robotis/servo_' + name + '_moveangle',\n MoveAng, self.__cb_moveangle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L145_C4", "label": "__cb_readangle", "type": "function", "loc": [145, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L117_C0", "vector": [2, 1, 0.7053, 0.0145, 1, 0.65, 0.25, 754, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "__cb_readangle", "arg_names": ["self", "request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __cb_readangle( self, request ):\n ang = self.update_server()\n return None_FloatResponse( ang )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L146_C8", "label": "ang = update_server()", "type": "assigned_variable", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L145_C4", "vector": [14, 2, 0.7053, 0.0048, 2, 0.53, 0.0, 762, 3, 0, 0, 0, 735, 10, 1], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "update_server", "annotation": ""}, "snippet": " ang = self.update_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Return_L147_C8", "label": "return", "type": "return", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L145_C4", "vector": [13, 2, 0.7101, 0.0048, 2, 0.53, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None_FloatResponse( ang )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L149_C4", "label": "__cb_ismoving", "type": "function", "loc": [149, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L117_C0", "vector": [2, 1, 0.7246, 0.0145, 1, 0.65, 0.5, 268, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "__cb_ismoving", "arg_names": ["self", "request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __cb_ismoving( self, request ):\n status = self.servo.is_moving()\n return None_Int32Response( int(status) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L150_C8", "label": "status = is_moving()", "type": "assigned_variable", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L149_C4", "vector": [14, 2, 0.7246, 0.0048, 2, 0.56, 0.0, 699, 3, 0, 0, 0, 896, 10, 1], "semantic": {"name": "status", "arg_names": [], "import_names": [], "rhs_call_name": "is_moving", "annotation": ""}, "snippet": " status = self.servo.is_moving()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Return_L151_C8", "label": "return", "type": "return", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L149_C4", "vector": [13, 2, 0.7295, 0.0048, 2, 0.56, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None_Int32Response( int(status) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L153_C4", "label": "__cb_moveangle", "type": "function", "loc": [153, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L117_C0", "vector": [2, 1, 0.756, 0.0386, 1, 0.65, 0.75, 718, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "__cb_moveangle", "arg_names": ["self", "request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __cb_moveangle( self, request ):\n rospy.logout( 'RobotisServo: Move %s to angle %3.2f' % (self.name, math.degrees( request.angle )))\n ang = request.angle\n angvel = request.angvel\n blocking = bool( request.blocking )\n self.servo.move_angle( ang, angvel, blocking )\n rospy.logout( 'RobotisServo: Move %s Done' % (self.name))\n return MoveAngResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L154_C8", "label": "logout()", "type": "expression", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L153_C4", "vector": [8, 2, 0.744, 0.0048, 2, 0.65, 0.0, 525, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'RobotisServo: Move %s to angle %3.2f' % (self.name, math.degrees( request.angle )))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L155_C8", "label": "ang =", "type": "assigned_variable", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L153_C4", "vector": [14, 2, 0.7488, 0.0048, 2, 0.65, 0.1667, 762, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ang = request.angle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L156_C8", "label": "angvel =", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L153_C4", "vector": [14, 2, 0.7536, 0.0048, 2, 0.65, 0.3333, 569, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "angvel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " angvel = request.angvel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L157_C8", "label": "blocking = bool()", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L153_C4", "vector": [14, 2, 0.7585, 0.0048, 2, 0.65, 0.5, 571, 3, 1, 0, 0, 337, 10, 1], "semantic": {"name": "blocking", "arg_names": [], "import_names": [], "rhs_call_name": "bool", "annotation": ""}, "snippet": " blocking = bool( request.blocking )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L158_C8", "label": "move_angle()", "type": "expression", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L153_C4", "vector": [8, 2, 0.7633, 0.0048, 2, 0.65, 0.6667, 293, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.servo.move_angle( ang, angvel, blocking )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L159_C8", "label": "logout()", "type": "expression", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L153_C4", "vector": [8, 2, 0.7681, 0.0048, 2, 0.65, 0.8333, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'RobotisServo: Move %s Done' % (self.name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Return_L160_C8", "label": "return", "type": "return", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L153_C4", "vector": [13, 2, 0.7729, 0.0048, 2, 0.65, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return MoveAngResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L162_C4", "label": "update_server", "type": "function", "loc": [162, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L117_C0", "vector": [2, 1, 0.7899, 0.0193, 1, 0.65, 1.0, 735, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "update_server", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update_server(self):\n ang = self.servo.read_angle()\n self.channel.publish( Float64(ang) )\n return ang"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L163_C8", "label": "ang = read_angle()", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L162_C4", "vector": [14, 2, 0.7874, 0.0048, 2, 0.19, 0.0, 762, 3, 0, 0, 0, 27, 10, 1], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "read_angle", "annotation": ""}, "snippet": " ang = self.servo.read_angle()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L164_C8", "label": "publish()", "type": "expression", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L162_C4", "vector": [8, 2, 0.7923, 0.0048, 2, 0.19, 0.5, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.channel.publish( Float64(ang) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Return_L165_C8", "label": "return", "type": "return", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L162_C4", "vector": [13, 2, 0.7971, 0.0048, 2, 0.19, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ang"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L168_C0", "label": "ROS_Robotis_Poller", "type": "class", "loc": [168, 201], "level": 0, "parent": null, "vector": [3, 0, 0.8913, 0.1643, 0, 0.66, 1.0, 343, 0, 3, 0, 0, 134, 0, 14], "semantic": {"name": "ROS_Robotis_Poller", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ROS_Robotis_Poller( Thread ):\n # A utility class that will setup and poll a number of ROS_Robotis_Servos on one USB2Dynamixel\n def __init__( self, dev_name, ids, names ):\n Thread.__init__(self)\n\n self.should_run = True\n self.dev_name = dev_name\n self.ids = ids"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L170_C4", "label": "__init__", "type": "function", "loc": [170, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L168_C0", "vector": [2, 1, 0.8623, 0.087, 1, 0.92, 0.0, 555, 0, 4, 0, 0, 0, 0, 8], "semantic": {"name": "__init__", "arg_names": ["self", "dev_name", "ids", "names"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, dev_name, ids, names ):\n Thread.__init__(self)\n\n self.should_run = True\n self.dev_name = dev_name\n self.ids = ids\n self.names = names\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L171_C8", "label": "__init__()", "type": "expression", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L170_C4", "vector": [8, 2, 0.8261, 0.0048, 2, 0.51, 0.0, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Thread.__init__(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L173_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L170_C4", "vector": [14, 2, 0.8357, 0.0048, 2, 0.51, 0.1, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L174_C8", "label": "self.dev_name =", "type": "assigned_variable", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L170_C4", "vector": [14, 2, 0.8406, 0.0048, 2, 0.51, 0.2, 517, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.dev_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dev_name = dev_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L175_C8", "label": "self.ids =", "type": "assigned_variable", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L170_C4", "vector": [14, 2, 0.8454, 0.0048, 2, 0.51, 0.3, 806, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.ids", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ids = ids"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L176_C8", "label": "self.names =", "type": "assigned_variable", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L170_C4", "vector": [14, 2, 0.8502, 0.0048, 2, 0.51, 0.4, 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_99373:For_L178_C8", "label": "for n", "type": "for", "loc": [178, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L170_C4", "vector": [6, 2, 0.8623, 0.0097, 2, 0.51, 0.5, 773, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for n in self.names:\n rospy.logout( 'ROS_Robotis_Servo: Starting Up /robotis/servo_' + n + ' on ' + self.dev_name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L179_C12", "label": "logout()", "type": "expression", "loc": [179, 179], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:For_L178_C8", "vector": [8, 3, 0.8647, 0.0048, 3, 0.04, 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( 'ROS_Robotis_Servo: Starting Up /robotis/servo_' + n + ' on ' + self.dev_name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L181_C8", "label": "self.dyn = USB2Dynamixel_Device()", "type": "assigned_variable", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L170_C4", "vector": [14, 2, 0.8744, 0.0048, 2, 0.51, 0.6, 868, 3, 1, 0, 0, 935, 10, 1], "semantic": {"name": "self.dyn", "arg_names": [], "import_names": [], "rhs_call_name": "USB2Dynamixel_Device", "annotation": ""}, "snippet": " self.dyn = USB2Dynamixel_Device( self.dev_name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L182_C8", "label": "self.servos =", "type": "assigned_variable", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L170_C4", "vector": [14, 2, 0.8792, 0.0048, 2, 0.51, 0.7, 978, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.servos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.servos = [ Robotis_Servo( self.dyn, i ) for i in self.ids ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L183_C8", "label": "self.ros_servers =", "type": "assigned_variable", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L170_C4", "vector": [14, 2, 0.8841, 0.0048, 2, 0.51, 0.8, 153, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "self.ros_servers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ros_servers = [ ROS_Robotis_Server( s, n ) for s,n in zip( self.servos, self.names ) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L185_C8", "label": "logout()", "type": "expression", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L170_C4", "vector": [8, 2, 0.8937, 0.0048, 2, 0.51, 0.9, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'ROS_Robotis_Servo: Setup Complete on ' + self.dev_name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L187_C8", "label": "start()", "type": "expression", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L170_C4", "vector": [8, 2, 0.9034, 0.0048, 2, 0.51, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L189_C4", "label": "run", "type": "function", "loc": [189, 195], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L168_C0", "vector": [2, 1, 0.9275, 0.0338, 1, 0.92, 0.5, 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 self.should_run:\n [ s.update_server() for s in self.ros_servers ]\n rospy.sleep(0.001)\n\n for n in self.names:\n rospy.logout( 'ROS_Robotis_Servo: Shutting Down /robotis/servo_' + n + ' on ' + self.dev_name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:While_L190_C8", "label": "while", "type": "while", "loc": [190, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L189_C4", "vector": [5, 2, 0.9227, 0.0145, 2, 0.69, 0.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.should_run:\n [ s.update_server() for s in self.ros_servers ]\n rospy.sleep(0.001)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L191_C12", "label": "expression", "type": "expression", "loc": [191, 191], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:While_L190_C8", "vector": [8, 3, 0.9227, 0.0048, 3, 0.74, 0.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " [ s.update_server() for s in self.ros_servers ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L192_C12", "label": "sleep()", "type": "expression", "loc": [192, 192], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:While_L190_C8", "vector": [8, 3, 0.9275, 0.0048, 3, 0.74, 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.001)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:For_L194_C8", "label": "for n", "type": "for", "loc": [194, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L189_C4", "vector": [6, 2, 0.9396, 0.0097, 2, 0.69, 1.0, 773, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for n in self.names:\n rospy.logout( 'ROS_Robotis_Servo: Shutting Down /robotis/servo_' + n + ' on ' + self.dev_name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L195_C12", "label": "logout()", "type": "expression", "loc": [195, 195], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:For_L194_C8", "vector": [8, 3, 0.942, 0.0048, 3, 0.5, 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( 'ROS_Robotis_Servo: Shutting Down /robotis/servo_' + n + ' on ' + self.dev_name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L197_C4", "label": "stop", "type": "function", "loc": [197, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L168_C0", "vector": [2, 1, 0.9614, 0.0242, 1, 0.92, 1.0, 343, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "stop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop(self):\n self.should_run = False\n self.join(3)\n if (self.isAlive()):\n raise RuntimeError(\"ROS_Robotis_Servo: unable to stop thread\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L198_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L197_C4", "vector": [14, 2, 0.9565, 0.0048, 2, 0.95, 0.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L199_C8", "label": "join()", "type": "expression", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L197_C4", "vector": [8, 2, 0.9614, 0.0048, 2, 0.95, 0.5, 933, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.join(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L200_C8", "label": "if", "type": "if", "loc": [200, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L197_C4", "vector": [4, 2, 0.9686, 0.0097, 2, 0.95, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.isAlive()):\n raise RuntimeError(\"ROS_Robotis_Servo: unable to stop thread\")"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Return_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Return_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Try_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:Try_L46_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Return_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Return_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Return_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:While_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:While_L88_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Return_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:While_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:While_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L96_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:While_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L97_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:While_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:While_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:While_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L101_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L102_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L101_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L104_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L101_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L105_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L101_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L106_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L101_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L107_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L107_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L108_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L107_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L109_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L107_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L111_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L107_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L112_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:While_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L117_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Try_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:Try_L126_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L117_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Return_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L117_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Return_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L117_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Return_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L117_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Return_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L168_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:For_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:For_L178_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L179_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L168_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:While_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:While_L190_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L191_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:While_L190_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L192_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:For_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:For_L194_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L195_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:ClassDef_L168_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L197_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L197_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L197_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:Expr_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99373:FunctionDef_L197_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99373:If_L200_C8"}]
#! /usr/bin/python import roslib; roslib.load_manifest('hrl_pr2_kinematics_tutorials') roslib.load_manifest('rfid_people_following') roslib.load_manifest('hrl_lib') roslib.load_manifest('std_srvs') import rospy import hrl_pr2_kinematics_tutorials.hrl_pr2 as hrl_pr2 import hrl_lib.transforms as tr import rfid_people_following.tactile_sensors as tsen from rfid_people_following.srv import FloatFloatFloatFloat_Int32 as arm_srv from rfid_people_following.srv import HandoffSrv import numpy as np, math import os import time class HandoffNode(): def __init__( self ): rospy.init_node( 'handoff', anonymous = True ) rospy.logout( 'handoff_node: Have run hrl_pr2_gains/change_gains.sh yet?' ) self.robot = hrl_pr2.HRL_PR2() if not (os.environ.has_key('ROBOT') and os.environ['ROBOT'] == 'sim'): self.ts = tsen.TactileSensor() self.arm = 'right_arm' self.start_ja = [0.040304940763152608, 1.2398003444166741, -1.2204088251845415, -1.9324078526157087, -31.197472992401149, -1.7430222641585842, -1.5358378047038517] #self.target_ja = [0.35891507126604916, 0.13778228113494312, -0.01277662779292843, -1.4992538841561938, -28.605807802842136, -0.96590944225972863, -3.0950669743130161] self.target_ja = [0.0818, 0.377, -0.860, -2.144, -3.975, -1.479, 3.907] self._sh = rospy.Service( '/rfid_handoff/handoff' , HandoffSrv, self.handoff ) self._si = rospy.Service( '/rfid_handoff/initialize' , HandoffSrv, self.initialize ) self._sj = rospy.Service( '/rfid_handoff/handoff_pos' , arm_srv, self.handoff_pos ) self._swave = rospy.Service( '/rfid_handoff/wave' , HandoffSrv, self.wave ) # self.initialize() # Prefer to do this manually... (rosservice call /rfid_handoff/initialize) rospy.logout( 'handoff_node: Waiting for service calls.' ) def initialize( self, msg = None ): rospy.logout( 'handoff_node: Initializing. Hand me an object!' ) # Put into handoff position, ready to accept object self.robot.set_jointangles( self.arm, self.target_ja, 3.0 ) rospy.sleep( rospy.Duration( 3.0 )) self.robot.open_gripper( self.arm ) rospy.sleep( rospy.Duration( 2.0 )) self.stow() return True def wave( self, msg = None ): wave_a = [0.0131, 0.325, -0.832, -1.762,-6.511, -0.191, 0.162] wave_b = [-0.180, 0.034, 0.108, -1.295, -6.224, -0.383, 0.119] self.robot.set_jointangles( self.arm, wave_a, 2.0 ) rospy.sleep( rospy.Duration( 2.0 )) self.robot.set_jointangles( self.arm, wave_b, 1.0 ) rospy.sleep( rospy.Duration( 1.0 )) self.robot.set_jointangles( self.arm, wave_a, 1.0 ) rospy.sleep( rospy.Duration( 1.0 )) self.robot.set_jointangles( self.arm, wave_b, 1.0 ) rospy.sleep( rospy.Duration( 1.0 )) self.robot.set_jointangles( self.arm, wave_a, 1.0 ) rospy.sleep( rospy.Duration( 1.0 )) self.robot.set_jointangles( self.arm, self.start_ja, 3.0 ) rospy.sleep( rospy.Duration( 3.0 )) return True def stow( self ): # Grab object self.robot.close_gripper( self.arm ) rospy.sleep( rospy.Duration( 2.0 )) # Stow self.robot.set_jointangles( self.arm, self.start_ja, 3.0 ) rospy.sleep( rospy.Duration( 3.0 )) def open( self ): self.robot.open_gripper( self.arm ) rospy.sleep( rospy.Duration( 2.0 )) def close( self ): self.robot.close_gripper( self.arm ) rospy.sleep( rospy.Duration( 2.0 )) def handoff( self, msg = None ): # Put into handoff position. self.robot.set_jointangles( self.arm, self.target_ja, 3.0 ) rospy.sleep( rospy.Duration( 3.0 )) # Tactile Sensor detector rospy.sleep( rospy.Duration( 0.5 )) self.ts.thresh_detect( 3000 ) # Release object self.robot.open_gripper( self.arm ) rospy.sleep( rospy.Duration( 2.0 )) # Stow self.robot.set_jointangles( self.arm, self.start_ja, 3.0 ) rospy.sleep( rospy.Duration( 3.0 )) return True def handoff_pos( self, msg ): #pos = np.matrix([0.6977, -0.03622, 0.2015]).T #ang = tr.Rx(math.radians(0.)) print msg pos = np.matrix([ msg.x, msg.y, msg.z ]).T ang = tr.Rx( msg.ang ) q = [0, 0, 0, 0, 0, 0, 0] j = self.robot.IK('right_arm', pos, ang, self.target_ja) #j = self.robot.IK('right_arm', pos, ang, q) self.robot.set_jointangles( 'right_arm', j, 3.0 ) # Tactile Sensor detector rospy.sleep( rospy.Duration( 0.5 )) self.ts.thresh_detect( 3000 ) # Release object self.robot.open_gripper( self.arm ) rospy.sleep( rospy.Duration( 2.0 )) # Stow self.robot.set_jointangles( self.arm, self.start_ja, 3.0 ) rospy.sleep( rospy.Duration( 3.0 )) return True if __name__ == '__main__': hon = HandoffNode() #hon.handoff_pos() rospy.spin() #ho.handoff()
ajibawa-2023/Python-Code-Large/train/row_99374
91
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_99374:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0207, 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; "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0276, 0.0069, 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('hrl_pr2_kinematics_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0345, 0.0069, 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('rfid_people_following')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0414, 0.0069, 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('hrl_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0483, 0.0069, 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('std_srvs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Import_L8_C0", "label": "rospy import rospy", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0552, 0.0069, 0, 0.66, 0.3333, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Import_L10_C0", "label": "hrl_pr2_kinematics_tutorials.hrl_pr2 import hrl_pr2", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.069, 0.0069, 0, 0.66, 0.4, 197, 0, 1, 0, 0, 197, 0, 0], "semantic": {"name": "hrl_pr2_kinematics_tutorials.hrl_pr2", "arg_names": [], "import_names": ["hrl_pr2"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_pr2_kinematics_tutorials.hrl_pr2 as hrl_pr2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Import_L11_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0759, 0.0069, 0, 0.66, 0.4667, 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_99374:Import_L12_C0", "label": "rfid_people_following.tactile_sensors import tsen", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0828, 0.0069, 0, 0.66, 0.5333, 121, 0, 1, 0, 0, 121, 0, 0], "semantic": {"name": "rfid_people_following.tactile_sensors", "arg_names": [], "import_names": ["tsen"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rfid_people_following.tactile_sensors as tsen"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:ImportFrom_L13_C0", "label": "from rfid_people_following.srv import arm_srv", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0897, 0.0069, 0, 0.66, 0.6, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["arm_srv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import FloatFloatFloatFloat_Int32 as arm_srv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:ImportFrom_L14_C0", "label": "from rfid_people_following.srv import HandoffSrv", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0966, 0.0069, 0, 0.66, 0.6667, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["HandoffSrv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import HandoffSrv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Import_L16_C0", "label": "numpy import np, math", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1103, 0.0069, 0, 0.66, 0.7333, 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_99374:Import_L17_C0", "label": "os import os", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.1172, 0.0069, 0, 0.66, 0.8, 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_99374:Import_L18_C0", "label": "time import time", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1241, 0.0069, 0, 0.66, 0.8667, 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_99374:ClassDef_L20_C0", "label": "HandoffNode", "type": "class", "loc": [20, 135], "level": 0, "parent": null, "vector": [3, 0, 0.5345, 0.8, 0, 0.66, 0.9333, 436, 0, 8, 0, 0, 0, 0, 74], "semantic": {"name": "HandoffNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class HandoffNode():\n def __init__( self ):\n rospy.init_node( 'handoff', anonymous = True )\n rospy.logout( 'handoff_node: Have run hrl_pr2_gains/change_gains.sh yet?' )\n\n self.robot = hrl_pr2.HRL_PR2()\n if not (os.environ.has_key('ROBOT') and os.environ['ROBOT'] == 'sim'):\n self.ts = tsen.TactileSensor()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "label": "__init__", "type": "function", "loc": [21, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:ClassDef_L20_C0", "vector": [2, 1, 0.2103, 0.1379, 1, 0.16, 0.0, 555, 0, 1, 0, 0, 0, 0, 10], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self ):\n rospy.init_node( 'handoff', anonymous = True )\n rospy.logout( 'handoff_node: Have run hrl_pr2_gains/change_gains.sh yet?' )\n\n self.robot = hrl_pr2.HRL_PR2()\n if not (os.environ.has_key('ROBOT') and os.environ['ROBOT'] == 'sim'):\n self.ts = tsen.TactileSensor()\n self.arm = 'right_arm'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L22_C8", "label": "init_node()", "type": "expression", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "vector": [8, 2, 0.1517, 0.0069, 2, 0.7, 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( 'handoff', anonymous = True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L23_C8", "label": "logout()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "vector": [8, 2, 0.1586, 0.0069, 2, 0.7, 0.0909, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'handoff_node: Have run hrl_pr2_gains/change_gains.sh yet?' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L25_C8", "label": "self.robot = HRL_PR2()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "vector": [14, 2, 0.1724, 0.0069, 2, 0.7, 0.1818, 879, 3, 0, 0, 0, 142, 10, 1], "semantic": {"name": "self.robot", "arg_names": [], "import_names": [], "rhs_call_name": "HRL_PR2", "annotation": ""}, "snippet": " self.robot = hrl_pr2.HRL_PR2()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:If_L26_C8", "label": "if", "type": "if", "loc": [26, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "vector": [4, 2, 0.1828, 0.0138, 2, 0.7, 0.2727, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (os.environ.has_key('ROBOT') and os.environ['ROBOT'] == 'sim'):\n self.ts = tsen.TactileSensor()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L27_C12", "label": "self.ts = TactileSensor()", "type": "assigned_variable", "loc": [27, 27], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:If_L26_C8", "vector": [14, 3, 0.1862, 0.0069, 3, 0.79, 0.0, 134, 3, 0, 0, 0, 495, 10, 1], "semantic": {"name": "self.ts", "arg_names": [], "import_names": [], "rhs_call_name": "TactileSensor", "annotation": ""}, "snippet": " self.ts = tsen.TactileSensor()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L28_C8", "label": "self.arm =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "vector": [14, 2, 0.1931, 0.0069, 2, 0.7, 0.3636, 720, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm = 'right_arm'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L30_C8", "label": "self.start_ja =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "vector": [14, 2, 0.2069, 0.0069, 2, 0.7, 0.4545, 804, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.start_ja", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.start_ja = [0.040304940763152608, 1.2398003444166741, -1.2204088251845415, -1.9324078526157087, -31.197472992401149, -1.7430222641585842, -1.5358378047038517]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L32_C8", "label": "self.target_ja =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "vector": [14, 2, 0.2207, 0.0069, 2, 0.7, 0.5455, 276, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.target_ja", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.target_ja = [0.0818, 0.377, -0.860, -2.144, -3.975, -1.479, 3.907]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L34_C8", "label": "self._sh = Service()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "vector": [14, 2, 0.2345, 0.0069, 2, 0.7, 0.6364, 573, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self._sh", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self._sh = rospy.Service( '/rfid_handoff/handoff' , HandoffSrv, self.handoff )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L35_C8", "label": "self._si = Service()", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "vector": [14, 2, 0.2414, 0.0069, 2, 0.7, 0.7273, 729, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self._si", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self._si = rospy.Service( '/rfid_handoff/initialize' , HandoffSrv, self.initialize )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L36_C8", "label": "self._sj = Service()", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "vector": [14, 2, 0.2483, 0.0069, 2, 0.7, 0.8182, 928, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self._sj", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self._sj = rospy.Service( '/rfid_handoff/handoff_pos' , arm_srv, self.handoff_pos )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L37_C8", "label": "self._swave = Service()", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "vector": [14, 2, 0.2552, 0.0069, 2, 0.7, 0.9091, 184, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self._swave", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self._swave = rospy.Service( '/rfid_handoff/wave' , HandoffSrv, self.wave )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L40_C8", "label": "logout()", "type": "expression", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "vector": [8, 2, 0.2759, 0.0069, 2, 0.7, 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( 'handoff_node: Waiting for service calls.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L42_C4", "label": "initialize", "type": "function", "loc": [42, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:ClassDef_L20_C0", "vector": [2, 1, 0.3241, 0.0759, 1, 0.16, 0.1429, 393, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "initialize", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def initialize( self, msg = None ):\n rospy.logout( 'handoff_node: Initializing. Hand me an object!' )\n\n # Put into handoff position, ready to accept object\n self.robot.set_jointangles( self.arm, self.target_ja, 3.0 )\n rospy.sleep( rospy.Duration( 3.0 ))\n self.robot.open_gripper( self.arm )\n rospy.sleep( rospy.Duration( 2.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L43_C8", "label": "logout()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L42_C4", "vector": [8, 2, 0.2966, 0.0069, 2, 0.6, 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( 'handoff_node: Initializing. Hand me an object!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L46_C8", "label": "set_jointangles()", "type": "expression", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L42_C4", "vector": [8, 2, 0.3172, 0.0069, 2, 0.6, 0.1667, 240, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_jointangles", "arg_names": [], "import_names": [], "rhs_call_name": "set_jointangles", "annotation": ""}, "snippet": " self.robot.set_jointangles( self.arm, self.target_ja, 3.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L47_C8", "label": "sleep()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L42_C4", "vector": [8, 2, 0.3241, 0.0069, 2, 0.6, 0.3333, 476, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( rospy.Duration( 3.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L48_C8", "label": "open_gripper()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L42_C4", "vector": [8, 2, 0.331, 0.0069, 2, 0.6, 0.5, 833, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "open_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "open_gripper", "annotation": ""}, "snippet": " self.robot.open_gripper( self.arm )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L49_C8", "label": "sleep()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L42_C4", "vector": [8, 2, 0.3379, 0.0069, 2, 0.6, 0.6667, 476, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( rospy.Duration( 2.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L51_C8", "label": "stow()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L42_C4", "vector": [8, 2, 0.3517, 0.0069, 2, 0.6, 0.8333, 817, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stow", "arg_names": [], "import_names": [], "rhs_call_name": "stow", "annotation": ""}, "snippet": " self.stow()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Return_L52_C8", "label": "return", "type": "return", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L42_C4", "vector": [13, 2, 0.3586, 0.0069, 2, 0.6, 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_99374:FunctionDef_L54_C4", "label": "wave", "type": "function", "loc": [54, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:ClassDef_L20_C0", "vector": [2, 1, 0.4241, 0.1103, 1, 0.16, 0.2857, 906, 0, 2, 1, 0, 0, 0, 18], "semantic": {"name": "wave", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def wave( self, msg = None ):\n wave_a = [0.0131, 0.325, -0.832, -1.762,-6.511, -0.191, 0.162]\n wave_b = [-0.180, 0.034, 0.108, -1.295, -6.224, -0.383, 0.119]\n self.robot.set_jointangles( self.arm, wave_a, 2.0 )\n rospy.sleep( rospy.Duration( 2.0 ))\n self.robot.set_jointangles( self.arm, wave_b, 1.0 )\n rospy.sleep( rospy.Duration( 1.0 ))\n self.robot.set_jointangles( self.arm, wave_a, 1.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L55_C8", "label": "wave_a =", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "vector": [14, 2, 0.3793, 0.0069, 2, 0.88, 0.0, 688, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "wave_a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wave_a = [0.0131, 0.325, -0.832, -1.762,-6.511, -0.191, 0.162]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L56_C8", "label": "wave_b =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "vector": [14, 2, 0.3862, 0.0069, 2, 0.88, 0.0714, 905, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "wave_b", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wave_b = [-0.180, 0.034, 0.108, -1.295, -6.224, -0.383, 0.119]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L57_C8", "label": "set_jointangles()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "vector": [8, 2, 0.3931, 0.0069, 2, 0.88, 0.1429, 240, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_jointangles", "arg_names": [], "import_names": [], "rhs_call_name": "set_jointangles", "annotation": ""}, "snippet": " self.robot.set_jointangles( self.arm, wave_a, 2.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L58_C8", "label": "sleep()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "vector": [8, 2, 0.4, 0.0069, 2, 0.88, 0.2143, 476, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( rospy.Duration( 2.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L59_C8", "label": "set_jointangles()", "type": "expression", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "vector": [8, 2, 0.4069, 0.0069, 2, 0.88, 0.2857, 240, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_jointangles", "arg_names": [], "import_names": [], "rhs_call_name": "set_jointangles", "annotation": ""}, "snippet": " self.robot.set_jointangles( self.arm, wave_b, 1.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L60_C8", "label": "sleep()", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "vector": [8, 2, 0.4138, 0.0069, 2, 0.88, 0.3571, 476, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( rospy.Duration( 1.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L61_C8", "label": "set_jointangles()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "vector": [8, 2, 0.4207, 0.0069, 2, 0.88, 0.4286, 240, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_jointangles", "arg_names": [], "import_names": [], "rhs_call_name": "set_jointangles", "annotation": ""}, "snippet": " self.robot.set_jointangles( self.arm, wave_a, 1.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L62_C8", "label": "sleep()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "vector": [8, 2, 0.4276, 0.0069, 2, 0.88, 0.5, 476, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( rospy.Duration( 1.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L63_C8", "label": "set_jointangles()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "vector": [8, 2, 0.4345, 0.0069, 2, 0.88, 0.5714, 240, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_jointangles", "arg_names": [], "import_names": [], "rhs_call_name": "set_jointangles", "annotation": ""}, "snippet": " self.robot.set_jointangles( self.arm, wave_b, 1.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L64_C8", "label": "sleep()", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "vector": [8, 2, 0.4414, 0.0069, 2, 0.88, 0.6429, 476, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( rospy.Duration( 1.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L65_C8", "label": "set_jointangles()", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "vector": [8, 2, 0.4483, 0.0069, 2, 0.88, 0.7143, 240, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_jointangles", "arg_names": [], "import_names": [], "rhs_call_name": "set_jointangles", "annotation": ""}, "snippet": " self.robot.set_jointangles( self.arm, wave_a, 1.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L66_C8", "label": "sleep()", "type": "expression", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "vector": [8, 2, 0.4552, 0.0069, 2, 0.88, 0.7857, 476, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( rospy.Duration( 1.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L67_C8", "label": "set_jointangles()", "type": "expression", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "vector": [8, 2, 0.4621, 0.0069, 2, 0.88, 0.8571, 240, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_jointangles", "arg_names": [], "import_names": [], "rhs_call_name": "set_jointangles", "annotation": ""}, "snippet": " self.robot.set_jointangles( self.arm, self.start_ja, 3.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L68_C8", "label": "sleep()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "vector": [8, 2, 0.469, 0.0069, 2, 0.88, 0.9286, 476, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( rospy.Duration( 3.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Return_L69_C8", "label": "return", "type": "return", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "vector": [13, 2, 0.4759, 0.0069, 2, 0.88, 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_99374:FunctionDef_L73_C4", "label": "stow", "type": "function", "loc": [73, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:ClassDef_L20_C0", "vector": [2, 1, 0.5276, 0.0552, 1, 0.16, 0.4286, 817, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "stow", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stow( self ):\n # Grab object\n self.robot.close_gripper( self.arm )\n rospy.sleep( rospy.Duration( 2.0 ))\n\n # Stow\n self.robot.set_jointangles( self.arm, self.start_ja, 3.0 )\n rospy.sleep( rospy.Duration( 3.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L75_C8", "label": "close_gripper()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L73_C4", "vector": [8, 2, 0.5172, 0.0069, 2, 0.64, 0.0, 807, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "close_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "close_gripper", "annotation": ""}, "snippet": " self.robot.close_gripper( self.arm )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L76_C8", "label": "sleep()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L73_C4", "vector": [8, 2, 0.5241, 0.0069, 2, 0.64, 0.3333, 476, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( rospy.Duration( 2.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L79_C8", "label": "set_jointangles()", "type": "expression", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L73_C4", "vector": [8, 2, 0.5448, 0.0069, 2, 0.64, 0.6667, 240, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_jointangles", "arg_names": [], "import_names": [], "rhs_call_name": "set_jointangles", "annotation": ""}, "snippet": " self.robot.set_jointangles( self.arm, self.start_ja, 3.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L80_C8", "label": "sleep()", "type": "expression", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L73_C4", "vector": [8, 2, 0.5517, 0.0069, 2, 0.64, 1.0, 476, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( rospy.Duration( 3.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L83_C4", "label": "open", "type": "function", "loc": [83, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:ClassDef_L20_C0", "vector": [2, 1, 0.5793, 0.0207, 1, 0.16, 0.5714, 693, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "open", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def open( self ):\n self.robot.open_gripper( self.arm )\n rospy.sleep( rospy.Duration( 2.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L84_C8", "label": "open_gripper()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L83_C4", "vector": [8, 2, 0.5793, 0.0069, 2, 0.19, 0.0, 833, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "open_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "open_gripper", "annotation": ""}, "snippet": " self.robot.open_gripper( self.arm )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L85_C8", "label": "sleep()", "type": "expression", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L83_C4", "vector": [8, 2, 0.5862, 0.0069, 2, 0.19, 1.0, 476, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( rospy.Duration( 2.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L88_C4", "label": "close", "type": "function", "loc": [88, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:ClassDef_L20_C0", "vector": [2, 1, 0.6138, 0.0207, 1, 0.16, 0.7143, 77, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "close", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close( self ):\n self.robot.close_gripper( self.arm )\n rospy.sleep( rospy.Duration( 2.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L89_C8", "label": "close_gripper()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L88_C4", "vector": [8, 2, 0.6138, 0.0069, 2, 0.22, 0.0, 807, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "close_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "close_gripper", "annotation": ""}, "snippet": " self.robot.close_gripper( self.arm )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L90_C8", "label": "sleep()", "type": "expression", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L88_C4", "vector": [8, 2, 0.6207, 0.0069, 2, 0.22, 1.0, 476, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( rospy.Duration( 2.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L93_C4", "label": "handoff", "type": "function", "loc": [93, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:ClassDef_L20_C0", "vector": [2, 1, 0.6966, 0.1172, 1, 0.16, 0.8571, 798, 0, 2, 1, 0, 0, 0, 12], "semantic": {"name": "handoff", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def handoff( self, msg = None ):\n # Put into handoff position.\n self.robot.set_jointangles( self.arm, self.target_ja, 3.0 )\n rospy.sleep( rospy.Duration( 3.0 ))\n\n # Tactile Sensor detector\n rospy.sleep( rospy.Duration( 0.5 ))\n self.ts.thresh_detect( 3000 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L95_C8", "label": "set_jointangles()", "type": "expression", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L93_C4", "vector": [8, 2, 0.6552, 0.0069, 2, 0.23, 0.0, 240, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_jointangles", "arg_names": [], "import_names": [], "rhs_call_name": "set_jointangles", "annotation": ""}, "snippet": " self.robot.set_jointangles( self.arm, self.target_ja, 3.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L96_C8", "label": "sleep()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L93_C4", "vector": [8, 2, 0.6621, 0.0069, 2, 0.23, 0.125, 476, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( rospy.Duration( 3.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L99_C8", "label": "sleep()", "type": "expression", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L93_C4", "vector": [8, 2, 0.6828, 0.0069, 2, 0.23, 0.25, 476, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( rospy.Duration( 0.5 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L100_C8", "label": "thresh_detect()", "type": "expression", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L93_C4", "vector": [8, 2, 0.6897, 0.0069, 2, 0.23, 0.375, 233, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "thresh_detect", "arg_names": [], "import_names": [], "rhs_call_name": "thresh_detect", "annotation": ""}, "snippet": " self.ts.thresh_detect( 3000 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L103_C8", "label": "open_gripper()", "type": "expression", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L93_C4", "vector": [8, 2, 0.7103, 0.0069, 2, 0.23, 0.5, 833, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "open_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "open_gripper", "annotation": ""}, "snippet": " self.robot.open_gripper( self.arm )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L104_C8", "label": "sleep()", "type": "expression", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L93_C4", "vector": [8, 2, 0.7172, 0.0069, 2, 0.23, 0.625, 476, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( rospy.Duration( 2.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L107_C8", "label": "set_jointangles()", "type": "expression", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L93_C4", "vector": [8, 2, 0.7379, 0.0069, 2, 0.23, 0.75, 240, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_jointangles", "arg_names": [], "import_names": [], "rhs_call_name": "set_jointangles", "annotation": ""}, "snippet": " self.robot.set_jointangles( self.arm, self.start_ja, 3.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L108_C8", "label": "sleep()", "type": "expression", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L93_C4", "vector": [8, 2, 0.7448, 0.0069, 2, 0.23, 0.875, 476, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( rospy.Duration( 3.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Return_L109_C8", "label": "return", "type": "return", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L93_C4", "vector": [13, 2, 0.7517, 0.0069, 2, 0.23, 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_99374:FunctionDef_L111_C4", "label": "handoff_pos", "type": "function", "loc": [111, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:ClassDef_L20_C0", "vector": [2, 1, 0.8483, 0.1724, 1, 0.16, 1.0, 439, 0, 2, 1, 0, 0, 0, 14], "semantic": {"name": "handoff_pos", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def handoff_pos( self, msg ):\n #pos = np.matrix([0.6977, -0.03622, 0.2015]).T\n #ang = tr.Rx(math.radians(0.))\n print(msg)\n pos = np.matrix([ msg.x, msg.y, msg.z ]).T\n ang = tr.Rx( msg.ang )\n \n q = [0, 0, 0, 0, 0, 0, 0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L114_C8", "label": "print()", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "vector": [8, 2, 0.7862, 0.0069, 2, 0.04, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L115_C8", "label": "pos =", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "vector": [14, 2, 0.7931, 0.0069, 2, 0.04, 0.0833, 627, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = np.matrix([ msg.x, msg.y, msg.z ]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L116_C8", "label": "ang = Rx()", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "vector": [14, 2, 0.8, 0.0069, 2, 0.04, 0.1667, 762, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "Rx", "annotation": ""}, "snippet": " ang = tr.Rx( msg.ang )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L118_C8", "label": "q =", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "vector": [14, 2, 0.8138, 0.0069, 2, 0.04, 0.25, 516, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q = [0, 0, 0, 0, 0, 0, 0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L119_C8", "label": "j = IK()", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "vector": [14, 2, 0.8207, 0.0069, 2, 0.04, 0.3333, 100, 3, 4, 0, 0, 719, 10, 1], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "IK", "annotation": ""}, "snippet": " j = self.robot.IK('right_arm', pos, ang, self.target_ja)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L121_C8", "label": "set_jointangles()", "type": "expression", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "vector": [8, 2, 0.8345, 0.0069, 2, 0.04, 0.4167, 240, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_jointangles", "arg_names": [], "import_names": [], "rhs_call_name": "set_jointangles", "annotation": ""}, "snippet": " self.robot.set_jointangles( 'right_arm', j, 3.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L124_C8", "label": "sleep()", "type": "expression", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "vector": [8, 2, 0.8552, 0.0069, 2, 0.04, 0.5, 476, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( rospy.Duration( 0.5 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L125_C8", "label": "thresh_detect()", "type": "expression", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "vector": [8, 2, 0.8621, 0.0069, 2, 0.04, 0.5833, 233, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "thresh_detect", "arg_names": [], "import_names": [], "rhs_call_name": "thresh_detect", "annotation": ""}, "snippet": " self.ts.thresh_detect( 3000 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L128_C8", "label": "open_gripper()", "type": "expression", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "vector": [8, 2, 0.8828, 0.0069, 2, 0.04, 0.6667, 833, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "open_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "open_gripper", "annotation": ""}, "snippet": " self.robot.open_gripper( self.arm )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L129_C8", "label": "sleep()", "type": "expression", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "vector": [8, 2, 0.8897, 0.0069, 2, 0.04, 0.75, 476, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( rospy.Duration( 2.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L132_C8", "label": "set_jointangles()", "type": "expression", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "vector": [8, 2, 0.9103, 0.0069, 2, 0.04, 0.8333, 240, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_jointangles", "arg_names": [], "import_names": [], "rhs_call_name": "set_jointangles", "annotation": ""}, "snippet": " self.robot.set_jointangles( self.arm, self.start_ja, 3.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L133_C8", "label": "sleep()", "type": "expression", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "vector": [8, 2, 0.9172, 0.0069, 2, 0.04, 0.9167, 476, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( rospy.Duration( 3.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Return_L135_C8", "label": "return", "type": "return", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "vector": [13, 2, 0.931, 0.0069, 2, 0.04, 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_99374:If_L139_C0", "label": "if", "type": "if", "loc": [139, 142], "level": 0, "parent": null, "vector": [4, 0, 0.969, 0.0276, 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 hon = HandoffNode()\n #hon.handoff_pos()\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L140_C4", "label": "hon = HandoffNode()", "type": "assigned_variable", "loc": [140, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:If_L139_C0", "vector": [14, 1, 0.9655, 0.0069, 1, 0.99, 0.0, 207, 3, 0, 0, 0, 436, 10, 1], "semantic": {"name": "hon", "arg_names": [], "import_names": [], "rhs_call_name": "HandoffNode", "annotation": ""}, "snippet": " hon = HandoffNode()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L142_C4", "label": "spin()", "type": "expression", "loc": [142, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99374:If_L139_C0", "vector": [8, 1, 0.9793, 0.0069, 1, 0.99, 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_99374:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:If_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:If_L26_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L27_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Return_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Return_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Return_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Return_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:If_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Assign_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99374:If_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99374:Expr_L142_C4"}]
import numpy as np,math import sim_capture import glob import pickle as pkl import time class request(): def __init__( self, x, y, ang ): self.x = x self.y = y self.z = 0 self.ang = ang def has_item( lst, item ): try: lst.index( item ) return True except: return False X,Y = np.meshgrid( range(0,11), range(0,7) ) xy = np.column_stack([ X.flatten(), Y.flatten() ]).tolist() xy.remove( [7,3] ) xy.remove( [6,3] ) d_func = lambda lst: ( lst[0] - 7 )**2 + ( lst[1] - 3 )**2 cmp_func = lambda x,y : cmp(d_func(x),d_func(y)) xy.sort( cmp=cmp_func ) xya = [] for ang in [ math.radians(p) for p in [0.0, 90.0, 180.0, 270.0]]: for x,y in xy: xya.append( [x,y,ang] ) if not glob.glob( 'trajectory_caps/resutls.pkl' ): print 'Creating pickle file' d = { 'desired_pts': xya, 'capture_pts': [], 'captures': [] } f = open( 'trajectory_caps/resutls.pkl', 'w' ) pkl.dump( d, f ) f.close() f = open( 'trajectory_caps/resutls.pkl', 'r' ) d = pkl.load( f ) f.close() remaining = [ x for x in d['desired_pts'] if not has_item( d['capture_pts'], x )] print 'Remaining to capture: %d' % len( remaining ) sc = sim_capture.SimCapture() for x,y,ang in remaining: fname = 'trajectory_caps/' + str(int(time.time())) + '_cap.pkl' sc.capture( request( x, y, ang ), fname ) d[ 'capture_pts' ].append( [x,y,ang] ) d[ 'captures' ].append( [x,y,ang,fname] ) f = open( 'trajectory_caps/resutls.pkl', 'w' ) pkl.dump( d, f ) f.close()
ajibawa-2023/Python-Code-Large/train/row_99375
47
67
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Import_L1_C0", "label": "numpy import np, math", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0149, 0.0149, 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_99375:Import_L2_C0", "label": "sim_capture import sim_capture", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0299, 0.0149, 0, 0.66, 0.0435, 365, 0, 1, 0, 0, 365, 0, 0], "semantic": {"name": "sim_capture", "arg_names": [], "import_names": ["sim_capture"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sim_capture"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Import_L3_C0", "label": "glob import glob", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0448, 0.0149, 0, 0.66, 0.087, 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_99375:Import_L4_C0", "label": "pickle import pkl", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0597, 0.0149, 0, 0.66, 0.1304, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "pickle", "arg_names": [], "import_names": ["pkl"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pickle as pkl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Import_L5_C0", "label": "time import time", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0746, 0.0149, 0, 0.66, 0.1739, 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_99375:ClassDef_L7_C0", "label": "request", "type": "class", "loc": [7, 12], "level": 0, "parent": null, "vector": [3, 0, 0.1418, 0.0896, 0, 0.66, 0.2174, 50, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "request", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class request():\n def __init__( self, x, y, ang ):\n self.x = x\n self.y = y\n self.z = 0\n self.ang = ang"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:FunctionDef_L8_C4", "label": "__init__", "type": "function", "loc": [8, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99375:ClassDef_L7_C0", "vector": [2, 1, 0.1493, 0.0746, 1, 0.38, 0.0, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "x", "y", "ang"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, x, y, ang ):\n self.x = x\n self.y = y\n self.z = 0\n self.ang = ang"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Assign_L9_C8", "label": "self.x =", "type": "assigned_variable", "loc": [9, 9], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99375:FunctionDef_L8_C4", "vector": [14, 2, 0.1343, 0.0149, 2, 0.92, 0.0, 236, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.x = x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Assign_L10_C8", "label": "self.y =", "type": "assigned_variable", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99375:FunctionDef_L8_C4", "vector": [14, 2, 0.1493, 0.0149, 2, 0.92, 0.3333, 276, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.y = y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Assign_L11_C8", "label": "self.z =", "type": "assigned_variable", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99375:FunctionDef_L8_C4", "vector": [14, 2, 0.1642, 0.0149, 2, 0.92, 0.6667, 306, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.z = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Assign_L12_C8", "label": "self.ang =", "type": "assigned_variable", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99375:FunctionDef_L8_C4", "vector": [14, 2, 0.1791, 0.0149, 2, 0.92, 1.0, 572, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ang = ang"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:FunctionDef_L14_C0", "label": "has_item", "type": "function", "loc": [14, 19], "level": 0, "parent": null, "vector": [2, 0, 0.2463, 0.0896, 0, 0.66, 0.2609, 7, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "has_item", "arg_names": ["lst", "item"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def has_item( lst, item ):\n try:\n lst.index( item )\n return True\n except:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Try_L15_C4", "label": "try", "type": "try", "loc": [15, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99375:FunctionDef_L14_C0", "vector": [7, 1, 0.2537, 0.0746, 1, 0.27, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n lst.index( item )\n return True\n except:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L16_C8", "label": "index()", "type": "expression", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99375:Try_L15_C4", "vector": [8, 2, 0.2388, 0.0149, 2, 0.04, 0.0, 780, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "index", "arg_names": [], "import_names": [], "rhs_call_name": "index", "annotation": ""}, "snippet": " lst.index( item )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Return_L17_C8", "label": "return", "type": "return", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99375:Try_L15_C4", "vector": [13, 2, 0.2537, 0.0149, 2, 0.04, 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_99375:Return_L19_C8", "label": "return", "type": "return", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99375:Try_L15_C4", "vector": [13, 2, 0.2836, 0.0149, 2, 0.04, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Assign_L22_C0", "label": "X, Y = meshgrid()", "type": "assigned_variable", "loc": [22, 22], "level": 0, "parent": null, "vector": [14, 0, 0.3284, 0.0149, 0, 0.66, 0.3043, 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(0,11), range(0,7) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Assign_L23_C0", "label": "xy = tolist()", "type": "assigned_variable", "loc": [23, 23], "level": 0, "parent": null, "vector": [14, 0, 0.3433, 0.0149, 0, 0.66, 0.3478, 358, 3, 0, 0, 0, 185, 10, 4], "semantic": {"name": "xy", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": "xy = np.column_stack([ X.flatten(), Y.flatten() ]).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L24_C0", "label": "remove()", "type": "expression", "loc": [24, 24], "level": 0, "parent": null, "vector": [8, 0, 0.3582, 0.0149, 0, 0.66, 0.3913, 185, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove", "arg_names": [], "import_names": [], "rhs_call_name": "remove", "annotation": ""}, "snippet": "xy.remove( [7,3] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L25_C0", "label": "remove()", "type": "expression", "loc": [25, 25], "level": 0, "parent": null, "vector": [8, 0, 0.3731, 0.0149, 0, 0.66, 0.4348, 185, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove", "arg_names": [], "import_names": [], "rhs_call_name": "remove", "annotation": ""}, "snippet": "xy.remove( [6,3] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Assign_L27_C0", "label": "d_func =", "type": "assigned_variable", "loc": [27, 27], "level": 0, "parent": null, "vector": [14, 0, 0.403, 0.0149, 0, 0.66, 0.4783, 665, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "d_func", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "d_func = lambda lst: ( lst[0] - 7 )**2 + ( lst[1] - 3 )**2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Assign_L28_C0", "label": "cmp_func =", "type": "assigned_variable", "loc": [28, 28], "level": 0, "parent": null, "vector": [14, 0, 0.4179, 0.0149, 0, 0.66, 0.5217, 564, 9, 0, 0, 0, 0, 0, 3], "semantic": {"name": "cmp_func", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "cmp_func = lambda x,y : cmp(d_func(x),d_func(y))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L29_C0", "label": "sort()", "type": "expression", "loc": [29, 29], "level": 0, "parent": null, "vector": [8, 0, 0.4328, 0.0149, 0, 0.66, 0.5652, 489, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": "xy.sort( cmp=cmp_func )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Assign_L31_C0", "label": "xya =", "type": "assigned_variable", "loc": [31, 31], "level": 0, "parent": null, "vector": [14, 0, 0.4627, 0.0149, 0, 0.66, 0.6087, 875, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "xya", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "xya = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:For_L32_C0", "label": "for ang", "type": "for", "loc": [32, 34], "level": 0, "parent": null, "vector": [6, 0, 0.4925, 0.0448, 0, 0.66, 0.6522, 762, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for ang in [ math.radians(p) for p in [0.0, 90.0, 180.0, 270.0]]:\n for x,y in xy:\n xya.append( [x,y,ang] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:For_L33_C4", "label": "for x, y", "type": "for", "loc": [33, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99375:For_L32_C0", "vector": [6, 1, 0.5, 0.0299, 1, 0.45, 0.0, 855, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "x, y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x,y in xy:\n xya.append( [x,y,ang] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L34_C8", "label": "append()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99375:For_L33_C4", "vector": [8, 2, 0.5075, 0.0149, 2, 0.85, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " xya.append( [x,y,ang] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:If_L36_C0", "label": "if", "type": "if", "loc": [36, 44], "level": 0, "parent": null, "vector": [4, 0, 0.597, 0.1343, 0, 0.66, 0.6957, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if not glob.glob( 'trajectory_caps/resutls.pkl' ):\n print('Creating pickle file')\n d = { 'desired_pts': xya,\n 'capture_pts': [],\n 'captures': []\n }\n f = open( 'trajectory_caps/resutls.pkl', 'w' )\n pkl.dump( d, f )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L37_C4", "label": "print()", "type": "expression", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99375:If_L36_C0", "vector": [8, 1, 0.5522, 0.0149, 1, 0.79, 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 pickle file')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Assign_L38_C4", "label": "d =", "type": "assigned_variable", "loc": [38, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99375:If_L36_C0", "vector": [14, 1, 0.5896, 0.0597, 1, 0.79, 0.25, 355, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d = { 'desired_pts': xya,\n 'capture_pts': [],\n 'captures': []\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Assign_L42_C4", "label": "f = open()", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99375:If_L36_C0", "vector": [14, 1, 0.6269, 0.0149, 1, 0.79, 0.5, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " f = open( 'trajectory_caps/resutls.pkl', 'w' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L43_C4", "label": "dump()", "type": "expression", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99375:If_L36_C0", "vector": [8, 1, 0.6418, 0.0149, 1, 0.79, 0.75, 952, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "dump", "arg_names": [], "import_names": [], "rhs_call_name": "dump", "annotation": ""}, "snippet": " pkl.dump( d, f )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L44_C4", "label": "close()", "type": "expression", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99375:If_L36_C0", "vector": [8, 1, 0.6567, 0.0149, 1, 0.79, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " f.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Assign_L47_C0", "label": "f = open()", "type": "assigned_variable", "loc": [47, 47], "level": 0, "parent": null, "vector": [14, 0, 0.7015, 0.0149, 0, 0.66, 0.7391, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "f = open( 'trajectory_caps/resutls.pkl', 'r' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Assign_L48_C0", "label": "d = load()", "type": "assigned_variable", "loc": [48, 48], "level": 0, "parent": null, "vector": [14, 0, 0.7164, 0.0149, 0, 0.66, 0.7826, 355, 3, 1, 0, 0, 37, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "d = pkl.load( f )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L49_C0", "label": "close()", "type": "expression", "loc": [49, 49], "level": 0, "parent": null, "vector": [8, 0, 0.7313, 0.0149, 0, 0.66, 0.8261, 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_99375:Assign_L51_C0", "label": "remaining =", "type": "assigned_variable", "loc": [51, 51], "level": 0, "parent": null, "vector": [14, 0, 0.7612, 0.0149, 0, 0.66, 0.8696, 789, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "remaining", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "remaining = [ x for x in d['desired_pts'] if not has_item( d['capture_pts'], x )]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L52_C0", "label": "print()", "type": "expression", "loc": [52, 52], "level": 0, "parent": null, "vector": [8, 0, 0.7761, 0.0149, 0, 0.66, 0.913, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('Remaining to capture: %d' % len( remaining ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Assign_L54_C0", "label": "sc = SimCapture()", "type": "assigned_variable", "loc": [54, 54], "level": 0, "parent": null, "vector": [14, 0, 0.806, 0.0149, 0, 0.66, 0.9565, 356, 3, 0, 0, 0, 216, 10, 1], "semantic": {"name": "sc", "arg_names": [], "import_names": [], "rhs_call_name": "SimCapture", "annotation": ""}, "snippet": "sc = sim_capture.SimCapture()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:For_L56_C0", "label": "for x, y, ang", "type": "for", "loc": [56, 64], "level": 0, "parent": null, "vector": [6, 0, 0.8955, 0.1343, 0, 0.66, 1.0, 198, 2, 0, 0, 0, 0, 0, 10], "semantic": {"name": "x, y, ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for x,y,ang in remaining:\n fname = 'trajectory_caps/' + str(int(time.time())) + '_cap.pkl'\n sc.capture( request( x, y, ang ), fname )\n d[ 'capture_pts' ].append( [x,y,ang] )\n d[ 'captures' ].append( [x,y,ang,fname] )\n \n f = open( 'trajectory_caps/resutls.pkl', 'w' )\n pkl.dump( d, f )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Assign_L57_C4", "label": "fname =", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99375:For_L56_C0", "vector": [14, 1, 0.8507, 0.0149, 1, 0.37, 0.0, 190, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "fname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fname = 'trajectory_caps/' + str(int(time.time())) + '_cap.pkl'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L58_C4", "label": "capture()", "type": "expression", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99375:For_L56_C0", "vector": [8, 1, 0.8657, 0.0149, 1, 0.37, 0.1667, 547, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "capture", "arg_names": [], "import_names": [], "rhs_call_name": "capture", "annotation": ""}, "snippet": " sc.capture( request( x, y, ang ), fname )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L59_C4", "label": "append()", "type": "expression", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99375:For_L56_C0", "vector": [8, 1, 0.8806, 0.0149, 1, 0.37, 0.3333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " d[ 'capture_pts' ].append( [x,y,ang] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L60_C4", "label": "append()", "type": "expression", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99375:For_L56_C0", "vector": [8, 1, 0.8955, 0.0149, 1, 0.37, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " d[ 'captures' ].append( [x,y,ang,fname] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Assign_L62_C4", "label": "f = open()", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99375:For_L56_C0", "vector": [14, 1, 0.9254, 0.0149, 1, 0.37, 0.6667, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " f = open( 'trajectory_caps/resutls.pkl', 'w' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L63_C4", "label": "dump()", "type": "expression", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99375:For_L56_C0", "vector": [8, 1, 0.9403, 0.0149, 1, 0.37, 0.8333, 952, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "dump", "arg_names": [], "import_names": [], "rhs_call_name": "dump", "annotation": ""}, "snippet": " pkl.dump( d, f )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L64_C4", "label": "close()", "type": "expression", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99375:For_L56_C0", "vector": [8, 1, 0.9552, 0.0149, 1, 0.37, 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_99375:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99375:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99375:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99375:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99375:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99375:Assign_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99375:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99375:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99375:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99375:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99375:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99375:Try_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99375:Try_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99375:Try_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99375:Return_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99375:Try_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99375:Return_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99375:For_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99375:For_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99375:For_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99375:If_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99375:If_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99375:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99375:If_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99375:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99375:If_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99375:If_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99375:For_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99375:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99375:For_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99375:For_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99375:For_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99375:For_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99375:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99375:For_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99375:For_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99375:Expr_L64_C4"}]
#! /usr/bin/python import time import roslib roslib.load_manifest('hrl_rfid') roslib.load_manifest('sound_play') import rospy import time import numpy as np, math import hrl_rfid.ros_M5e_client as rmc import sound_play.libsoundplay as lsp r = rmc.ROS_M5e_Client('ears') r.query_mode() speaker = lsp.SoundClient() i = 0 reads_dict = {} while not rospy.is_shutdown(): if i % 2 == 0: read = r.read('EleLeftEar') else: read = r.read('EleRightEar') i = i + 1 print 'read:', read if read[-1] > 92: if not reads_dict.has_key( read[-2] ): reads_dict[ read[-2] ] = time.time() - 3.5 if time.time() - reads_dict[ read[-2] ] > 3.0: reads_dict[ read[-2] ] = time.time() print read speaker.say( read[-2] ) r.stop()
ajibawa-2023/Python-Code-Large/train/row_99376
28
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_99376:Import_L2_C0", "label": "time import time", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0238, 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_99376:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0714, 0.0238, 0, 0.66, 0.0667, 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_99376:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0952, 0.0238, 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('hrl_rfid')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99376:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.119, 0.0238, 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('sound_play')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99376:Import_L7_C0", "label": "rospy import rospy", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.0238, 0, 0.66, 0.2667, 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_99376:Import_L8_C0", "label": "time import time", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1905, 0.0238, 0, 0.66, 0.3333, 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_99376:Import_L9_C0", "label": "numpy import np, math", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.2143, 0.0238, 0, 0.66, 0.4, 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_99376:Import_L10_C0", "label": "hrl_rfid.ros_M5e_client import rmc", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.2381, 0.0238, 0, 0.66, 0.4667, 460, 0, 1, 0, 0, 460, 0, 0], "semantic": {"name": "hrl_rfid.ros_M5e_client", "arg_names": [], "import_names": ["rmc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_rfid.ros_M5e_client as rmc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99376:Import_L11_C0", "label": "sound_play.libsoundplay import lsp", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.2619, 0.0238, 0, 0.66, 0.5333, 878, 0, 1, 0, 0, 878, 0, 0], "semantic": {"name": "sound_play.libsoundplay", "arg_names": [], "import_names": ["lsp"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sound_play.libsoundplay as lsp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99376:Assign_L13_C0", "label": "r = ROS_M5e_Client()", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.3095, 0.0238, 0, 0.66, 0.6, 436, 3, 1, 0, 0, 479, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_M5e_Client", "annotation": ""}, "snippet": "r = rmc.ROS_M5e_Client('ears')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99376:Expr_L14_C0", "label": "query_mode()", "type": "expression", "loc": [14, 14], "level": 0, "parent": null, "vector": [8, 0, 0.3333, 0.0238, 0, 0.66, 0.6667, 130, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "query_mode", "arg_names": [], "import_names": [], "rhs_call_name": "query_mode", "annotation": ""}, "snippet": "r.query_mode()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99376:Assign_L16_C0", "label": "speaker = SoundClient()", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.381, 0.0238, 0, 0.66, 0.7333, 600, 3, 0, 0, 0, 943, 10, 1], "semantic": {"name": "speaker", "arg_names": [], "import_names": [], "rhs_call_name": "SoundClient", "annotation": ""}, "snippet": "speaker = lsp.SoundClient()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99376:Assign_L18_C0", "label": "i =", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.4286, 0.0238, 0, 0.66, 0.8, 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_99376:Assign_L19_C0", "label": "reads_dict =", "type": "assigned_variable", "loc": [19, 19], "level": 0, "parent": null, "vector": [14, 0, 0.4524, 0.0238, 0, 0.66, 0.8667, 66, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "reads_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "reads_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99376:While_L21_C0", "label": "while", "type": "while", "loc": [21, 37], "level": 0, "parent": null, "vector": [5, 0, 0.6905, 0.4048, 0, 0.66, 0.9333, 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 if i % 2 == 0:\n read = r.read('EleLeftEar')\n else:\n read = r.read('EleRightEar')\n i = i + 1\n\n print('read:', read)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99376:If_L22_C4", "label": "if", "type": "if", "loc": [22, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99376:While_L21_C0", "vector": [4, 1, 0.5595, 0.0952, 1, 0.2, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i % 2 == 0:\n read = r.read('EleLeftEar')\n else:\n read = r.read('EleRightEar')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99376:Assign_L23_C8", "label": "read = read()", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99376:If_L22_C4", "vector": [14, 2, 0.5476, 0.0238, 2, 0.33, 0.0, 453, 3, 1, 0, 0, 453, 10, 1], "semantic": {"name": "read", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " read = r.read('EleLeftEar')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99376:Assign_L25_C8", "label": "read = read()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99376:If_L22_C4", "vector": [14, 2, 0.5952, 0.0238, 2, 0.33, 1.0, 453, 3, 1, 0, 0, 453, 10, 1], "semantic": {"name": "read", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " read = r.read('EleRightEar')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99376:Assign_L26_C4", "label": "i =", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99376:While_L21_C0", "vector": [14, 1, 0.619, 0.0238, 1, 0.2, 0.3333, 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_99376:Expr_L28_C4", "label": "print()", "type": "expression", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99376:While_L21_C0", "vector": [8, 1, 0.6667, 0.0238, 1, 0.2, 0.6667, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('read:', read)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99376:If_L30_C4", "label": "if", "type": "if", "loc": [30, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99376:While_L21_C0", "vector": [4, 1, 0.7976, 0.1905, 1, 0.2, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if read[-1] > 92:\n if not reads_dict.has_key( read[-2] ):\n reads_dict[ read[-2] ] = time.time() - 3.5\n\n if time.time() - reads_dict[ read[-2] ] > 3.0:\n reads_dict[ read[-2] ] = time.time()\n print(read)\n speaker.say( read[-2] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99376:If_L31_C8", "label": "if", "type": "if", "loc": [31, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99376:If_L30_C4", "vector": [4, 2, 0.75, 0.0476, 2, 0.91, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not reads_dict.has_key( read[-2] ):\n reads_dict[ read[-2] ] = time.time() - 3.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99376:Assign_L32_C12", "label": "assign", "type": "assigned_variable", "loc": [32, 32], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99376:If_L31_C8", "vector": [14, 3, 0.7619, 0.0238, 3, 0.93, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " reads_dict[ read[-2] ] = time.time() - 3.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99376:If_L34_C8", "label": "if", "type": "if", "loc": [34, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99376:If_L30_C4", "vector": [4, 2, 0.8452, 0.0952, 2, 0.91, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if time.time() - reads_dict[ read[-2] ] > 3.0:\n reads_dict[ read[-2] ] = time.time()\n print(read)\n speaker.say( read[-2] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99376:Assign_L35_C12", "label": " = time()", "type": "assigned_variable", "loc": [35, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99376:If_L34_C8", "vector": [14, 3, 0.8333, 0.0238, 3, 0.21, 0.0, 0, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " reads_dict[ read[-2] ] = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99376:Expr_L36_C12", "label": "print()", "type": "expression", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99376:If_L34_C8", "vector": [8, 3, 0.8571, 0.0238, 3, 0.21, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(read)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99376:Expr_L37_C12", "label": "say()", "type": "expression", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99376:If_L34_C8", "vector": [8, 3, 0.881, 0.0238, 3, 0.21, 1.0, 890, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "say", "arg_names": [], "import_names": [], "rhs_call_name": "say", "annotation": ""}, "snippet": " speaker.say( read[-2] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99376:Expr_L39_C0", "label": "stop()", "type": "expression", "loc": [39, 39], "level": 0, "parent": null, "vector": [8, 0, 0.9286, 0.0238, 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": "r.stop()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99376:While_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99376:If_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99376:If_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99376:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99376:If_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99376:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99376:While_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99376:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99376:While_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99376:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99376:While_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99376:If_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99376:If_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99376:If_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99376:If_L31_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99376:Assign_L32_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99376:If_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99376:If_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99376:If_L34_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99376:Assign_L35_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99376:If_L34_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99376:Expr_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99376:If_L34_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99376:Expr_L37_C12"}]
#!/usr/bin/python import roslib roslib.load_manifest('room_explore') import rospy import tf from nav_msgs.srv import GetPlan, GetPlanRequest from geometry_msgs.msg import PoseStamped import util as ut import time #srv_name = '/move_base_node/NavfnROS/make_plan' srv_name = '/move_base_node/make_plan' rospy.init_node('trial_explore') listener = tf.TransformListener() listener.waitForTransform('/base_link', '/map', rospy.Time(0), timeout = rospy.Duration(100) ) get_plan = rospy.ServiceProxy( srv_name, GetPlan ) rospy.get_param('/move_base_node/global_costmap/raytrace_range') rospy.get_param('/move_base_node/TrajectoryPlannerROS/xy_goal_tolerance') req = GetPlanRequest() req.tolerance = 0.5 req.start = ut.robot_in_map( listener ) req.goal.header.stamp = rospy.Time(0) req.goal.header.frame_id = '/map' req.goal.pose.position.x = 0.85 #req.goal.pose.position.y = 0.85 req.goal.pose.orientation.w = 1.0 res = get_plan( req ) found = bool( res.plan.poses != [] ) print res print 'Found Path: ', found for i in xrange( 100 ): t0 = time.time() res = get_plan( req ) t1 = time.time() print 'Rate: ', 1.0 / (t1 - t0)
ajibawa-2023/Python-Code-Large/train/row_99377
31
49
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99377:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0612, 0.0204, 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_99377:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0816, 0.0204, 0, 0.66, 0.0385, 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('room_explore')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99377:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.102, 0.0204, 0, 0.66, 0.0769, 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_99377:Import_L7_C0", "label": "tf import tf", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0204, 0, 0.66, 0.1154, 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_99377:ImportFrom_L9_C0", "label": "from nav_msgs.srv import GetPlan, GetPlanRequest", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1837, 0.0204, 0, 0.66, 0.1538, 850, 0, 2, 0, 0, 850, 0, 0], "semantic": {"name": "nav_msgs.srv", "arg_names": [], "import_names": ["GetPlan", "GetPlanRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from nav_msgs.srv import GetPlan, GetPlanRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99377:ImportFrom_L10_C0", "label": "from geometry_msgs.msg import PoseStamped", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.2041, 0.0204, 0, 0.66, 0.1923, 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_99377:Import_L12_C0", "label": "util import ut", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.2449, 0.0204, 0, 0.66, 0.2308, 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_99377:Import_L13_C0", "label": "time import time", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.2653, 0.0204, 0, 0.66, 0.2692, 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_99377:Assign_L16_C0", "label": "srv_name =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.3265, 0.0204, 0, 0.66, 0.3077, 114, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "srv_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "srv_name = '/move_base_node/make_plan'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99377:Expr_L18_C0", "label": "init_node()", "type": "expression", "loc": [18, 18], "level": 0, "parent": null, "vector": [8, 0, 0.3673, 0.0204, 0, 0.66, 0.3462, 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('trial_explore')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99377:Assign_L19_C0", "label": "listener = TransformListener()", "type": "assigned_variable", "loc": [19, 19], "level": 0, "parent": null, "vector": [14, 0, 0.3878, 0.0204, 0, 0.66, 0.3846, 870, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "listener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": "listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99377:Expr_L20_C0", "label": "waitForTransform()", "type": "expression", "loc": [20, 21], "level": 0, "parent": null, "vector": [8, 0, 0.4184, 0.0408, 0, 0.66, 0.4231, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": "listener.waitForTransform('/base_link', '/map',\n rospy.Time(0), timeout = rospy.Duration(100) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99377:Assign_L23_C0", "label": "get_plan = ServiceProxy()", "type": "assigned_variable", "loc": [23, 23], "level": 0, "parent": null, "vector": [14, 0, 0.4694, 0.0204, 0, 0.66, 0.4615, 550, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "get_plan", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": "get_plan = rospy.ServiceProxy( srv_name, GetPlan )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99377:Expr_L24_C0", "label": "get_param()", "type": "expression", "loc": [24, 24], "level": 0, "parent": null, "vector": [8, 0, 0.4898, 0.0204, 0, 0.66, 0.5, 427, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "get_param", "arg_names": [], "import_names": [], "rhs_call_name": "get_param", "annotation": ""}, "snippet": "rospy.get_param('/move_base_node/global_costmap/raytrace_range')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99377:Expr_L25_C0", "label": "get_param()", "type": "expression", "loc": [25, 25], "level": 0, "parent": null, "vector": [8, 0, 0.5102, 0.0204, 0, 0.66, 0.5385, 427, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "get_param", "arg_names": [], "import_names": [], "rhs_call_name": "get_param", "annotation": ""}, "snippet": "rospy.get_param('/move_base_node/TrajectoryPlannerROS/xy_goal_tolerance')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99377:Assign_L27_C0", "label": "req = GetPlanRequest()", "type": "assigned_variable", "loc": [27, 27], "level": 0, "parent": null, "vector": [14, 0, 0.551, 0.0204, 0, 0.66, 0.5769, 233, 3, 0, 0, 0, 250, 10, 1], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "GetPlanRequest", "annotation": ""}, "snippet": "req = GetPlanRequest()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99377:Assign_L28_C0", "label": "req.tolerance =", "type": "assigned_variable", "loc": [28, 28], "level": 0, "parent": null, "vector": [14, 0, 0.5714, 0.0204, 0, 0.66, 0.6154, 836, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "req.tolerance", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "req.tolerance = 0.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99377:Assign_L30_C0", "label": "req.start = robot_in_map()", "type": "assigned_variable", "loc": [30, 30], "level": 0, "parent": null, "vector": [14, 0, 0.6122, 0.0204, 0, 0.66, 0.6538, 532, 3, 1, 0, 0, 945, 10, 1], "semantic": {"name": "req.start", "arg_names": [], "import_names": [], "rhs_call_name": "robot_in_map", "annotation": ""}, "snippet": "req.start = ut.robot_in_map( listener )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99377:Assign_L32_C0", "label": "req.goal.header.stamp = Time()", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 0.6531, 0.0204, 0, 0.66, 0.6923, 773, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "req.goal.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": "req.goal.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99377:Assign_L33_C0", "label": "req.goal.header.frame_id =", "type": "assigned_variable", "loc": [33, 33], "level": 0, "parent": null, "vector": [14, 0, 0.6735, 0.0204, 0, 0.66, 0.7308, 67, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "req.goal.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "req.goal.header.frame_id = '/map'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99377:Assign_L34_C0", "label": "req.goal.pose.position.x =", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 0.6939, 0.0204, 0, 0.66, 0.7692, 107, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "req.goal.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "req.goal.pose.position.x = 0.85"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99377:Assign_L36_C0", "label": "req.goal.pose.orientation.w =", "type": "assigned_variable", "loc": [36, 36], "level": 0, "parent": null, "vector": [14, 0, 0.7347, 0.0204, 0, 0.66, 0.8077, 817, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "req.goal.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "req.goal.pose.orientation.w = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99377:Assign_L38_C0", "label": "res = get_plan()", "type": "assigned_variable", "loc": [38, 38], "level": 0, "parent": null, "vector": [14, 0, 0.7755, 0.0204, 0, 0.66, 0.8462, 413, 3, 1, 0, 0, 550, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "get_plan", "annotation": ""}, "snippet": "res = get_plan( req )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99377:Assign_L39_C0", "label": "found = bool()", "type": "assigned_variable", "loc": [39, 39], "level": 0, "parent": null, "vector": [14, 0, 0.7959, 0.0204, 0, 0.66, 0.8846, 841, 3, 1, 0, 0, 337, 10, 1], "semantic": {"name": "found", "arg_names": [], "import_names": [], "rhs_call_name": "bool", "annotation": ""}, "snippet": "found = bool( res.plan.poses != [] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99377:Expr_L40_C0", "label": "print()", "type": "expression", "loc": [40, 40], "level": 0, "parent": null, "vector": [8, 0, 0.8163, 0.0204, 0, 0.66, 0.9231, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print(res)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99377:Expr_L41_C0", "label": "print()", "type": "expression", "loc": [41, 41], "level": 0, "parent": null, "vector": [8, 0, 0.8367, 0.0204, 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('Found Path: ', found)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99377:For_L44_C0", "label": "for i", "type": "for", "loc": [44, 49], "level": 0, "parent": null, "vector": [6, 0, 0.949, 0.1224, 0, 0.66, 1.0, 826, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for i in xrange( 100 ):\n t0 = time.time()\n res = get_plan( req )\n t1 = time.time()\n\n print('Rate: ', 1.0 / (t1 - t0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99377:Assign_L45_C4", "label": "t0 = time()", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99377:For_L44_C0", "vector": [14, 1, 0.9184, 0.0204, 1, 0.42, 0.0, 573, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "t0", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " t0 = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99377:Assign_L46_C4", "label": "res = get_plan()", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99377:For_L44_C0", "vector": [14, 1, 0.9388, 0.0204, 1, 0.42, 0.3333, 413, 3, 1, 0, 0, 550, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "get_plan", "annotation": ""}, "snippet": " res = get_plan( req )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99377:Assign_L47_C4", "label": "t1 = time()", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99377:For_L44_C0", "vector": [14, 1, 0.9592, 0.0204, 1, 0.42, 0.6667, 329, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "t1", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " t1 = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99377:Expr_L49_C4", "label": "print()", "type": "expression", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99377:For_L44_C0", "vector": [8, 1, 1.0, 0.0204, 1, 0.42, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Rate: ', 1.0 / (t1 - t0))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99377:For_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99377:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99377:For_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99377:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99377:For_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99377:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99377:For_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99377:Expr_L49_C4"}]
#!/usr/bin/python import roslib roslib.load_manifest('rfid_explore_room') roslib.load_manifest('explore_hrl') import rospy import tf import tf.transformations as tft import actionlib import rfid_explore_room.util as ut from actionlib.simple_action_client import SimpleGoalState from move_base_msgs.msg import MoveBaseGoal, MoveBaseAction from geometry_msgs.msg import PoseStamped, Quaternion from nav_msgs.srv import GetPlan, GetPlanRequest from rfid_explore_room.srv import ExploreRoomSrv, ExploreRoomSrvResponse from explore_hrl.msg import ExploreAction, ExploreResult, ExploreGoal import yaml import numpy as np, math import string import os def retfalse(): return False class SnakingExplore( ): def __init__( self, df, room, start_rad = 1.5, markers_update = lambda x: True ): try: rospy.init_node( 'SnakingExplore' ) except: pass self.frame = '/' + room self.markers_update = markers_update self.length = df[room]['length'] self.width = df[room]['width'] rospy.logout( 'snaking_explore: Initializing' ) self.listener = tf.TransformListener() self.listener.waitForTransform( '/base_link', '/map', rospy.Time(0), timeout = rospy.Duration(100)) self.listener.waitForTransform( self.frame, '/map', rospy.Time(0), timeout = rospy.Duration(100)) self.setup_poses( radius = start_rad ) self.client = actionlib.SimpleActionClient( 'move_base', MoveBaseAction ) self.client.wait_for_server() self._service = rospy.Service( '/explore/explore' , ExploreRoomSrv, self.service_request ) self._as = actionlib.SimpleActionServer( '/explore', ExploreAction, execute_cb = self.action_request ) self._as.start() rospy.logout( 'snaking_explore: Ready and waiting.' ) def service_request( self, req ): res = self.begin_explore( req.radius ) rospy.logout( 'snaking_explore: Returning result \'%s\'' % res ) return res def action_request( self, goal ): rospy.logout( 'snaking_explore: action_request received for radius: \'%2.2f\'' % goal.radius ) def preempt_func(): # self._as should be in scope and bound @ function def. (I think for python...) check = self._as.is_preempt_requested() if check: rospy.logout( 'snaking_explore: action_request preempted!' ) return check rv = self.begin_explore( goal.radius, preempt_func = preempt_func ) rospy.logout( 'snaking_explore: action_request received result %d' % int(rv) ) if rv == 'succeeded': rospy.logout( 'snaking_explore: returning \'succeeded\'' ) self._as.set_succeeded( ExploreResult() ) elif rv == 'preempted': rospy.logout( 'snaking_explore: returning \'preempted\'' ) self._as.set_preempted( ) else: # rv == 'aborted' rospy.logout( 'snaking_explore: returning \'aborted\'' ) self._as.set_aborted() def robot_in_map( self ): ps_base = PoseStamped() ps_base.header.frame_id = '/base_link' ps_base.header.stamp = rospy.Time(0) ps_base.pose.orientation.w = 1.0 return self.ps_in_map( ps_base ) def ps_in_map( self, ps ): # ps is pose_stamped try: ps_map = self.listener.transformPose( '/map', ps ) except: rospy.logout( 'snaking_explore: %s -> map Transform failed.' % ps.header.frame_id ) ps_map = None return ps_map def range_to_waypoint( self, r, w ): # r => robot in map, w => waypoint in map return np.sqrt( (r.pose.position.x - w.pose.position.x)**2.0 + (r.pose.position.y - w.pose.position.y)**2.0 ) def begin_explore( self, radius, preempt_func = retfalse ): rospy.logout( 'snaking_explore: setting radius' ) waypoints = self.setup_poses( radius ) # PoseStamped in self.frame local_planner = rospy.get_param('/move_base_node/base_local_planner') # : dwa_local_planner/DWAPlannerROS local_planner = local_planner[string.find(local_planner,'/')+1:] obs_range = rospy.get_param('/move_base_node/global_costmap/obstacle_range') move_tol = rospy.get_param('/move_base_node/'+local_planner+'/xy_goal_tolerance') no_progress = rospy.get_param( rospy.get_name() + '/no_progress_move', 5) unreached_time = rospy.get_param( rospy.get_name() + '/not_reached_move', 30) # I'm not entirely sure which service to use. I do know that # non-NavfnROS make_plan sometimes fails for an unknown # reason... and thus NavfnROS/make_plan is more robust. # srv_name = '/move_base_node/make_plan' srv_name = '/move_base_node/NavfnROS/make_plan' get_plan = rospy.ServiceProxy( srv_name, GetPlan ) # Clear costmap...? Do this here or in smach...? if preempt_func(): # immediately exit if overall action preempted return 'preempted' for i,w in enumerate( waypoints ): if preempt_func(): # immediately exit if overall action preempted return 'preempted' rospy.logout( 'snaking_explore: Seeking waypoint %d of %d' % (i+1,len(waypoints))) # rospy.logout( 'snaking_explore: %2.2f %2.2f in frame %s' % (w.pose.position.x, w.pose.position.y, w.header.frame_id)) rim = self.robot_in_map() w.header.stamp = rospy.Time(0) # transform it _now_ wim = self.ps_in_map( w ) # waypoint in map if not rim or not wim: # if transforms failed rospy.logout( 'snaking_explore: Bad transforms. Aborting explore' ) return 'aborted' if self.range_to_waypoint( rim, wim ) < 0.9 * obs_range: # We're nearby the waypoint, so we'll just trust that the planner # has a good view of its surroundings to determine reachability. req = GetPlanRequest() req.tolerance = 0.1 req.start = rim req.goal = wim resp = get_plan( req ) found_plan = bool( resp.plan.poses != [] ) if not found_plan: rospy.logout( 'snaking_explore: No plan to nearby waypoint. Proceeding to next waypoint' ) # Perhaps its worth pulling the waypoint closer until a path _is_ found? continue # We now know that a path exists. Send the waypoint to the client. rospy.logout( 'snaking_explore: Near by with good plan. Calling move_base action.' ) else: # Any nav plan at beyond obstacle range will require the # nav stack to get a better vantage. Send the waypoint to # the client. rospy.logout( 'snaking_explore: Far away. Calling move_base action.' ) # If we made it this far, it's time to call move_base action. # Cancel any previous goals self.client.cancel_goals_at_and_before_time( rospy.Time.now() ) if os.environ.has_key('ROBOT') and os.environ['ROBOT'] == 'sim': rospy.logout( 'running in sim: give the system a little time to respond' ) rospy.sleep( 1 ) # Send our new goal rospy.logout( 'snaking_explore: sending movebase action goal.' ) move_goal = MoveBaseGoal() move_goal.target_pose = wim self.client.send_goal( move_goal ) if os.environ.has_key('ROBOT') and os.environ['ROBOT'] == 'sim': rospy.logout( 'running in sim: give the system a little time to respond' ) rospy.sleep( 1 ) # We'll monitor the state ourselves, and allow ourselves # the opportunity to cancel the goal for various reasons # (eg. if we haven't moved for a while or if new plans # aren't found after getting within obstacle distance) # When this loop is broken, we'll go to the next goal. We # don't need to cancel the goals here -- they will be # cancelled before a new one is sent. r = rospy.Rate( 10 ) xytt_old = None # Checks for movement stime = rospy.Time.now().to_sec() while True: if self.client.simple_state == SimpleGoalState.DONE: res = self.client.get_result() rospy.logout('snaking_explore: Movebase actionlib completed with result. Proceeding to next waypoint') break rim = self.robot_in_map() w.header.stamp = rospy.Time( 0 ) wim = self.ps_in_map( w ) # Proceed when close enough to goal (within two tolerance factors) if rim and wim: # only do this check if transform succeeds if self.range_to_waypoint( rim, wim ) < move_tol * 2.0: rospy.logout( 'snaking_explore: Close enough to waypoint. Proceeding to next waypoint' ) break # We're near the waypoint, so let's must move on to next # Proceed when there has been no movement (x,y, or theta) for X sec. if rim: # only do this check if transform succeeds xytt = self.xythetatime( rim ) if not xytt_old: xytt_old = xytt if np.abs( xytt[0] - xytt_old[0] ) > 0.05 or \ np.abs( xytt[1] - xytt_old[1] ) > 0.05 or \ np.abs( xytt[2] - xytt_old[2] ) > math.radians(10): xytt_old = xytt if xytt[3] - xytt_old[3] > no_progress: rospy.logout( 'snaking_explore: No movement in %2.1f seconds. Proceeding to next waypoint' % no_progress ) break if rospy.Time.now().to_sec() - stime > unreached_time: rospy.logout( 'snaking_explore: Goal unreached in %2.1f seconds. Proceeding to next waypoint' % unreached_time ) break r.sleep() self.client.cancel_all_goals() rospy.logout( 'snaking_explore: Finished with exploration.' ) return 'succeeded' def xythetatime( self, ps ): o = ps.pose.orientation r,p,y = tft.euler_from_quaternion(( o.x, o.y, o.z, o.w )) return ps.pose.position.x, ps.pose.position.y, y, rospy.Time.now().to_sec() def setup_poses( self, radius ): # poses = self.setup_poses_xonly( radius ) poses = self.setup_poses_snaking( radius ) self.markers_update( poses ) return poses def setup_poses_snaking( self, radius ): # tt are the min's and maxes of the snake along x-axis cycles = np.ceil( self.length / radius ) tt = np.linspace( 0.0, self.length, 2 * cycles + 1 ) # Determine waypoints at crest and valleys (lengthwise) crests = [] atmin = False for xx in tt: atmin = not atmin # alternate between ys = 0 and ys = width yy = float( atmin ) * self.width crests.append( (xx, yy) ) # Determine intermediate waypoints (widthwise) xyinter = [] inter = np.ceil( self.width / radius ) x_next, y_next = 0.0, 0.0 for i in xrange( len(crests) - 1 ): x_prev = crests[i][0] y_prev = crests[i][1] x_next = crests[i+1][0] y_next = crests[i+1][1] x_inter = np.linspace( x_prev, x_next, inter * 2, endpoint = False ) y_inter = np.linspace( y_prev, y_next, inter * 2, endpoint = False ) xyinter += zip( x_inter, y_inter ) xyinter += [ (x_next, y_next) ] # Determine headings (in self.frame) xytheta = [] def add_xytheta( x, y, t ): ps = PoseStamped() ps.header.frame_id = self.frame ps.header.stamp = rospy.Time(0) ps.pose.position.x = x ps.pose.position.y = y ps.pose.orientation = Quaternion( *tft.quaternion_from_euler( 0.0, 0.0, t )) xytheta.append( ps ) theta = 0.0 for i in xrange( len(xyinter) - 1 ): theta = np.arctan2( xyinter[i+1][1] - xyinter[i][1], xyinter[i+1][0] - xyinter[i][0] ) add_xytheta( xyinter[i][0], xyinter[i][1], theta ) add_xytheta( xyinter[-1][0], xyinter[-1][1], theta ) return xytheta def setup_poses_xonly( self, radius ): poses = [] xpos = 0.0 def ps_x( x ): ps = PoseStamped() ps.header.frame_id = self.frame ps.pose.position.x = x ps.pose.orientation.w = 1.0 return ps for i in xrange(3): poses.append( ps_x( xpos )) xpos += 0.5 xpos += 3.0 for i in xrange(3): poses.append( ps_x( xpos )) xpos += 0.5 return poses if __name__ == '__main__': import optparse p = optparse.OptionParser() p.add_option('--yaml', action='store', type='string', dest='yaml', help='Room definition file (required)', default='') p.add_option('--room', action='store', type='string', dest='room', help='Specific room [default \'hrl\']', default='hrl') opt, args = p.parse_args() if opt.yaml == '': print 'room_explore: YAML FILE REQUIRED.' else: print 'Using YAML file: ', opt.yaml f = open( opt.yaml ) dat = yaml.load( f ) f.close() room_transforms = ut.TFthread( dat ) pm = ut.PosesMarkers() re = SnakingExplore( df = dat, room = opt.room, start_rad = 1.5, markers_update = pm.update_poses ) # rospy.sleep( 4 ) # re.publish_markers() rospy.spin() # r = rospy.Rate( 2 ) # while not rospy.is_shutdown(): # re.publish_markers() # r.sleep() #re.begin_explore( 0.8 ) # rosservice call /explore 0.8 # explore_act = actionlib.SimpleActionClient('explore', ExploreAction) # rospy.logout( 'Waiting for explore.' ) # explore_act.wait_for_server() # rospy.logout( 'Done waiting.' ) # goal = ExploreGoal( radius = 0.8 ) # explore_act.send_goal(goal) # rospy.sleep( 0.5 ) # explore_act.wait_for_result()
ajibawa-2023/Python-Code-Large/train/row_99378
218
380
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0079, 0.0026, 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_99378:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0105, 0.0026, 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": "roslib.load_manifest('rfid_explore_room')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0132, 0.0026, 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('explore_hrl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Import_L6_C0", "label": "rospy import rospy", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0158, 0.0026, 0, 0.66, 0.15, 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_99378:Import_L8_C0", "label": "tf import tf", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0211, 0.0026, 0, 0.66, 0.2, 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_99378:Import_L9_C0", "label": "tf.transformations import tft", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0237, 0.0026, 0, 0.66, 0.25, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tft"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tft"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Import_L10_C0", "label": "actionlib import actionlib", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0263, 0.0026, 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_99378:Import_L11_C0", "label": "rfid_explore_room.util import ut", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0289, 0.0026, 0, 0.66, 0.35, 980, 0, 1, 0, 0, 980, 0, 0], "semantic": {"name": "rfid_explore_room.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rfid_explore_room.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:ImportFrom_L12_C0", "label": "from actionlib.simple_action_client import SimpleGoalState", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0316, 0.0026, 0, 0.66, 0.4, 18, 0, 1, 0, 0, 18, 0, 0], "semantic": {"name": "actionlib.simple_action_client", "arg_names": [], "import_names": ["SimpleGoalState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from actionlib.simple_action_client import SimpleGoalState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:ImportFrom_L14_C0", "label": "from move_base_msgs.msg import MoveBaseGoal, MoveBaseAction", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0368, 0.0026, 0, 0.66, 0.45, 440, 0, 2, 0, 0, 440, 0, 0], "semantic": {"name": "move_base_msgs.msg", "arg_names": [], "import_names": ["MoveBaseGoal", "MoveBaseAction"], "rhs_call_name": "", "annotation": ""}, "snippet": "from move_base_msgs.msg import MoveBaseGoal, MoveBaseAction"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:ImportFrom_L15_C0", "label": "from geometry_msgs.msg import PoseStamped, Quaternion", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0395, 0.0026, 0, 0.66, 0.5, 951, 0, 2, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["PoseStamped", "Quaternion"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import PoseStamped, Quaternion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:ImportFrom_L16_C0", "label": "from nav_msgs.srv import GetPlan, GetPlanRequest", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0421, 0.0026, 0, 0.66, 0.55, 850, 0, 2, 0, 0, 850, 0, 0], "semantic": {"name": "nav_msgs.srv", "arg_names": [], "import_names": ["GetPlan", "GetPlanRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from nav_msgs.srv import GetPlan, GetPlanRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:ImportFrom_L17_C0", "label": "from rfid_explore_room.srv import ExploreRoomSrv, ExploreRoomSrvResponse", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0447, 0.0026, 0, 0.66, 0.6, 334, 0, 2, 0, 0, 334, 0, 0], "semantic": {"name": "rfid_explore_room.srv", "arg_names": [], "import_names": ["ExploreRoomSrv", "ExploreRoomSrvResponse"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_explore_room.srv import ExploreRoomSrv, ExploreRoomSrvResponse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:ImportFrom_L18_C0", "label": "from explore_hrl.msg import ExploreAction, ExploreResult, ExploreGoal", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0474, 0.0026, 0, 0.66, 0.65, 232, 0, 3, 0, 0, 232, 0, 0], "semantic": {"name": "explore_hrl.msg", "arg_names": [], "import_names": ["ExploreAction", "ExploreResult", "ExploreGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from explore_hrl.msg import ExploreAction, ExploreResult, ExploreGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Import_L20_C0", "label": "yaml import yaml", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0026, 0, 0.66, 0.7, 960, 0, 1, 0, 0, 960, 0, 0], "semantic": {"name": "yaml", "arg_names": [], "import_names": ["yaml"], "rhs_call_name": "", "annotation": ""}, "snippet": "import yaml"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Import_L21_C0", "label": "numpy import np, math", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0553, 0.0026, 0, 0.66, 0.75, 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_99378:Import_L22_C0", "label": "string import string", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0579, 0.0026, 0, 0.66, 0.8, 890, 0, 1, 0, 0, 890, 0, 0], "semantic": {"name": "string", "arg_names": [], "import_names": ["string"], "rhs_call_name": "", "annotation": ""}, "snippet": "import string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Import_L23_C0", "label": "os import os", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.0605, 0.0026, 0, 0.66, 0.85, 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_99378:FunctionDef_L26_C0", "label": "retfalse", "type": "function", "loc": [26, 27], "level": 0, "parent": null, "vector": [2, 0, 0.0697, 0.0053, 0, 0.66, 0.9, 71, 0, 0, 1, 0, 0, 0, 0], "semantic": {"name": "retfalse", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def retfalse():\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L27_C4", "label": "return", "type": "return", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L26_C0", "vector": [13, 1, 0.0711, 0.0026, 1, 0.0, 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_99378:ClassDef_L30_C0", "label": "SnakingExplore", "type": "class", "loc": [30, 327], "level": 0, "parent": null, "vector": [3, 0, 0.4697, 0.7842, 0, 0.66, 0.95, 513, 0, 14, 0, 0, 0, 0, 99], "semantic": {"name": "SnakingExplore", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SnakingExplore( ):\n def __init__( self, df, room, start_rad = 1.5, markers_update = lambda x: True ):\n try:\n rospy.init_node( 'SnakingExplore' )\n except:\n pass\n\n self.frame = '/' + room"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "label": "__init__", "type": "function", "loc": [31, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:ClassDef_L30_C0", "vector": [2, 1, 0.1197, 0.0789, 1, 0.47, 0.0, 555, 0, 5, 0, 0, 0, 0, 16], "semantic": {"name": "__init__", "arg_names": ["self", "df", "room", "start_rad", "markers_update"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, df, room, start_rad = 1.5, markers_update = lambda x: True ):\n try:\n rospy.init_node( 'SnakingExplore' )\n except:\n pass\n\n self.frame = '/' + room\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Try_L32_C8", "label": "try", "type": "try", "loc": [32, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "vector": [7, 2, 0.0882, 0.0105, 2, 0.66, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node( 'SnakingExplore' )\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L33_C12", "label": "init_node()", "type": "expression", "loc": [33, 33], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:Try_L32_C8", "vector": [8, 3, 0.0868, 0.0026, 3, 0.8, 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( 'SnakingExplore' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L37_C8", "label": "self.frame =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "vector": [14, 2, 0.0974, 0.0026, 2, 0.66, 0.0667, 409, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.frame = '/' + room"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L39_C8", "label": "self.markers_update =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "vector": [14, 2, 0.1026, 0.0026, 2, 0.66, 0.1333, 349, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.markers_update", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.markers_update = markers_update"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L41_C8", "label": "self.length =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "vector": [14, 2, 0.1079, 0.0026, 2, 0.66, 0.2, 879, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.length", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.length = df[room]['length']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L42_C8", "label": "self.width =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "vector": [14, 2, 0.1105, 0.0026, 2, 0.66, 0.2667, 901, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.width = df[room]['width']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L44_C8", "label": "logout()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "vector": [8, 2, 0.1158, 0.0026, 2, 0.66, 0.3333, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'snaking_explore: Initializing' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L46_C8", "label": "self.listener = TransformListener()", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "vector": [14, 2, 0.1211, 0.0026, 2, 0.66, 0.4, 686, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.listener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L47_C8", "label": "waitForTransform()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "vector": [8, 2, 0.1237, 0.0026, 2, 0.66, 0.4667, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.listener.waitForTransform( '/base_link', '/map', rospy.Time(0), timeout = rospy.Duration(100))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L48_C8", "label": "waitForTransform()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "vector": [8, 2, 0.1263, 0.0026, 2, 0.66, 0.5333, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.listener.waitForTransform( self.frame, '/map', rospy.Time(0), timeout = rospy.Duration(100))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L50_C8", "label": "setup_poses()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "vector": [8, 2, 0.1316, 0.0026, 2, 0.66, 0.6, 64, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setup_poses", "arg_names": [], "import_names": [], "rhs_call_name": "setup_poses", "annotation": ""}, "snippet": " self.setup_poses( radius = start_rad )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L52_C8", "label": "self.client = SimpleActionClient()", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "vector": [14, 2, 0.1368, 0.0026, 2, 0.66, 0.6667, 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( 'move_base', MoveBaseAction )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L53_C8", "label": "wait_for_server()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "vector": [8, 2, 0.1395, 0.0026, 2, 0.66, 0.7333, 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_99378:Assign_L55_C8", "label": "self._service = Service()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "vector": [14, 2, 0.1447, 0.0026, 2, 0.66, 0.8, 143, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self._service", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self._service = rospy.Service( '/explore/explore' , ExploreRoomSrv, self.service_request )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L57_C8", "label": "self._as = SimpleActionServer()", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "vector": [14, 2, 0.15, 0.0026, 2, 0.66, 0.8667, 777, 3, 3, 0, 0, 975, 10, 1], "semantic": {"name": "self._as", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionServer", "annotation": ""}, "snippet": " self._as = actionlib.SimpleActionServer( '/explore', ExploreAction, execute_cb = self.action_request )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L58_C8", "label": "start()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "vector": [8, 2, 0.1526, 0.0026, 2, 0.66, 0.9333, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self._as.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L60_C8", "label": "logout()", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "vector": [8, 2, 0.1579, 0.0026, 2, 0.66, 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( 'snaking_explore: Ready and waiting.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L62_C4", "label": "service_request", "type": "function", "loc": [62, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:ClassDef_L30_C0", "vector": [2, 1, 0.1671, 0.0105, 1, 0.47, 0.1, 396, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "service_request", "arg_names": ["self", "req"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def service_request( self, req ):\n res = self.begin_explore( req.radius )\n rospy.logout( 'snaking_explore: Returning result \\'%s\\'' % res )\n return res "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L63_C8", "label": "res = begin_explore()", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L62_C4", "vector": [14, 2, 0.1658, 0.0026, 2, 0.4, 0.0, 413, 3, 1, 0, 0, 417, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "begin_explore", "annotation": ""}, "snippet": " res = self.begin_explore( req.radius )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L64_C8", "label": "logout()", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L62_C4", "vector": [8, 2, 0.1684, 0.0026, 2, 0.4, 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( 'snaking_explore: Returning result \\'%s\\'' % res )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L65_C8", "label": "return", "type": "return", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L62_C4", "vector": [13, 2, 0.1711, 0.0026, 2, 0.4, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return res "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L67_C4", "label": "action_request", "type": "function", "loc": [67, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:ClassDef_L30_C0", "vector": [2, 1, 0.2039, 0.0579, 1, 0.47, 0.2, 616, 0, 2, 1, 0, 0, 0, 13], "semantic": {"name": "action_request", "arg_names": ["self", "goal"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def action_request( self, goal ):\n rospy.logout( 'snaking_explore: action_request received for radius: \\'%2.2f\\'' % goal.radius )\n \n def preempt_func():\n # self._as should be in scope and bound @ function def. (I think for python...)\n check = self._as.is_preempt_requested()\n if check:\n rospy.logout( 'snaking_explore: action_request preempted!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L68_C8", "label": "logout()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L67_C4", "vector": [8, 2, 0.1789, 0.0026, 2, 0.65, 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( 'snaking_explore: action_request received for radius: \\'%2.2f\\'' % goal.radius )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L70_C8", "label": "preempt_func", "type": "function", "loc": [70, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L67_C4", "vector": [2, 2, 0.1908, 0.0158, 2, 0.65, 0.25, 314, 0, 0, 1, 0, 0, 0, 2], "semantic": {"name": "preempt_func", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def preempt_func():\n # self._as should be in scope and bound @ function def. (I think for python...)\n check = self._as.is_preempt_requested()\n if check:\n rospy.logout( 'snaking_explore: action_request preempted!' )\n return check"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L72_C12", "label": "check = is_preempt_requested()", "type": "assigned_variable", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L70_C8", "vector": [14, 3, 0.1895, 0.0026, 3, 0.33, 0.0, 803, 3, 0, 0, 0, 468, 10, 1], "semantic": {"name": "check", "arg_names": [], "import_names": [], "rhs_call_name": "is_preempt_requested", "annotation": ""}, "snippet": " check = self._as.is_preempt_requested()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L73_C12", "label": "if", "type": "if", "loc": [73, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L70_C8", "vector": [4, 3, 0.1934, 0.0053, 3, 0.33, 0.5, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if check:\n rospy.logout( 'snaking_explore: action_request preempted!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L74_C16", "label": "logout()", "type": "expression", "loc": [74, 74], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L73_C12", "vector": [8, 4, 0.1947, 0.0026, 4, 0.93, 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( 'snaking_explore: action_request preempted!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L75_C12", "label": "return", "type": "return", "loc": [75, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L70_C8", "vector": [13, 3, 0.1974, 0.0026, 3, 0.33, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return check"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L77_C8", "label": "rv = begin_explore()", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L67_C4", "vector": [14, 2, 0.2026, 0.0026, 2, 0.65, 0.5, 222, 3, 2, 0, 0, 417, 10, 1], "semantic": {"name": "rv", "arg_names": [], "import_names": [], "rhs_call_name": "begin_explore", "annotation": ""}, "snippet": " rv = self.begin_explore( goal.radius, preempt_func = preempt_func )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L78_C8", "label": "logout()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L67_C4", "vector": [8, 2, 0.2053, 0.0026, 2, 0.65, 0.75, 525, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'snaking_explore: action_request received result %d' % int(rv) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L80_C8", "label": "if", "type": "if", "loc": [80, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L67_C4", "vector": [4, 2, 0.2211, 0.0237, 2, 0.65, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rv == 'succeeded':\n rospy.logout( 'snaking_explore: returning \\'succeeded\\'' )\n self._as.set_succeeded( ExploreResult() )\n elif rv == 'preempted':\n rospy.logout( 'snaking_explore: returning \\'preempted\\'' )\n self._as.set_preempted( )\n else: # rv == 'aborted'\n rospy.logout( 'snaking_explore: returning \\'aborted\\'' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L81_C12", "label": "logout()", "type": "expression", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L80_C8", "vector": [8, 3, 0.2132, 0.0026, 3, 0.5, 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( 'snaking_explore: returning \\'succeeded\\'' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L82_C12", "label": "set_succeeded()", "type": "expression", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L80_C8", "vector": [8, 3, 0.2158, 0.0026, 3, 0.5, 0.5, 825, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_succeeded", "arg_names": [], "import_names": [], "rhs_call_name": "set_succeeded", "annotation": ""}, "snippet": " self._as.set_succeeded( ExploreResult() )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L83_C8", "label": "if", "type": "if", "loc": [83, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L80_C8", "vector": [4, 3, 0.225, 0.0158, 3, 0.5, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif rv == 'preempted':\n rospy.logout( 'snaking_explore: returning \\'preempted\\'' )\n self._as.set_preempted( )\n else: # rv == 'aborted'\n rospy.logout( 'snaking_explore: returning \\'aborted\\'' )\n self._as.set_aborted()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L84_C12", "label": "logout()", "type": "expression", "loc": [84, 84], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L83_C8", "vector": [8, 4, 0.2211, 0.0026, 4, 0.65, 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( 'snaking_explore: returning \\'preempted\\'' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L85_C12", "label": "set_preempted()", "type": "expression", "loc": [85, 85], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L83_C8", "vector": [8, 4, 0.2237, 0.0026, 4, 0.65, 0.3333, 196, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_preempted", "arg_names": [], "import_names": [], "rhs_call_name": "set_preempted", "annotation": ""}, "snippet": " self._as.set_preempted( )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L87_C12", "label": "logout()", "type": "expression", "loc": [87, 87], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L83_C8", "vector": [8, 4, 0.2289, 0.0026, 4, 0.65, 0.6667, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'snaking_explore: returning \\'aborted\\'' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L88_C12", "label": "set_aborted()", "type": "expression", "loc": [88, 88], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L83_C8", "vector": [8, 4, 0.2316, 0.0026, 4, 0.65, 1.0, 210, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_aborted", "arg_names": [], "import_names": [], "rhs_call_name": "set_aborted", "annotation": ""}, "snippet": " self._as.set_aborted()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L90_C4", "label": "robot_in_map", "type": "function", "loc": [90, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:ClassDef_L30_C0", "vector": [2, 1, 0.2434, 0.0158, 1, 0.47, 0.3, 945, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "robot_in_map", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def robot_in_map( self ):\n ps_base = PoseStamped()\n ps_base.header.frame_id = '/base_link'\n ps_base.header.stamp = rospy.Time(0)\n ps_base.pose.orientation.w = 1.0\n return self.ps_in_map( ps_base )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L91_C8", "label": "ps_base = PoseStamped()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L90_C4", "vector": [14, 2, 0.2395, 0.0026, 2, 0.87, 0.0, 802, 3, 0, 0, 0, 226, 10, 1], "semantic": {"name": "ps_base", "arg_names": [], "import_names": [], "rhs_call_name": "PoseStamped", "annotation": ""}, "snippet": " ps_base = PoseStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L92_C8", "label": "ps_base.header.frame_id =", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L90_C4", "vector": [14, 2, 0.2421, 0.0026, 2, 0.87, 0.25, 445, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ps_base.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps_base.header.frame_id = '/base_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L93_C8", "label": "ps_base.header.stamp = Time()", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L90_C4", "vector": [14, 2, 0.2447, 0.0026, 2, 0.87, 0.5, 800, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "ps_base.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " ps_base.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L94_C8", "label": "ps_base.pose.orientation.w =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L90_C4", "vector": [14, 2, 0.2474, 0.0026, 2, 0.87, 0.75, 13, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "ps_base.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps_base.pose.orientation.w = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L95_C8", "label": "return", "type": "return", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L90_C4", "vector": [13, 2, 0.25, 0.0026, 2, 0.87, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.ps_in_map( ps_base )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L97_C4", "label": "ps_in_map", "type": "function", "loc": [97, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:ClassDef_L30_C0", "vector": [2, 1, 0.2645, 0.0211, 1, 0.47, 0.4, 310, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "ps_in_map", "arg_names": ["self", "ps"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def ps_in_map( self, ps ):\n # ps is pose_stamped\n try:\n ps_map = self.listener.transformPose( '/map', ps )\n except:\n rospy.logout( 'snaking_explore: %s -> map Transform failed.' % ps.header.frame_id )\n ps_map = None\n return ps_map"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Try_L99_C8", "label": "try", "type": "try", "loc": [99, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L97_C4", "vector": [7, 2, 0.2658, 0.0132, 2, 0.56, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n ps_map = self.listener.transformPose( '/map', ps )\n except:\n rospy.logout( 'snaking_explore: %s -> map Transform failed.' % ps.header.frame_id )\n ps_map = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L100_C12", "label": "ps_map = transformPose()", "type": "assigned_variable", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:Try_L99_C8", "vector": [14, 3, 0.2632, 0.0026, 3, 0.27, 0.0, 938, 3, 2, 0, 0, 654, 10, 1], "semantic": {"name": "ps_map", "arg_names": [], "import_names": [], "rhs_call_name": "transformPose", "annotation": ""}, "snippet": " ps_map = self.listener.transformPose( '/map', ps )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L102_C12", "label": "logout()", "type": "expression", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:Try_L99_C8", "vector": [8, 3, 0.2684, 0.0026, 3, 0.27, 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( 'snaking_explore: %s -> map Transform failed.' % ps.header.frame_id )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L103_C12", "label": "ps_map =", "type": "assigned_variable", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:Try_L99_C8", "vector": [14, 3, 0.2711, 0.0026, 3, 0.27, 1.0, 938, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "ps_map", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps_map = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L104_C8", "label": "return", "type": "return", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L97_C4", "vector": [13, 2, 0.2737, 0.0026, 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 ps_map"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L106_C4", "label": "range_to_waypoint", "type": "function", "loc": [106, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:ClassDef_L30_C0", "vector": [2, 1, 0.2829, 0.0105, 1, 0.47, 0.5, 533, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "range_to_waypoint", "arg_names": ["self", "r", "w"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def range_to_waypoint( self, r, w ):\n # r => robot in map, w => waypoint in map\n return np.sqrt( (r.pose.position.x - w.pose.position.x)**2.0 +\n (r.pose.position.y - w.pose.position.y)**2.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L108_C8", "label": "return", "type": "return", "loc": [108, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L106_C4", "vector": [13, 2, 0.2855, 0.0053, 2, 0.07, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.sqrt( (r.pose.position.x - w.pose.position.x)**2.0 +\n (r.pose.position.y - w.pose.position.y)**2.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "label": "begin_explore", "type": "function", "loc": [111, 244], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:ClassDef_L30_C0", "vector": [2, 1, 0.4671, 0.3526, 1, 0.47, 0.6, 417, 0, 3, 1, 0, 0, 0, 60], "semantic": {"name": "begin_explore", "arg_names": ["self", "radius", "preempt_func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def begin_explore( self, radius, preempt_func = retfalse ):\n rospy.logout( 'snaking_explore: setting radius' )\n \n waypoints = self.setup_poses( radius ) # PoseStamped in self.frame\n\n local_planner = rospy.get_param('/move_base_node/base_local_planner') # : dwa_local_planner/DWAPlannerROS\n local_planner = local_planner[string.find(local_planner,'/')+1:]\n obs_range = rospy.get_param('/move_base_node/global_costmap/obstacle_range')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L112_C8", "label": "logout()", "type": "expression", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "vector": [8, 2, 0.2947, 0.0026, 2, 0.76, 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( 'snaking_explore: setting radius' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L114_C8", "label": "waypoints = setup_poses()", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "vector": [14, 2, 0.3, 0.0026, 2, 0.76, 0.0714, 971, 3, 1, 0, 0, 64, 10, 1], "semantic": {"name": "waypoints", "arg_names": [], "import_names": [], "rhs_call_name": "setup_poses", "annotation": ""}, "snippet": " waypoints = self.setup_poses( radius ) # PoseStamped in self.frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L116_C8", "label": "local_planner = get_param()", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "vector": [14, 2, 0.3053, 0.0026, 2, 0.76, 0.1429, 551, 3, 1, 0, 0, 427, 10, 1], "semantic": {"name": "local_planner", "arg_names": [], "import_names": [], "rhs_call_name": "get_param", "annotation": ""}, "snippet": " local_planner = rospy.get_param('/move_base_node/base_local_planner') # : dwa_local_planner/DWAPlannerROS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L117_C8", "label": "local_planner =", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "vector": [14, 2, 0.3079, 0.0026, 2, 0.76, 0.2143, 551, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "local_planner", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " local_planner = local_planner[string.find(local_planner,'/')+1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L118_C8", "label": "obs_range = get_param()", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "vector": [14, 2, 0.3105, 0.0026, 2, 0.76, 0.2857, 421, 3, 1, 0, 0, 427, 10, 1], "semantic": {"name": "obs_range", "arg_names": [], "import_names": [], "rhs_call_name": "get_param", "annotation": ""}, "snippet": " obs_range = rospy.get_param('/move_base_node/global_costmap/obstacle_range')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L119_C8", "label": "move_tol = get_param()", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "vector": [14, 2, 0.3132, 0.0026, 2, 0.76, 0.3571, 260, 3, 1, 0, 0, 427, 10, 1], "semantic": {"name": "move_tol", "arg_names": [], "import_names": [], "rhs_call_name": "get_param", "annotation": ""}, "snippet": " move_tol = rospy.get_param('/move_base_node/'+local_planner+'/xy_goal_tolerance')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L120_C8", "label": "no_progress = get_param()", "type": "assigned_variable", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "vector": [14, 2, 0.3158, 0.0026, 2, 0.76, 0.4286, 3, 3, 2, 0, 0, 427, 10, 2], "semantic": {"name": "no_progress", "arg_names": [], "import_names": [], "rhs_call_name": "get_param", "annotation": ""}, "snippet": " no_progress = rospy.get_param( rospy.get_name() + '/no_progress_move', 5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L121_C8", "label": "unreached_time = get_param()", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "vector": [14, 2, 0.3184, 0.0026, 2, 0.76, 0.5, 676, 3, 2, 0, 0, 427, 10, 2], "semantic": {"name": "unreached_time", "arg_names": [], "import_names": [], "rhs_call_name": "get_param", "annotation": ""}, "snippet": " unreached_time = rospy.get_param( rospy.get_name() + '/not_reached_move', 30)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L128_C8", "label": "srv_name =", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "vector": [14, 2, 0.3368, 0.0026, 2, 0.76, 0.5714, 114, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "srv_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " srv_name = '/move_base_node/NavfnROS/make_plan'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L129_C8", "label": "get_plan = ServiceProxy()", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "vector": [14, 2, 0.3395, 0.0026, 2, 0.76, 0.6429, 550, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "get_plan", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " get_plan = rospy.ServiceProxy( srv_name, GetPlan )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L133_C8", "label": "if", "type": "if", "loc": [133, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "vector": [4, 2, 0.3513, 0.0053, 2, 0.76, 0.7143, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if preempt_func(): # immediately exit if overall action preempted\n return 'preempted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L134_C12", "label": "return", "type": "return", "loc": [134, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L133_C8", "vector": [13, 3, 0.3526, 0.0026, 3, 0.19, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'preempted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "label": "for i, w", "type": "for", "loc": [136, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "vector": [6, 2, 0.4934, 0.2737, 2, 0.76, 0.7857, 517, 3, 0, 0, 0, 0, 0, 46], "semantic": {"name": "i, w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,w in enumerate( waypoints ):\n if preempt_func(): # immediately exit if overall action preempted\n return 'preempted'\n\n rospy.logout( 'snaking_explore: Seeking waypoint %d of %d' % (i+1,len(waypoints)))\n # rospy.logout( 'snaking_explore: %2.2f %2.2f in frame %s' % (w.pose.position.x, w.pose.position.y, w.header.frame_id))\n\n rim = self.robot_in_map()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L137_C12", "label": "if", "type": "if", "loc": [137, 138], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "vector": [4, 3, 0.3618, 0.0053, 3, 0.4, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if preempt_func(): # immediately exit if overall action preempted\n return 'preempted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L138_C16", "label": "return", "type": "return", "loc": [138, 138], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L137_C12", "vector": [13, 4, 0.3632, 0.0026, 4, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'preempted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L140_C12", "label": "logout()", "type": "expression", "loc": [140, 140], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "vector": [8, 3, 0.3684, 0.0026, 3, 0.4, 0.0588, 525, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'snaking_explore: Seeking waypoint %d of %d' % (i+1,len(waypoints)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L143_C12", "label": "rim = robot_in_map()", "type": "assigned_variable", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "vector": [14, 3, 0.3763, 0.0026, 3, 0.4, 0.1176, 283, 3, 0, 0, 0, 945, 10, 1], "semantic": {"name": "rim", "arg_names": [], "import_names": [], "rhs_call_name": "robot_in_map", "annotation": ""}, "snippet": " rim = self.robot_in_map()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L144_C12", "label": "w.header.stamp = Time()", "type": "assigned_variable", "loc": [144, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "vector": [14, 3, 0.3789, 0.0026, 3, 0.4, 0.1765, 806, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "w.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " w.header.stamp = rospy.Time(0) # transform it _now_"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L145_C12", "label": "wim = ps_in_map()", "type": "assigned_variable", "loc": [145, 145], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "vector": [14, 3, 0.3816, 0.0026, 3, 0.4, 0.2353, 482, 3, 1, 0, 0, 310, 10, 1], "semantic": {"name": "wim", "arg_names": [], "import_names": [], "rhs_call_name": "ps_in_map", "annotation": ""}, "snippet": " wim = self.ps_in_map( w ) # waypoint in map"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L147_C12", "label": "if", "type": "if", "loc": [147, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "vector": [4, 3, 0.3895, 0.0079, 3, 0.4, 0.2941, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not rim or not wim: # if transforms failed\n rospy.logout( 'snaking_explore: Bad transforms. Aborting explore' )\n return 'aborted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L148_C16", "label": "logout()", "type": "expression", "loc": [148, 148], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L147_C12", "vector": [8, 4, 0.3895, 0.0026, 4, 0.98, 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( 'snaking_explore: Bad transforms. Aborting explore' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L149_C16", "label": "return", "type": "return", "loc": [149, 149], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L147_C12", "vector": [13, 4, 0.3921, 0.0026, 4, 0.98, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'aborted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L151_C12", "label": "if", "type": "if", "loc": [151, 174], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "vector": [4, 3, 0.4276, 0.0632, 3, 0.4, 0.3529, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.range_to_waypoint( rim, wim ) < 0.9 * obs_range:\n # We're nearby the waypoint, so we'll just trust that the planner\n # has a good view of its surroundings to determine reachability.\n\n req = GetPlanRequest()\n req.tolerance = 0.1\n req.start = rim\n req.goal = wim"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L155_C16", "label": "req = GetPlanRequest()", "type": "assigned_variable", "loc": [155, 155], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L151_C12", "vector": [14, 4, 0.4079, 0.0026, 4, 0.45, 0.0, 233, 3, 0, 0, 0, 250, 10, 1], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "GetPlanRequest", "annotation": ""}, "snippet": " req = GetPlanRequest()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L156_C16", "label": "req.tolerance =", "type": "assigned_variable", "loc": [156, 156], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L151_C12", "vector": [14, 4, 0.4105, 0.0026, 4, 0.45, 0.125, 836, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "req.tolerance", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req.tolerance = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L157_C16", "label": "req.start =", "type": "assigned_variable", "loc": [157, 157], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L151_C12", "vector": [14, 4, 0.4132, 0.0026, 4, 0.45, 0.25, 532, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "req.start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req.start = rim"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L158_C16", "label": "req.goal =", "type": "assigned_variable", "loc": [158, 158], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L151_C12", "vector": [14, 4, 0.4158, 0.0026, 4, 0.45, 0.375, 249, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "req.goal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req.goal = wim"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L159_C16", "label": "resp = get_plan()", "type": "assigned_variable", "loc": [159, 159], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L151_C12", "vector": [14, 4, 0.4184, 0.0026, 4, 0.45, 0.5, 48, 3, 1, 0, 0, 550, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "get_plan", "annotation": ""}, "snippet": " resp = get_plan( req )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L160_C16", "label": "found_plan = bool()", "type": "assigned_variable", "loc": [160, 160], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L151_C12", "vector": [14, 4, 0.4211, 0.0026, 4, 0.45, 0.625, 729, 3, 1, 0, 0, 337, 10, 1], "semantic": {"name": "found_plan", "arg_names": [], "import_names": [], "rhs_call_name": "bool", "annotation": ""}, "snippet": " found_plan = bool( resp.plan.poses != [] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L162_C16", "label": "if", "type": "if", "loc": [162, 165], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L151_C12", "vector": [4, 4, 0.4303, 0.0105, 4, 0.45, 0.75, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not found_plan:\n rospy.logout( 'snaking_explore: No plan to nearby waypoint. Proceeding to next waypoint' )\n # Perhaps its worth pulling the waypoint closer until a path _is_ found?\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L163_C20", "label": "logout()", "type": "expression", "loc": [163, 163], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L162_C16", "vector": [8, 5, 0.4289, 0.0026, 5, 0.8, 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( 'snaking_explore: No plan to nearby waypoint. Proceeding to next waypoint' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L168_C16", "label": "logout()", "type": "expression", "loc": [168, 168], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L151_C12", "vector": [8, 4, 0.4421, 0.0026, 4, 0.45, 0.875, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'snaking_explore: Near by with good plan. Calling move_base action.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L174_C16", "label": "logout()", "type": "expression", "loc": [174, 174], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L151_C12", "vector": [8, 4, 0.4579, 0.0026, 4, 0.45, 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( 'snaking_explore: Far away. Calling move_base action.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L179_C12", "label": "cancel_goals_at_and_before_time()", "type": "expression", "loc": [179, 179], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "vector": [8, 3, 0.4711, 0.0026, 3, 0.4, 0.4118, 902, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "cancel_goals_at_and_before_time", "arg_names": [], "import_names": [], "rhs_call_name": "cancel_goals_at_and_before_time", "annotation": ""}, "snippet": " self.client.cancel_goals_at_and_before_time( rospy.Time.now() )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L180_C12", "label": "if", "type": "if", "loc": [180, 182], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "vector": [4, 3, 0.4763, 0.0079, 3, 0.4, 0.4706, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.environ.has_key('ROBOT') and os.environ['ROBOT'] == 'sim':\n rospy.logout( 'running in sim: give the system a little time to respond' )\n rospy.sleep( 1 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L181_C16", "label": "logout()", "type": "expression", "loc": [181, 181], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L180_C12", "vector": [8, 4, 0.4763, 0.0026, 4, 0.1, 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( 'running in sim: give the system a little time to respond' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L182_C16", "label": "sleep()", "type": "expression", "loc": [182, 182], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L180_C12", "vector": [8, 4, 0.4789, 0.0026, 4, 0.1, 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( 1 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L185_C12", "label": "logout()", "type": "expression", "loc": [185, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "vector": [8, 3, 0.4868, 0.0026, 3, 0.4, 0.5294, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'snaking_explore: sending movebase action goal.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L186_C12", "label": "move_goal = MoveBaseGoal()", "type": "assigned_variable", "loc": [186, 186], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "vector": [14, 3, 0.4895, 0.0026, 3, 0.4, 0.5882, 242, 3, 0, 0, 0, 968, 10, 1], "semantic": {"name": "move_goal", "arg_names": [], "import_names": [], "rhs_call_name": "MoveBaseGoal", "annotation": ""}, "snippet": " move_goal = MoveBaseGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L187_C12", "label": "move_goal.target_pose =", "type": "assigned_variable", "loc": [187, 187], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "vector": [14, 3, 0.4921, 0.0026, 3, 0.4, 0.6471, 856, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "move_goal.target_pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " move_goal.target_pose = wim"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L188_C12", "label": "send_goal()", "type": "expression", "loc": [188, 188], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "vector": [8, 3, 0.4947, 0.0026, 3, 0.4, 0.7059, 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( move_goal )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L189_C12", "label": "if", "type": "if", "loc": [189, 191], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "vector": [4, 3, 0.5, 0.0079, 3, 0.4, 0.7647, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.environ.has_key('ROBOT') and os.environ['ROBOT'] == 'sim':\n rospy.logout( 'running in sim: give the system a little time to respond' )\n rospy.sleep( 1 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L190_C16", "label": "logout()", "type": "expression", "loc": [190, 190], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L189_C12", "vector": [8, 4, 0.5, 0.0026, 4, 0.0, 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( 'running in sim: give the system a little time to respond' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L191_C16", "label": "sleep()", "type": "expression", "loc": [191, 191], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L189_C12", "vector": [8, 4, 0.5026, 0.0026, 4, 0.0, 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( 1 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L201_C12", "label": "r = Rate()", "type": "assigned_variable", "loc": [201, 201], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "vector": [14, 3, 0.5289, 0.0026, 3, 0.4, 0.8235, 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_99378:Assign_L202_C12", "label": "xytt_old =", "type": "assigned_variable", "loc": [202, 202], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "vector": [14, 3, 0.5316, 0.0026, 3, 0.4, 0.8824, 119, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "xytt_old", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xytt_old = None # Checks for movement"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L203_C12", "label": "stime = to_sec()", "type": "assigned_variable", "loc": [203, 203], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "vector": [14, 3, 0.5342, 0.0026, 3, 0.4, 0.9412, 971, 3, 0, 0, 0, 750, 10, 2], "semantic": {"name": "stime", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " stime = rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:While_L204_C12", "label": "while", "type": "while", "loc": [204, 239], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "vector": [5, 3, 0.5829, 0.0947, 3, 0.4, 1.0, 0, 1, 0, 0, 0, 0, 0, 17], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while True:\n if self.client.simple_state == SimpleGoalState.DONE:\n res = self.client.get_result()\n rospy.logout('snaking_explore: Movebase actionlib completed with result. Proceeding to next waypoint')\n break\n\n rim = self.robot_in_map()\n w.header.stamp = rospy.Time( 0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L205_C16", "label": "if", "type": "if", "loc": [205, 208], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:While_L204_C12", "vector": [4, 4, 0.5434, 0.0105, 4, 0.75, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.client.simple_state == SimpleGoalState.DONE:\n res = self.client.get_result()\n rospy.logout('snaking_explore: Movebase actionlib completed with result. Proceeding to next waypoint')\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L206_C20", "label": "res = get_result()", "type": "assigned_variable", "loc": [206, 206], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L205_C16", "vector": [14, 5, 0.5421, 0.0026, 5, 0.85, 0.0, 413, 3, 0, 0, 0, 569, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "get_result", "annotation": ""}, "snippet": " res = self.client.get_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L207_C20", "label": "logout()", "type": "expression", "loc": [207, 207], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L205_C16", "vector": [8, 5, 0.5447, 0.0026, 5, 0.85, 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('snaking_explore: Movebase actionlib completed with result. Proceeding to next waypoint')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L210_C16", "label": "rim = robot_in_map()", "type": "assigned_variable", "loc": [210, 210], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:While_L204_C12", "vector": [14, 4, 0.5526, 0.0026, 4, 0.75, 0.1429, 283, 3, 0, 0, 0, 945, 10, 1], "semantic": {"name": "rim", "arg_names": [], "import_names": [], "rhs_call_name": "robot_in_map", "annotation": ""}, "snippet": " rim = self.robot_in_map()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L211_C16", "label": "w.header.stamp = Time()", "type": "assigned_variable", "loc": [211, 211], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:While_L204_C12", "vector": [14, 4, 0.5553, 0.0026, 4, 0.75, 0.2857, 806, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "w.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " w.header.stamp = rospy.Time( 0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L212_C16", "label": "wim = ps_in_map()", "type": "assigned_variable", "loc": [212, 212], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:While_L204_C12", "vector": [14, 4, 0.5579, 0.0026, 4, 0.75, 0.4286, 482, 3, 1, 0, 0, 310, 10, 1], "semantic": {"name": "wim", "arg_names": [], "import_names": [], "rhs_call_name": "ps_in_map", "annotation": ""}, "snippet": " wim = self.ps_in_map( w )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L215_C16", "label": "if", "type": "if", "loc": [215, 218], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:While_L204_C12", "vector": [4, 4, 0.5697, 0.0105, 4, 0.75, 0.5714, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rim and wim: # only do this check if transform succeeds\n if self.range_to_waypoint( rim, wim ) < move_tol * 2.0:\n rospy.logout( 'snaking_explore: Close enough to waypoint. Proceeding to next waypoint' )\n break # We're near the waypoint, so let's must move on to next"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L216_C20", "label": "if", "type": "if", "loc": [216, 218], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L215_C16", "vector": [4, 5, 0.5711, 0.0079, 5, 0.22, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.range_to_waypoint( rim, wim ) < move_tol * 2.0:\n rospy.logout( 'snaking_explore: Close enough to waypoint. Proceeding to next waypoint' )\n break # We're near the waypoint, so let's must move on to next"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L217_C24", "label": "logout()", "type": "expression", "loc": [217, 217], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L216_C20", "vector": [8, 6, 0.5711, 0.0026, 6, 0.68, 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( 'snaking_explore: Close enough to waypoint. Proceeding to next waypoint' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L221_C16", "label": "if", "type": "if", "loc": [221, 233], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:While_L204_C12", "vector": [4, 4, 0.5974, 0.0342, 4, 0.75, 0.7143, 0, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rim: # only do this check if transform succeeds\n xytt = self.xythetatime( rim )\n if not xytt_old:\n xytt_old = xytt\n\n if np.abs( xytt[0] - xytt_old[0] ) > 0.05 or \\\n np.abs( xytt[1] - xytt_old[1] ) > 0.05 or \\\n np.abs( xytt[2] - xytt_old[2] ) > math.radians(10):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L222_C20", "label": "xytt = xythetatime()", "type": "assigned_variable", "loc": [222, 222], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L221_C16", "vector": [14, 5, 0.5842, 0.0026, 5, 0.36, 0.0, 495, 3, 1, 0, 0, 437, 10, 1], "semantic": {"name": "xytt", "arg_names": [], "import_names": [], "rhs_call_name": "xythetatime", "annotation": ""}, "snippet": " xytt = self.xythetatime( rim )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L223_C20", "label": "if", "type": "if", "loc": [223, 224], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L221_C16", "vector": [4, 5, 0.5882, 0.0053, 5, 0.36, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not xytt_old:\n xytt_old = xytt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L224_C24", "label": "xytt_old =", "type": "assigned_variable", "loc": [224, 224], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L223_C20", "vector": [14, 6, 0.5895, 0.0026, 6, 0.58, 0.0, 119, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xytt_old", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xytt_old = xytt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L226_C20", "label": "if", "type": "if", "loc": [226, 229], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L221_C16", "vector": [4, 5, 0.5987, 0.0105, 5, 0.36, 0.6667, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.abs( xytt[0] - xytt_old[0] ) > 0.05 or \\\n np.abs( xytt[1] - xytt_old[1] ) > 0.05 or \\\n np.abs( xytt[2] - xytt_old[2] ) > math.radians(10):\n xytt_old = xytt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L229_C24", "label": "xytt_old =", "type": "assigned_variable", "loc": [229, 229], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L226_C20", "vector": [14, 6, 0.6026, 0.0026, 6, 0.82, 0.0, 119, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xytt_old", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xytt_old = xytt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L231_C20", "label": "if", "type": "if", "loc": [231, 233], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L221_C16", "vector": [4, 5, 0.6105, 0.0079, 5, 0.36, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if xytt[3] - xytt_old[3] > no_progress:\n rospy.logout( 'snaking_explore: No movement in %2.1f seconds. Proceeding to next waypoint' % no_progress )\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L232_C24", "label": "logout()", "type": "expression", "loc": [232, 232], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L231_C20", "vector": [8, 6, 0.6105, 0.0026, 6, 0.57, 0.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'snaking_explore: No movement in %2.1f seconds. Proceeding to next waypoint' % no_progress )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L235_C16", "label": "if", "type": "if", "loc": [235, 237], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:While_L204_C12", "vector": [4, 4, 0.6211, 0.0079, 4, 0.75, 0.8571, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rospy.Time.now().to_sec() - stime > unreached_time:\n rospy.logout( 'snaking_explore: Goal unreached in %2.1f seconds. Proceeding to next waypoint' % unreached_time )\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L236_C24", "label": "logout()", "type": "expression", "loc": [236, 236], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L235_C16", "vector": [8, 5, 0.6211, 0.0026, 5, 0.93, 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( 'snaking_explore: Goal unreached in %2.1f seconds. Proceeding to next waypoint' % unreached_time )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L239_C16", "label": "sleep()", "type": "expression", "loc": [239, 239], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:While_L204_C12", "vector": [8, 4, 0.6289, 0.0026, 4, 0.75, 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_99378:Expr_L241_C8", "label": "cancel_all_goals()", "type": "expression", "loc": [241, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "vector": [8, 2, 0.6342, 0.0026, 2, 0.76, 0.8571, 699, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel_all_goals", "arg_names": [], "import_names": [], "rhs_call_name": "cancel_all_goals", "annotation": ""}, "snippet": " self.client.cancel_all_goals()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L242_C8", "label": "logout()", "type": "expression", "loc": [242, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "vector": [8, 2, 0.6368, 0.0026, 2, 0.76, 0.9286, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'snaking_explore: Finished with exploration.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L244_C8", "label": "return", "type": "return", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "vector": [13, 2, 0.6421, 0.0026, 2, 0.76, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'succeeded'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L246_C4", "label": "xythetatime", "type": "function", "loc": [246, 249], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:ClassDef_L30_C0", "vector": [2, 1, 0.6513, 0.0105, 1, 0.47, 0.7, 437, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "xythetatime", "arg_names": ["self", "ps"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def xythetatime( self, ps ):\n o = ps.pose.orientation\n r,p,y = tft.euler_from_quaternion(( o.x, o.y, o.z, o.w ))\n return ps.pose.position.x, ps.pose.position.y, y, rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L247_C8", "label": "o =", "type": "assigned_variable", "loc": [247, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L246_C4", "vector": [14, 2, 0.65, 0.0026, 2, 0.11, 0.0, 926, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "o", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " o = ps.pose.orientation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L248_C8", "label": "r, p, y = euler_from_quaternion()", "type": "assigned_variable", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L246_C4", "vector": [14, 2, 0.6526, 0.0026, 2, 0.11, 0.5, 387, 3, 1, 0, 0, 409, 10, 1], "semantic": {"name": "r, p, y", "arg_names": [], "import_names": [], "rhs_call_name": "euler_from_quaternion", "annotation": ""}, "snippet": " r,p,y = tft.euler_from_quaternion(( o.x, o.y, o.z, o.w ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L249_C8", "label": "return", "type": "return", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L246_C4", "vector": [13, 2, 0.6553, 0.0026, 2, 0.11, 1.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ps.pose.position.x, ps.pose.position.y, y, rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L251_C4", "label": "setup_poses", "type": "function", "loc": [251, 255], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:ClassDef_L30_C0", "vector": [2, 1, 0.6658, 0.0132, 1, 0.47, 0.8, 64, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "setup_poses", "arg_names": ["self", "radius"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setup_poses( self, radius ):\n # poses = self.setup_poses_xonly( radius )\n poses = self.setup_poses_snaking( radius )\n self.markers_update( poses )\n return poses"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L253_C8", "label": "poses = setup_poses_snaking()", "type": "assigned_variable", "loc": [253, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L251_C4", "vector": [14, 2, 0.6658, 0.0026, 2, 0.59, 0.0, 415, 3, 1, 0, 0, 207, 10, 1], "semantic": {"name": "poses", "arg_names": [], "import_names": [], "rhs_call_name": "setup_poses_snaking", "annotation": ""}, "snippet": " poses = self.setup_poses_snaking( radius )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L254_C8", "label": "markers_update()", "type": "expression", "loc": [254, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L251_C4", "vector": [8, 2, 0.6684, 0.0026, 2, 0.59, 0.5, 839, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "markers_update", "arg_names": [], "import_names": [], "rhs_call_name": "markers_update", "annotation": ""}, "snippet": " self.markers_update( poses )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L255_C8", "label": "return", "type": "return", "loc": [255, 255], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L251_C4", "vector": [13, 2, 0.6711, 0.0026, 2, 0.59, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return poses"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "label": "setup_poses_snaking", "type": "function", "loc": [257, 306], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:ClassDef_L30_C0", "vector": [2, 1, 0.7408, 0.1316, 1, 0.47, 0.9, 207, 0, 2, 1, 0, 0, 0, 20], "semantic": {"name": "setup_poses_snaking", "arg_names": ["self", "radius"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setup_poses_snaking( self, radius ):\n # tt are the min's and maxes of the snake along x-axis\n cycles = np.ceil( self.length / radius )\n tt = np.linspace( 0.0, self.length, 2 * cycles + 1 )\n\n # Determine waypoints at crest and valleys (lengthwise)\n crests = []\n atmin = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L259_C8", "label": "cycles = ceil()", "type": "assigned_variable", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "vector": [14, 2, 0.6816, 0.0026, 2, 0.91, 0.0, 528, 3, 1, 0, 0, 211, 10, 1], "semantic": {"name": "cycles", "arg_names": [], "import_names": [], "rhs_call_name": "ceil", "annotation": ""}, "snippet": " cycles = np.ceil( self.length / radius )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L260_C8", "label": "tt = linspace()", "type": "assigned_variable", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "vector": [14, 2, 0.6842, 0.0026, 2, 0.91, 0.0714, 266, 3, 3, 0, 0, 119, 10, 1], "semantic": {"name": "tt", "arg_names": [], "import_names": [], "rhs_call_name": "linspace", "annotation": ""}, "snippet": " tt = np.linspace( 0.0, self.length, 2 * cycles + 1 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L263_C8", "label": "crests =", "type": "assigned_variable", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "vector": [14, 2, 0.6921, 0.0026, 2, 0.91, 0.1429, 684, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "crests", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " crests = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L264_C8", "label": "atmin =", "type": "assigned_variable", "loc": [264, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "vector": [14, 2, 0.6947, 0.0026, 2, 0.91, 0.2143, 36, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "atmin", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " atmin = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L265_C8", "label": "for xx", "type": "for", "loc": [265, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "vector": [6, 2, 0.7013, 0.0105, 2, 0.91, 0.2857, 333, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "xx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for xx in tt:\n atmin = not atmin # alternate between ys = 0 and ys = width\n yy = float( atmin ) * self.width\n crests.append( (xx, yy) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L266_C12", "label": "atmin =", "type": "assigned_variable", "loc": [266, 266], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L265_C8", "vector": [14, 3, 0.7, 0.0026, 3, 0.75, 0.0, 36, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "atmin", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " atmin = not atmin # alternate between ys = 0 and ys = width"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L267_C12", "label": "yy =", "type": "assigned_variable", "loc": [267, 267], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L265_C8", "vector": [14, 3, 0.7026, 0.0026, 3, 0.75, 0.5, 198, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "yy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yy = float( atmin ) * self.width"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L268_C12", "label": "append()", "type": "expression", "loc": [268, 268], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L265_C8", "vector": [8, 3, 0.7053, 0.0026, 3, 0.75, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " crests.append( (xx, yy) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L271_C8", "label": "xyinter =", "type": "assigned_variable", "loc": [271, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "vector": [14, 2, 0.7132, 0.0026, 2, 0.91, 0.3571, 788, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "xyinter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xyinter = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L272_C8", "label": "inter = ceil()", "type": "assigned_variable", "loc": [272, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "vector": [14, 2, 0.7158, 0.0026, 2, 0.91, 0.4286, 700, 3, 1, 0, 0, 211, 10, 1], "semantic": {"name": "inter", "arg_names": [], "import_names": [], "rhs_call_name": "ceil", "annotation": ""}, "snippet": " inter = np.ceil( self.width / radius )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L273_C8", "label": "x_next, y_next =", "type": "assigned_variable", "loc": [273, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "vector": [14, 2, 0.7184, 0.0026, 2, 0.91, 0.5, 935, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "x_next, y_next", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_next, y_next = 0.0, 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L274_C8", "label": "for i", "type": "for", "loc": [274, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "vector": [6, 2, 0.7329, 0.0263, 2, 0.91, 0.5714, 826, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange( len(crests) - 1 ):\n x_prev = crests[i][0]\n y_prev = crests[i][1]\n x_next = crests[i+1][0]\n y_next = crests[i+1][1]\n \n x_inter = np.linspace( x_prev, x_next, inter * 2, endpoint = False )\n y_inter = np.linspace( y_prev, y_next, inter * 2, endpoint = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L275_C12", "label": "x_prev =", "type": "assigned_variable", "loc": [275, 275], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L274_C8", "vector": [14, 3, 0.7237, 0.0026, 3, 0.9, 0.0, 612, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_prev", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_prev = crests[i][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L276_C12", "label": "y_prev =", "type": "assigned_variable", "loc": [276, 276], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L274_C8", "vector": [14, 3, 0.7263, 0.0026, 3, 0.9, 0.2, 693, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y_prev", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_prev = crests[i][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L277_C12", "label": "x_next =", "type": "assigned_variable", "loc": [277, 277], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L274_C8", "vector": [14, 3, 0.7289, 0.0026, 3, 0.9, 0.4, 632, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_next", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_next = crests[i+1][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L278_C12", "label": "y_next =", "type": "assigned_variable", "loc": [278, 278], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L274_C8", "vector": [14, 3, 0.7316, 0.0026, 3, 0.9, 0.6, 127, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y_next", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_next = crests[i+1][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L280_C12", "label": "x_inter = linspace()", "type": "assigned_variable", "loc": [280, 280], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L274_C8", "vector": [14, 3, 0.7368, 0.0026, 3, 0.9, 0.8, 562, 3, 4, 0, 0, 119, 10, 1], "semantic": {"name": "x_inter", "arg_names": [], "import_names": [], "rhs_call_name": "linspace", "annotation": ""}, "snippet": " x_inter = np.linspace( x_prev, x_next, inter * 2, endpoint = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L281_C12", "label": "y_inter = linspace()", "type": "assigned_variable", "loc": [281, 281], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L274_C8", "vector": [14, 3, 0.7395, 0.0026, 3, 0.9, 1.0, 291, 3, 4, 0, 0, 119, 10, 1], "semantic": {"name": "y_inter", "arg_names": [], "import_names": [], "rhs_call_name": "linspace", "annotation": ""}, "snippet": " y_inter = np.linspace( y_prev, y_next, inter * 2, endpoint = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L287_C8", "label": "xytheta =", "type": "assigned_variable", "loc": [287, 287], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "vector": [14, 2, 0.7553, 0.0026, 2, 0.91, 0.6429, 249, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "xytheta", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xytheta = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L288_C8", "label": "add_xytheta", "type": "function", "loc": [288, 297], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "vector": [2, 2, 0.7697, 0.0263, 2, 0.91, 0.7143, 16, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "add_xytheta", "arg_names": ["x", "y", "t"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_xytheta( x, y, t ):\n ps = PoseStamped()\n ps.header.frame_id = self.frame\n ps.header.stamp = rospy.Time(0)\n\n ps.pose.position.x = x\n ps.pose.position.y = y\n ps.pose.orientation = Quaternion( *tft.quaternion_from_euler( 0.0, 0.0, t ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L289_C12", "label": "ps = PoseStamped()", "type": "assigned_variable", "loc": [289, 289], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L288_C8", "vector": [14, 3, 0.7605, 0.0026, 3, 0.58, 0.0, 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_99378:Assign_L290_C12", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [290, 290], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L288_C8", "vector": [14, 3, 0.7632, 0.0026, 3, 0.58, 0.1667, 293, 7, 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 = self.frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L291_C12", "label": "ps.header.stamp = Time()", "type": "assigned_variable", "loc": [291, 291], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L288_C8", "vector": [14, 3, 0.7658, 0.0026, 3, 0.58, 0.3333, 161, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " ps.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L293_C12", "label": "ps.pose.position.x =", "type": "assigned_variable", "loc": [293, 293], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L288_C8", "vector": [14, 3, 0.7711, 0.0026, 3, 0.58, 0.5, 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_99378:Assign_L294_C12", "label": "ps.pose.position.y =", "type": "assigned_variable", "loc": [294, 294], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L288_C8", "vector": [14, 3, 0.7737, 0.0026, 3, 0.58, 0.6667, 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_99378:Assign_L295_C12", "label": "ps.pose.orientation = Quaternion()", "type": "assigned_variable", "loc": [295, 295], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L288_C8", "vector": [14, 3, 0.7763, 0.0026, 3, 0.58, 0.8333, 670, 3, 1, 0, 0, 747, 10, 2], "semantic": {"name": "ps.pose.orientation", "arg_names": [], "import_names": [], "rhs_call_name": "Quaternion", "annotation": ""}, "snippet": " ps.pose.orientation = Quaternion( *tft.quaternion_from_euler( 0.0, 0.0, t ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L297_C12", "label": "append()", "type": "expression", "loc": [297, 297], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L288_C8", "vector": [8, 3, 0.7816, 0.0026, 3, 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": " xytheta.append( ps )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L299_C8", "label": "theta =", "type": "assigned_variable", "loc": [299, 299], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "vector": [14, 2, 0.7868, 0.0026, 2, 0.91, 0.7857, 729, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "theta", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " theta = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L300_C8", "label": "for i", "type": "for", "loc": [300, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "vector": [6, 2, 0.7934, 0.0105, 2, 0.91, 0.8571, 826, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange( len(xyinter) - 1 ):\n theta = np.arctan2( xyinter[i+1][1] - xyinter[i][1],\n xyinter[i+1][0] - xyinter[i][0] )\n add_xytheta( xyinter[i][0], xyinter[i][1], theta )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L301_C12", "label": "theta = arctan2()", "type": "assigned_variable", "loc": [301, 302], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L300_C8", "vector": [14, 3, 0.7934, 0.0053, 3, 0.42, 0.0, 729, 3, 2, 0, 0, 895, 10, 1], "semantic": {"name": "theta", "arg_names": [], "import_names": [], "rhs_call_name": "arctan2", "annotation": ""}, "snippet": " theta = np.arctan2( xyinter[i+1][1] - xyinter[i][1],\n xyinter[i+1][0] - xyinter[i][0] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L303_C12", "label": "add_xytheta()", "type": "expression", "loc": [303, 303], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L300_C8", "vector": [8, 3, 0.7974, 0.0026, 3, 0.42, 1.0, 16, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "add_xytheta", "arg_names": [], "import_names": [], "rhs_call_name": "add_xytheta", "annotation": ""}, "snippet": " add_xytheta( xyinter[i][0], xyinter[i][1], theta )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L304_C8", "label": "add_xytheta()", "type": "expression", "loc": [304, 304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "vector": [8, 2, 0.8, 0.0026, 2, 0.91, 0.9286, 16, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "add_xytheta", "arg_names": [], "import_names": [], "rhs_call_name": "add_xytheta", "annotation": ""}, "snippet": " add_xytheta( xyinter[-1][0], xyinter[-1][1], theta )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L306_C8", "label": "return", "type": "return", "loc": [306, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "vector": [13, 2, 0.8053, 0.0026, 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 xytheta "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L308_C4", "label": "setup_poses_xonly", "type": "function", "loc": [308, 327], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:ClassDef_L30_C0", "vector": [2, 1, 0.8355, 0.0526, 1, 0.47, 1.0, 75, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "setup_poses_xonly", "arg_names": ["self", "radius"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setup_poses_xonly( self, radius ):\n poses = []\n xpos = 0.0\n \n def ps_x( x ):\n ps = PoseStamped()\n ps.header.frame_id = self.frame\n ps.pose.position.x = x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L309_C8", "label": "poses =", "type": "assigned_variable", "loc": [309, 309], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L308_C4", "vector": [14, 2, 0.8132, 0.0026, 2, 0.53, 0.0, 415, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "poses", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " poses = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L310_C8", "label": "xpos =", "type": "assigned_variable", "loc": [310, 310], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L308_C4", "vector": [14, 2, 0.8158, 0.0026, 2, 0.53, 0.2, 662, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "xpos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xpos = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L312_C8", "label": "ps_x", "type": "function", "loc": [312, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L308_C4", "vector": [2, 2, 0.8276, 0.0158, 2, 0.53, 0.4, 812, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "ps_x", "arg_names": ["x"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def ps_x( x ):\n ps = PoseStamped()\n ps.header.frame_id = self.frame\n ps.pose.position.x = x\n ps.pose.orientation.w = 1.0\n return ps"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L313_C12", "label": "ps = PoseStamped()", "type": "assigned_variable", "loc": [313, 313], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L312_C8", "vector": [14, 3, 0.8237, 0.0026, 3, 0.59, 0.0, 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_99378:Assign_L314_C12", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [314, 314], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L312_C8", "vector": [14, 3, 0.8263, 0.0026, 3, 0.59, 0.25, 293, 7, 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 = self.frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L315_C12", "label": "ps.pose.position.x =", "type": "assigned_variable", "loc": [315, 315], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L312_C8", "vector": [14, 3, 0.8289, 0.0026, 3, 0.59, 0.5, 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_99378:Assign_L316_C12", "label": "ps.pose.orientation.w =", "type": "assigned_variable", "loc": [316, 316], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L312_C8", "vector": [14, 3, 0.8316, 0.0026, 3, 0.59, 0.75, 163, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "ps.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.w = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L317_C12", "label": "return", "type": "return", "loc": [317, 317], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L312_C8", "vector": [13, 3, 0.8342, 0.0026, 3, 0.59, 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_99378:For_L319_C8", "label": "for i", "type": "for", "loc": [319, 321], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L308_C4", "vector": [6, 2, 0.8421, 0.0079, 2, 0.53, 0.6, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange(3):\n poses.append( ps_x( xpos ))\n xpos += 0.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L320_C12", "label": "append()", "type": "expression", "loc": [320, 320], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L319_C8", "vector": [8, 3, 0.8421, 0.0026, 3, 0.42, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " poses.append( ps_x( xpos ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L323_C8", "label": "for i", "type": "for", "loc": [323, 325], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L308_C4", "vector": [6, 2, 0.8526, 0.0079, 2, 0.53, 0.8, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange(3):\n poses.append( ps_x( xpos ))\n xpos += 0.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L324_C12", "label": "append()", "type": "expression", "loc": [324, 324], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L323_C8", "vector": [8, 3, 0.8526, 0.0026, 3, 0.97, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " poses.append( ps_x( xpos ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L327_C8", "label": "return", "type": "return", "loc": [327, 327], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L308_C4", "vector": [13, 2, 0.8605, 0.0026, 2, 0.53, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return poses"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "label": "if", "type": "if", "loc": [331, 359], "level": 0, "parent": null, "vector": [4, 0, 0.9079, 0.0763, 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 import optparse\n p = optparse.OptionParser()\n p.add_option('--yaml', action='store', type='string', dest='yaml',\n help='Room definition file (required)', default='')\n p.add_option('--room', action='store', type='string', dest='room',\n help='Specific room [default \\'hrl\\']', default='hrl')\n opt, args = p.parse_args()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Import_L332_C4", "label": "optparse import optparse", "type": "import", "loc": [332, 332], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "vector": [1, 1, 0.8737, 0.0026, 1, 0.69, 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_99378:Assign_L333_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [333, 333], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "vector": [14, 1, 0.8763, 0.0026, 1, 0.69, 0.0833, 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_99378:Expr_L334_C4", "label": "add_option()", "type": "expression", "loc": [334, 335], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "vector": [8, 1, 0.8803, 0.0053, 1, 0.69, 0.1667, 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('--yaml', action='store', type='string', dest='yaml',\n help='Room definition file (required)', default='')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L336_C4", "label": "add_option()", "type": "expression", "loc": [336, 337], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "vector": [8, 1, 0.8855, 0.0053, 1, 0.69, 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": " p.add_option('--room', action='store', type='string', dest='room',\n help='Specific room [default \\'hrl\\']', default='hrl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L338_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [338, 338], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "vector": [14, 1, 0.8895, 0.0026, 1, 0.69, 0.3333, 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_99378:If_L340_C4", "label": "if", "type": "if", "loc": [340, 343], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "vector": [4, 1, 0.8987, 0.0105, 1, 0.69, 0.4167, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.yaml == '':\n print('room_explore: YAML FILE REQUIRED.')\n else:\n print('Using YAML file: ', opt.yaml)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L341_C8", "label": "print()", "type": "expression", "loc": [341, 341], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L340_C4", "vector": [8, 2, 0.8974, 0.0026, 2, 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('room_explore: YAML FILE REQUIRED.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L343_C8", "label": "print()", "type": "expression", "loc": [343, 343], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L340_C4", "vector": [8, 2, 0.9026, 0.0026, 2, 0.25, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Using YAML file: ', opt.yaml)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L345_C4", "label": "f = open()", "type": "assigned_variable", "loc": [345, 345], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "vector": [14, 1, 0.9079, 0.0026, 1, 0.69, 0.5, 899, 3, 1, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " f = open( opt.yaml )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L346_C4", "label": "dat = load()", "type": "assigned_variable", "loc": [346, 346], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "vector": [14, 1, 0.9105, 0.0026, 1, 0.69, 0.5833, 934, 3, 1, 0, 0, 37, 10, 1], "semantic": {"name": "dat", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": " dat = yaml.load( f )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L347_C4", "label": "close()", "type": "expression", "loc": [347, 347], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "vector": [8, 1, 0.9132, 0.0026, 1, 0.69, 0.6667, 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_99378:Assign_L349_C4", "label": "room_transforms = TFthread()", "type": "assigned_variable", "loc": [349, 349], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "vector": [14, 1, 0.9184, 0.0026, 1, 0.69, 0.75, 874, 3, 1, 0, 0, 93, 10, 1], "semantic": {"name": "room_transforms", "arg_names": [], "import_names": [], "rhs_call_name": "TFthread", "annotation": ""}, "snippet": " room_transforms = ut.TFthread( dat )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L350_C4", "label": "pm = PosesMarkers()", "type": "assigned_variable", "loc": [350, 350], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "vector": [14, 1, 0.9211, 0.0026, 1, 0.69, 0.8333, 517, 3, 0, 0, 0, 260, 10, 1], "semantic": {"name": "pm", "arg_names": [], "import_names": [], "rhs_call_name": "PosesMarkers", "annotation": ""}, "snippet": " pm = ut.PosesMarkers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L352_C4", "label": "re = SnakingExplore()", "type": "assigned_variable", "loc": [352, 355], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "vector": [14, 1, 0.9303, 0.0105, 1, 0.69, 0.9167, 540, 3, 4, 0, 0, 513, 10, 1], "semantic": {"name": "re", "arg_names": [], "import_names": [], "rhs_call_name": "SnakingExplore", "annotation": ""}, "snippet": " re = SnakingExplore( df = dat,\n room = opt.room,\n start_rad = 1.5,\n markers_update = pm.update_poses )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L359_C4", "label": "spin()", "type": "expression", "loc": [359, 359], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "vector": [8, 1, 0.9447, 0.0026, 1, 0.69, 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_99378:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Try_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:Try_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L33_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L73_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L74_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Try_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:Try_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:Try_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:Try_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L133_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L134_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L137_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L138_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L144_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L145_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L147_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L148_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L147_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L149_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L151_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L151_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L155_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L151_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L156_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L151_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L157_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L151_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L158_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L151_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L159_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L151_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L160_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L151_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L162_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L162_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L163_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L151_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L168_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L151_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L174_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L179_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L180_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L180_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L181_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L180_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L182_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L185_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L186_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L187_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L188_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L189_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L189_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L190_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L189_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L191_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L201_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L202_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L203_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:While_L204_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:While_L204_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L205_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L205_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L206_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L205_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L207_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:While_L204_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L210_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:While_L204_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L211_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:While_L204_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L212_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:While_L204_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L215_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L215_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L216_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L216_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L217_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:While_L204_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L221_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L221_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L222_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L221_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L223_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L223_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L224_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L221_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L226_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L226_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L229_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L221_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L231_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L231_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L232_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:While_L204_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L235_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L235_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L236_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:While_L204_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L239_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L246_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L246_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L247_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L246_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L246_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L251_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L251_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L251_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L254_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L251_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L255_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L259_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L265_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L265_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L266_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L265_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L267_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L265_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L268_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L272_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L274_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L274_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L275_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L274_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L276_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L274_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L277_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L274_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L278_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L274_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L280_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L274_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L281_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L287_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L288_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L288_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L289_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L288_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L290_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L288_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L291_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L288_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L293_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L288_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L294_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L288_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L295_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L288_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L297_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L299_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L300_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L300_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L301_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L300_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L303_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L304_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L308_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L309_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L310_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L312_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L312_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L313_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L312_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L314_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L312_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L315_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L312_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L316_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L312_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L317_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L319_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L319_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L320_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L323_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:For_L323_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L324_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Return_L327_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Import_L332_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L333_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L334_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L336_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L338_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L340_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L340_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L341_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L340_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L343_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L345_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L346_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L347_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L349_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L350_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Assign_L352_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99378:If_L331_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99378:Expr_L359_C4"}]
#!/usr/bin/python import roslib roslib.load_manifest('room_explore') import rospy import tf from geometry_msgs.msg import PoseStamped from visualization_msgs.msg import Marker, MarkerArray from geometry_msgs.msg import Vector3, PoseStamped, Quaternion from std_msgs.msg import ColorRGBA from threading import Thread import numpy as np, math class TFthread( Thread ): def __init__( self, df ): Thread.__init__( self ) try: rospy.init_node( 'TFthread' ) except: pass # parent probably already initialized node. self.df = df # yaml dictionary of rooms self.bc = tf.TransformBroadcaster() self.should_run = True self.start() def publish_transform( self ): for room in self.df.keys(): self.bc.sendTransform( ( self.df[room]['position']['x'], self.df[room]['position']['y'], self.df[room]['position']['z'] ), ( self.df[room]['orientation']['x'], self.df[room]['orientation']['y'], self.df[room]['orientation']['z'], self.df[room]['orientation']['w'] ), rospy.Time.now(), room, 'map' ) def run( self ): rospy.logout( 'TFthread: Starting ' ) r = rospy.Rate( 10 ) while self.should_run and not rospy.is_shutdown(): self.publish_transform() try: r.sleep() except: pass # ROS exception. rospy.logout( 'TFthread: Starting ') def stop( self ): # Kill off the poller thread. self.should_run = False self.join(5) if (self.isAlive()): raise RuntimeError('TFthread: Unable to stop thread ' ) class PosesMarkers( Thread ): def __init__( self ): Thread.__init__( self ) try: rospy.init_node( 'snaking_room_posesmarkers' ) except: pass # parent probably already initialized node. self.poses = [] self.markers = [] self.mid = 0 self.new_poses = False self.should_run = True self.pub = rospy.Publisher( 'visarr', Marker ) self.start() def update_poses( self, poses ): self.poses = list( poses ) self.new_poses = True def run( self ): rospy.logout( 'PosesMarkers: Starting ' ) r = rospy.Rate( 5 ) while self.should_run and not rospy.is_shutdown(): if self.new_poses == True: self.new_poses = False # Delete old markers for old_m in self.markers: old_m.action = old_m.DELETE self.pub.publish( old_m ) # Create new markers self.markers = [] for p in self.poses: self.mid += 1 m = Marker() m.ns = 'explore_poses' m.id = self.mid m.action = m.ADD m.type = m.ARROW m.header.frame_id = p.header.frame_id m.header.stamp = rospy.Time.now() m.scale = Vector3( 0.15, 0.75, 0.75 ) m.color = ColorRGBA( 0.2, 0.2, 1.0, 0.9 ) m.pose = p.pose self.markers.append( m ) # Publish markers. for m in self.markers: m.header.stamp = rospy.Time.now() self.pub.publish( m ) r.sleep() # Delete old markers for old_m in self.markers: old_m.action = old_m.DELETE self.pub.publish( old_m ) rospy.logout( 'PoseMarkers: Stopping. ') def stop( self ): # Kill off the poller thread. self.should_run = False self.join(5) if (self.isAlive()): raise RuntimeError('TFthread: Unable to stop thread ' ) def standard_rad(t): if t > 0: return ((t + np.pi) % (np.pi * 2)) - np.pi else: return ((t - np.pi) % (np.pi * -2)) + np.pi def robot_in_map( l, fail_msg = '' ): # l is tf listener ps = PoseStamped() ps.header.frame_id = '/base_link' ps.pose.orientation.w = 1.0 try: ps_map = l.transformPose( '/map', ps ) except: rospy.logout( fail_msg + 'Transform failed.' ) ps_map = None return ps_map
ajibawa-2023/Python-Code-Large/train/row_99379
96
152
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0197, 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"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0263, 0.0066, 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('room_explore')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0329, 0.0066, 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_99379:Import_L7_C0", "label": "tf import tf", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0461, 0.0066, 0, 0.66, 0.2308, 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_99379:ImportFrom_L9_C0", "label": "from geometry_msgs.msg import PoseStamped", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0592, 0.0066, 0, 0.66, 0.3077, 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_99379:ImportFrom_L10_C0", "label": "from visualization_msgs.msg import Marker, MarkerArray", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0658, 0.0066, 0, 0.66, 0.3846, 124, 0, 2, 0, 0, 124, 0, 0], "semantic": {"name": "visualization_msgs.msg", "arg_names": [], "import_names": ["Marker", "MarkerArray"], "rhs_call_name": "", "annotation": ""}, "snippet": "from visualization_msgs.msg import Marker, MarkerArray"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:ImportFrom_L11_C0", "label": "from geometry_msgs.msg import Vector3, PoseStamped, Quaternion", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0724, 0.0066, 0, 0.66, 0.4615, 951, 0, 3, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Vector3", "PoseStamped", "Quaternion"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Vector3, PoseStamped, Quaternion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:ImportFrom_L12_C0", "label": "from std_msgs.msg import ColorRGBA", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0789, 0.0066, 0, 0.66, 0.5385, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["ColorRGBA"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import ColorRGBA"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:ImportFrom_L14_C0", "label": "from threading import Thread", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0921, 0.0066, 0, 0.66, 0.6154, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["Thread"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import Thread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Import_L15_C0", "label": "numpy import np, math", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0987, 0.0066, 0, 0.66, 0.6923, 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_99379:ClassDef_L17_C0", "label": "TFthread", "type": "class", "loc": [17, 58], "level": 0, "parent": null, "vector": [3, 0, 0.2467, 0.2763, 0, 0.66, 0.7692, 93, 0, 4, 0, 0, 134, 0, 16], "semantic": {"name": "TFthread", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TFthread( Thread ):\n def __init__( self, df ):\n Thread.__init__( self )\n try:\n rospy.init_node( 'TFthread' )\n except:\n pass # parent probably already initialized node.\n self.df = df # yaml dictionary of rooms"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L18_C4", "label": "__init__", "type": "function", "loc": [18, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:ClassDef_L17_C0", "vector": [2, 1, 0.148, 0.0658, 1, 0.12, 0.0, 555, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "df"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, df ):\n Thread.__init__( self )\n try:\n rospy.init_node( 'TFthread' )\n except:\n pass # parent probably already initialized node.\n self.df = df # yaml dictionary of rooms\n self.bc = tf.TransformBroadcaster()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L19_C8", "label": "__init__()", "type": "expression", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L18_C4", "vector": [8, 2, 0.125, 0.0066, 2, 0.19, 0.0, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Thread.__init__( self )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Try_L20_C8", "label": "try", "type": "try", "loc": [20, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L18_C4", "vector": [7, 2, 0.1414, 0.0263, 2, 0.19, 0.2, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node( 'TFthread' )\n except:\n pass # parent probably already initialized node."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L21_C12", "label": "init_node()", "type": "expression", "loc": [21, 21], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:Try_L20_C8", "vector": [8, 3, 0.1382, 0.0066, 3, 0.47, 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( 'TFthread' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L24_C8", "label": "self.df =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L18_C4", "vector": [14, 2, 0.1579, 0.0066, 2, 0.19, 0.4, 14, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.df", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.df = df # yaml dictionary of rooms"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L25_C8", "label": "self.bc = TransformBroadcaster()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L18_C4", "vector": [14, 2, 0.1645, 0.0066, 2, 0.19, 0.6, 0, 3, 0, 0, 0, 986, 10, 1], "semantic": {"name": "self.bc", "arg_names": [], "import_names": [], "rhs_call_name": "TransformBroadcaster", "annotation": ""}, "snippet": " self.bc = tf.TransformBroadcaster()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L26_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L18_C4", "vector": [14, 2, 0.1711, 0.0066, 2, 0.19, 0.8, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L27_C8", "label": "start()", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L18_C4", "vector": [8, 2, 0.1776, 0.0066, 2, 0.19, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L29_C4", "label": "publish_transform", "type": "function", "loc": [29, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:ClassDef_L17_C0", "vector": [2, 1, 0.227, 0.0789, 1, 0.12, 0.3333, 288, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "publish_transform", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def publish_transform( self ):\n for room in self.df.keys():\n self.bc.sendTransform( ( self.df[room]['position']['x'],\n self.df[room]['position']['y'],\n self.df[room]['position']['z'] ),\n ( self.df[room]['orientation']['x'],\n self.df[room]['orientation']['y'],\n self.df[room]['orientation']['z'],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L30_C8", "label": "for room", "type": "for", "loc": [30, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L29_C4", "vector": [6, 2, 0.2303, 0.0724, 2, 0.35, 0.0, 846, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "room", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for room in self.df.keys():\n self.bc.sendTransform( ( self.df[room]['position']['x'],\n self.df[room]['position']['y'],\n self.df[room]['position']['z'] ),\n ( self.df[room]['orientation']['x'],\n self.df[room]['orientation']['y'],\n self.df[room]['orientation']['z'],\n self.df[room]['orientation']['w'] ),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L31_C12", "label": "sendTransform()", "type": "expression", "loc": [31, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L30_C8", "vector": [8, 3, 0.2336, 0.0658, 3, 0.34, 0.0, 373, 3, 5, 0, 0, 0, 0, 2], "semantic": {"name": "sendTransform", "arg_names": [], "import_names": [], "rhs_call_name": "sendTransform", "annotation": ""}, "snippet": " self.bc.sendTransform( ( self.df[room]['position']['x'],\n self.df[room]['position']['y'],\n self.df[room]['position']['z'] ),\n ( self.df[room]['orientation']['x'],\n self.df[room]['orientation']['y'],\n self.df[room]['orientation']['z'],\n self.df[room]['orientation']['w'] ),\n rospy.Time.now(),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L42_C4", "label": "run", "type": "function", "loc": [42, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:ClassDef_L17_C0", "vector": [2, 1, 0.3059, 0.0658, 1, 0.12, 0.6667, 679, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run( self ):\n rospy.logout( 'TFthread: Starting ' )\n r = rospy.Rate( 10 )\n while self.should_run and not rospy.is_shutdown():\n self.publish_transform()\n try:\n r.sleep()\n except:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L43_C8", "label": "logout()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L42_C4", "vector": [8, 2, 0.2829, 0.0066, 2, 0.94, 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( 'TFthread: Starting ' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L44_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L42_C4", "vector": [14, 2, 0.2895, 0.0066, 2, 0.94, 0.3333, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " r = rospy.Rate( 10 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:While_L45_C8", "label": "while", "type": "while", "loc": [45, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L42_C4", "vector": [5, 2, 0.3125, 0.0395, 2, 0.94, 0.6667, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.should_run and not rospy.is_shutdown():\n self.publish_transform()\n try:\n r.sleep()\n except:\n pass # ROS exception."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L46_C12", "label": "publish_transform()", "type": "expression", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:While_L45_C8", "vector": [8, 3, 0.3026, 0.0066, 3, 0.86, 0.0, 288, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "publish_transform", "arg_names": [], "import_names": [], "rhs_call_name": "publish_transform", "annotation": ""}, "snippet": " self.publish_transform()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Try_L47_C12", "label": "try", "type": "try", "loc": [47, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:While_L45_C8", "vector": [7, 3, 0.3191, 0.0263, 3, 0.86, 1.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n r.sleep()\n except:\n pass # ROS exception."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L48_C16", "label": "sleep()", "type": "expression", "loc": [48, 48], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:Try_L47_C12", "vector": [8, 4, 0.3158, 0.0066, 4, 0.42, 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_99379:Expr_L51_C8", "label": "logout()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L42_C4", "vector": [8, 2, 0.3355, 0.0066, 2, 0.94, 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( 'TFthread: Starting ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L53_C4", "label": "stop", "type": "function", "loc": [53, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:ClassDef_L17_C0", "vector": [2, 1, 0.3651, 0.0395, 1, 0.12, 1.0, 343, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "stop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop( self ):\n # Kill off the poller thread.\n self.should_run = False\n self.join(5)\n if (self.isAlive()):\n raise RuntimeError('TFthread: Unable to stop thread ' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L55_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L53_C4", "vector": [14, 2, 0.3618, 0.0066, 2, 0.48, 0.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L56_C8", "label": "join()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L53_C4", "vector": [8, 2, 0.3684, 0.0066, 2, 0.48, 0.5, 933, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.join(5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:If_L57_C8", "label": "if", "type": "if", "loc": [57, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L53_C4", "vector": [4, 2, 0.3783, 0.0132, 2, 0.48, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.isAlive()):\n raise RuntimeError('TFthread: Unable to stop thread ' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:ClassDef_L61_C0", "label": "PosesMarkers", "type": "class", "loc": [61, 129], "level": 0, "parent": null, "vector": [3, 0, 0.625, 0.4539, 0, 0.66, 0.8462, 260, 0, 4, 0, 0, 134, 0, 22], "semantic": {"name": "PosesMarkers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PosesMarkers( Thread ):\n def __init__( self ):\n Thread.__init__( self )\n try:\n rospy.init_node( 'snaking_room_posesmarkers' )\n except:\n pass # parent probably already initialized node.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L62_C4", "label": "__init__", "type": "function", "loc": [62, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:ClassDef_L61_C0", "vector": [2, 1, 0.4539, 0.0987, 1, 0.95, 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 Thread.__init__( self )\n try:\n rospy.init_node( 'snaking_room_posesmarkers' )\n except:\n pass # parent probably already initialized node.\n\n self.poses = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L63_C8", "label": "__init__()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L62_C4", "vector": [8, 2, 0.4145, 0.0066, 2, 0.09, 0.0, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Thread.__init__( self )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Try_L64_C8", "label": "try", "type": "try", "loc": [64, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L62_C4", "vector": [7, 2, 0.4309, 0.0263, 2, 0.09, 0.125, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node( 'snaking_room_posesmarkers' )\n except:\n pass # parent probably already initialized node."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L65_C12", "label": "init_node()", "type": "expression", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:Try_L64_C8", "vector": [8, 3, 0.4276, 0.0066, 3, 0.65, 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( 'snaking_room_posesmarkers' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L69_C8", "label": "self.poses =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L62_C4", "vector": [14, 2, 0.4539, 0.0066, 2, 0.09, 0.25, 872, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.poses", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.poses = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L70_C8", "label": "self.markers =", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L62_C4", "vector": [14, 2, 0.4605, 0.0066, 2, 0.09, 0.375, 796, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.markers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.markers = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L71_C8", "label": "self.mid =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L62_C4", "vector": [14, 2, 0.4671, 0.0066, 2, 0.09, 0.5, 732, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.mid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mid = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L72_C8", "label": "self.new_poses =", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L62_C4", "vector": [14, 2, 0.4737, 0.0066, 2, 0.09, 0.625, 581, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.new_poses", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.new_poses = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L74_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L62_C4", "vector": [14, 2, 0.4868, 0.0066, 2, 0.09, 0.75, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L75_C8", "label": "self.pub = Publisher()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L62_C4", "vector": [14, 2, 0.4934, 0.0066, 2, 0.09, 0.875, 86, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.pub = rospy.Publisher( 'visarr', Marker )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L76_C8", "label": "start()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L62_C4", "vector": [8, 2, 0.5, 0.0066, 2, 0.09, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L78_C4", "label": "update_poses", "type": "function", "loc": [78, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:ClassDef_L61_C0", "vector": [2, 1, 0.5197, 0.0197, 1, 0.95, 0.3333, 224, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "update_poses", "arg_names": ["self", "poses"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update_poses( self, poses ):\n self.poses = list( poses )\n self.new_poses = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L79_C8", "label": "self.poses = list()", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L78_C4", "vector": [14, 2, 0.5197, 0.0066, 2, 0.15, 0.0, 872, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "self.poses", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " self.poses = list( poses )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L80_C8", "label": "self.new_poses =", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L78_C4", "vector": [14, 2, 0.5263, 0.0066, 2, 0.15, 1.0, 581, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.new_poses", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.new_poses = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L82_C4", "label": "run", "type": "function", "loc": [82, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:ClassDef_L61_C0", "vector": [2, 1, 0.6711, 0.2697, 1, 0.95, 0.6667, 679, 0, 1, 0, 0, 0, 0, 14], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run( self ):\n rospy.logout( 'PosesMarkers: Starting ' )\n r = rospy.Rate( 5 )\n while self.should_run and not rospy.is_shutdown():\n if self.new_poses == True:\n self.new_poses = False\n\n # Delete old markers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L83_C8", "label": "logout()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L82_C4", "vector": [8, 2, 0.5461, 0.0066, 2, 0.43, 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( 'PosesMarkers: Starting ' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L84_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L82_C4", "vector": [14, 2, 0.5526, 0.0066, 2, 0.43, 0.25, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " r = rospy.Rate( 5 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:While_L85_C8", "label": "while", "type": "while", "loc": [85, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L82_C4", "vector": [5, 2, 0.6579, 0.2039, 2, 0.43, 0.5, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.should_run and not rospy.is_shutdown():\n if self.new_poses == True:\n self.new_poses = False\n\n # Delete old markers\n for old_m in self.markers:\n old_m.action = old_m.DELETE\n self.pub.publish( old_m )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:If_L86_C12", "label": "if", "type": "if", "loc": [86, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:While_L85_C8", "vector": [4, 3, 0.6382, 0.1513, 3, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.new_poses == True:\n self.new_poses = False\n\n # Delete old markers\n for old_m in self.markers:\n old_m.action = old_m.DELETE\n self.pub.publish( old_m )\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L87_C16", "label": "self.new_poses =", "type": "assigned_variable", "loc": [87, 87], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:If_L86_C12", "vector": [14, 4, 0.5724, 0.0066, 4, 0.92, 0.0, 581, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.new_poses", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.new_poses = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L90_C16", "label": "for old_m", "type": "for", "loc": [90, 92], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:If_L86_C12", "vector": [6, 4, 0.5987, 0.0197, 4, 0.92, 0.3333, 83, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "old_m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for old_m in self.markers:\n old_m.action = old_m.DELETE\n self.pub.publish( old_m )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L91_C20", "label": "old_m.action =", "type": "assigned_variable", "loc": [91, 91], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L90_C16", "vector": [14, 5, 0.5987, 0.0066, 5, 0.23, 0.0, 508, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "old_m.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " old_m.action = old_m.DELETE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L92_C20", "label": "publish()", "type": "expression", "loc": [92, 92], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L90_C16", "vector": [8, 5, 0.6053, 0.0066, 5, 0.23, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.pub.publish( old_m )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L95_C16", "label": "self.markers =", "type": "assigned_variable", "loc": [95, 95], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:If_L86_C12", "vector": [14, 4, 0.625, 0.0066, 4, 0.92, 0.6667, 796, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.markers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.markers = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L96_C16", "label": "for p", "type": "for", "loc": [96, 108], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:If_L86_C12", "vector": [6, 4, 0.6711, 0.0855, 4, 0.92, 1.0, 491, 7, 0, 0, 0, 0, 0, 5], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for p in self.poses:\n self.mid += 1\n m = Marker()\n m.ns = 'explore_poses'\n m.id = self.mid\n m.action = m.ADD\n m.type = m.ARROW\n m.header.frame_id = p.header.frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L98_C20", "label": "m = Marker()", "type": "assigned_variable", "loc": [98, 98], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L96_C16", "vector": [14, 5, 0.6447, 0.0066, 5, 0.16, 0.0, 711, 3, 0, 0, 0, 923, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "Marker", "annotation": ""}, "snippet": " m = Marker()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L99_C20", "label": "m.ns =", "type": "assigned_variable", "loc": [99, 99], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L96_C16", "vector": [14, 5, 0.6513, 0.0066, 5, 0.16, 0.1, 889, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "m.ns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.ns = 'explore_poses'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L100_C20", "label": "m.id =", "type": "assigned_variable", "loc": [100, 100], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L96_C16", "vector": [14, 5, 0.6579, 0.0066, 5, 0.16, 0.2, 46, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.id = self.mid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L101_C20", "label": "m.action =", "type": "assigned_variable", "loc": [101, 101], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L96_C16", "vector": [14, 5, 0.6645, 0.0066, 5, 0.16, 0.3, 654, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.action = m.ADD"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L102_C20", "label": "m.type =", "type": "assigned_variable", "loc": [102, 102], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L96_C16", "vector": [14, 5, 0.6711, 0.0066, 5, 0.16, 0.4, 148, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.type = m.ARROW"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L103_C20", "label": "m.header.frame_id =", "type": "assigned_variable", "loc": [103, 103], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L96_C16", "vector": [14, 5, 0.6776, 0.0066, 5, 0.16, 0.5, 636, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.header.frame_id = p.header.frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L104_C20", "label": "m.header.stamp = now()", "type": "assigned_variable", "loc": [104, 104], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L96_C16", "vector": [14, 5, 0.6842, 0.0066, 5, 0.16, 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_99379:Assign_L105_C20", "label": "m.scale = Vector3()", "type": "assigned_variable", "loc": [105, 105], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L96_C16", "vector": [14, 5, 0.6908, 0.0066, 5, 0.16, 0.7, 508, 3, 3, 0, 0, 759, 10, 1], "semantic": {"name": "m.scale", "arg_names": [], "import_names": [], "rhs_call_name": "Vector3", "annotation": ""}, "snippet": " m.scale = Vector3( 0.15, 0.75, 0.75 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L106_C20", "label": "m.color = ColorRGBA()", "type": "assigned_variable", "loc": [106, 106], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L96_C16", "vector": [14, 5, 0.6974, 0.0066, 5, 0.16, 0.8, 882, 3, 4, 0, 0, 927, 10, 1], "semantic": {"name": "m.color", "arg_names": [], "import_names": [], "rhs_call_name": "ColorRGBA", "annotation": ""}, "snippet": " m.color = ColorRGBA( 0.2, 0.2, 1.0, 0.9 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L107_C20", "label": "m.pose =", "type": "assigned_variable", "loc": [107, 107], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L96_C16", "vector": [14, 5, 0.7039, 0.0066, 5, 0.16, 0.9, 927, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.pose = p.pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L108_C20", "label": "append()", "type": "expression", "loc": [108, 108], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L96_C16", "vector": [8, 5, 0.7105, 0.0066, 5, 0.16, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.markers.append( m )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L111_C12", "label": "for m", "type": "for", "loc": [111, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:While_L85_C8", "vector": [6, 3, 0.7368, 0.0197, 3, 0.66, 0.5, 711, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for m in self.markers:\n m.header.stamp = rospy.Time.now()\n self.pub.publish( m )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L112_C16", "label": "m.header.stamp = now()", "type": "assigned_variable", "loc": [112, 112], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L111_C12", "vector": [14, 4, 0.7368, 0.0066, 4, 0.92, 0.0, 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_99379:Expr_L113_C16", "label": "publish()", "type": "expression", "loc": [113, 113], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L111_C12", "vector": [8, 4, 0.7434, 0.0066, 4, 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.pub.publish( m )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L115_C12", "label": "sleep()", "type": "expression", "loc": [115, 115], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:While_L85_C8", "vector": [8, 3, 0.7566, 0.0066, 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_99379:For_L118_C8", "label": "for old_m", "type": "for", "loc": [118, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L82_C4", "vector": [6, 2, 0.7829, 0.0197, 2, 0.43, 0.75, 83, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "old_m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for old_m in self.markers:\n old_m.action = old_m.DELETE\n self.pub.publish( old_m )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L119_C12", "label": "old_m.action =", "type": "assigned_variable", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L118_C8", "vector": [14, 3, 0.7829, 0.0066, 3, 0.53, 0.0, 508, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "old_m.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " old_m.action = old_m.DELETE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L120_C12", "label": "publish()", "type": "expression", "loc": [120, 120], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L118_C8", "vector": [8, 3, 0.7895, 0.0066, 3, 0.53, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.pub.publish( old_m )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L122_C8", "label": "logout()", "type": "expression", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L82_C4", "vector": [8, 2, 0.8026, 0.0066, 2, 0.43, 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( 'PoseMarkers: Stopping. ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L124_C4", "label": "stop", "type": "function", "loc": [124, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:ClassDef_L61_C0", "vector": [2, 1, 0.8322, 0.0395, 1, 0.95, 1.0, 343, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "stop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop( self ):\n # Kill off the poller thread.\n self.should_run = False\n self.join(5)\n if (self.isAlive()):\n raise RuntimeError('TFthread: Unable to stop thread ' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L126_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L124_C4", "vector": [14, 2, 0.8289, 0.0066, 2, 0.09, 0.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L127_C8", "label": "join()", "type": "expression", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L124_C4", "vector": [8, 2, 0.8355, 0.0066, 2, 0.09, 0.5, 933, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.join(5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:If_L128_C8", "label": "if", "type": "if", "loc": [128, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L124_C4", "vector": [4, 2, 0.8454, 0.0132, 2, 0.09, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.isAlive()):\n raise RuntimeError('TFthread: Unable to stop thread ' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L133_C0", "label": "standard_rad", "type": "function", "loc": [133, 137], "level": 0, "parent": null, "vector": [2, 0, 0.8882, 0.0329, 0, 0.66, 0.9231, 54, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "standard_rad", "arg_names": ["t"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def standard_rad(t):\n if t > 0:\n return ((t + np.pi) % (np.pi * 2)) - np.pi\n else:\n return ((t - np.pi) % (np.pi * -2)) + np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:If_L134_C4", "label": "if", "type": "if", "loc": [134, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L133_C0", "vector": [4, 1, 0.8914, 0.0263, 1, 0.65, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if t > 0:\n return ((t + np.pi) % (np.pi * 2)) - np.pi\n else:\n return ((t - np.pi) % (np.pi * -2)) + np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Return_L135_C8", "label": "return", "type": "return", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:If_L134_C4", "vector": [13, 2, 0.8882, 0.0066, 2, 0.99, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ((t + np.pi) % (np.pi * 2)) - np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Return_L137_C8", "label": "return", "type": "return", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:If_L134_C4", "vector": [13, 2, 0.9013, 0.0066, 2, 0.99, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ((t - np.pi) % (np.pi * -2)) + np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L140_C0", "label": "robot_in_map", "type": "function", "loc": [140, 151], "level": 0, "parent": null, "vector": [2, 0, 0.9572, 0.0789, 0, 0.66, 1.0, 945, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "robot_in_map", "arg_names": ["l", "fail_msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def robot_in_map( l, fail_msg = '' ):\n # l is tf listener\n ps = PoseStamped()\n ps.header.frame_id = '/base_link'\n ps.pose.orientation.w = 1.0\n\n try:\n ps_map = l.transformPose( '/map', ps )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L142_C4", "label": "ps = PoseStamped()", "type": "assigned_variable", "loc": [142, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L140_C0", "vector": [14, 1, 0.9342, 0.0066, 1, 0.89, 0.0, 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_99379:Assign_L143_C4", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [143, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L140_C0", "vector": [14, 1, 0.9408, 0.0066, 1, 0.89, 0.25, 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_99379:Assign_L144_C4", "label": "ps.pose.orientation.w =", "type": "assigned_variable", "loc": [144, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L140_C0", "vector": [14, 1, 0.9474, 0.0066, 1, 0.89, 0.5, 163, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "ps.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.w = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Try_L146_C4", "label": "try", "type": "try", "loc": [146, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L140_C0", "vector": [7, 1, 0.9737, 0.0329, 1, 0.89, 0.75, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n ps_map = l.transformPose( '/map', ps )\n except:\n rospy.logout( fail_msg + 'Transform failed.' )\n ps_map = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L147_C8", "label": "ps_map = transformPose()", "type": "assigned_variable", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:Try_L146_C4", "vector": [14, 2, 0.9671, 0.0066, 2, 0.92, 0.0, 938, 3, 2, 0, 0, 654, 10, 1], "semantic": {"name": "ps_map", "arg_names": [], "import_names": [], "rhs_call_name": "transformPose", "annotation": ""}, "snippet": " ps_map = l.transformPose( '/map', ps )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L149_C8", "label": "logout()", "type": "expression", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:Try_L146_C4", "vector": [8, 2, 0.9803, 0.0066, 2, 0.92, 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( fail_msg + 'Transform failed.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L150_C8", "label": "ps_map =", "type": "assigned_variable", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:Try_L146_C4", "vector": [14, 2, 0.9868, 0.0066, 2, 0.92, 1.0, 938, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "ps_map", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps_map = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99379:Return_L151_C4", "label": "return", "type": "return", "loc": [151, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L140_C0", "vector": [13, 1, 0.9934, 0.0066, 1, 0.89, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ps_map"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99379:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Try_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:Try_L20_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L21_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L30_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L31_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:While_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:While_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:While_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Try_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:Try_L47_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L48_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:If_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Try_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:Try_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:While_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:While_L85_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:If_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:If_L86_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L87_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:If_L86_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L90_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L90_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L91_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L90_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L92_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:If_L86_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L95_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:If_L86_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L96_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L96_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L98_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L96_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L99_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L96_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L100_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L96_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L101_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L96_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L102_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L96_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L103_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L96_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L104_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L96_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L105_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L96_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L106_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L96_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L107_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L96_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L108_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:While_L85_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L111_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L112_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L111_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L113_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:While_L85_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L115_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L118_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L119_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:For_L118_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L120_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:If_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L133_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:If_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:If_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Return_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:If_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Return_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L140_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L140_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L140_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L140_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Try_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:Try_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:Try_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Expr_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:Try_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Assign_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99379:FunctionDef_L140_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99379:Return_L151_C4"}]
__all__ = [ 'snaking_room_explore' ]
ajibawa-2023/Python-Code-Large/train/row_99380
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_99380: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 'snaking_room_explore'\n ]"}]
[]
#!/usr/bin/python import roslib roslib.load_manifest('rfid_explore_room') import rospy import tf from threading import Thread import actionlib from move_base_msgs.msg import MoveBaseGoal, MoveBaseAction from visualization_msgs.msg import MarkerArray from visualization_msgs.msg import Marker from geometry_msgs.msg import Vector3, PoseStamped, Quaternion from std_msgs.msg import ColorRGBA from explore_hrl.msg import ExploreAction, ExploreResult, ExploreGoal import yaml import numpy as np, math def retfalse(): return False class TFthread( Thread ): def __init__( self, df ): Thread.__init__( self ) try: rospy.init_node( 'TFthread' ) except: pass # parent probably already initialized node. self.df = df # yaml dictionary of rooms self.bc = tf.TransformBroadcaster() self.should_run = True self.start() def publish_transform( self ): for room in self.df.keys(): self.bc.sendTransform( ( self.df[room]['position']['x'], self.df[room]['position']['y'], self.df[room]['position']['z'] ), ( self.df[room]['orientation']['x'], self.df[room]['orientation']['y'], self.df[room]['orientation']['z'], self.df[room]['orientation']['w'] ), rospy.Time.now(), room, 'map' ) def run( self ): rospy.logout( 'TFthread: Starting ' ) r = rospy.Rate( 10 ) while self.should_run and not rospy.is_shutdown(): self.publish_transform() try: r.sleep() except: pass # ROS exception. rospy.logout( 'TFthread: Starting ') def stop( self ): # Kill off the poller thread. self.should_run = False self.join(5) if (self.isAlive()): raise RuntimeError('TFthread: Unable to stop thread ' ) # if __name__ == '__main__': # f = open( room ) # dat = yaml.load( f ) # f.close() # TFthread( dat ) # rospy.spin() def standard_rad(t): if t > 0: return ((t + np.pi) % (np.pi * 2)) - np.pi else: return ((t - np.pi) % (np.pi * -2)) + np.pi class RoomExplore( ): def __init__( self, df, room, start_rad = 1.5 ): try: rospy.init_node( 'RoomExplore' ) except: pass self.should_run = True self.frame = '/' + room self.old_markers = [] self.mid = 1 self.height = df[room]['height'] self.width = df[room]['width'] self.listener = tf.TransformListener() self.listener.waitForTransform( '/base_link', '/map', rospy.Time(0), timeout = rospy.Duration(100)) self.pub = rospy.Publisher( 'visarr', Marker ) self.setup_poses( radius = start_rad ) # also initializes radius print 'Len: ', len(self.poses), ' Publishing.' self.publish_markers() self._as = actionlib.SimpleActionServer( '/explore', ExploreAction, execute_cb = self.action_request ) self._as.start() self.publish_markers() rospy.logout('Action should be started.') def action_request( self, goal ): rospy.logout( 'room_explore: action_request received for radius: \'%2.2f\'' % goal.radius ) def preempt_func(): # self._as should be in scope and bound @ function def. (I think for python...) check = self._as.is_preempt_requested() if check: rospy.logout( 'room_explore: action_request preempted!' ) return check rv = self.begin_explore( goal.radius, preempt_func = preempt_func ) rospy.logout( 'room_explore: action_request received result %d' % int(rv) ) if rv == True: self._as.set_succeeded( ExploreResult() ) def begin_explore( self, radius, preempt_func = retfalse ): client = actionlib.SimpleActionClient( 'move_base', MoveBaseAction ) rospy.logout( 'Waiting for move_base server' ) client.wait_for_server() rospy.logout( 'room_explore: setting radius' ) all_goals = self.setup_poses( radius ) self.publish_markers() for goal in all_goals: #print 'room_explore: sending goal ', goal goal.target_pose.header.stamp = rospy.Time.now() client.send_goal( goal ) time_last_moving = rospy.Time.now() goal_time = rospy.Time.now() new_pose = self.current_robot_position() ref_pose = self.current_robot_position() r = rospy.Rate( 5 ) while not rospy.is_shutdown(): state = client.get_state() states = { 0: 'WAITING FOR GOAL ACK', 1: 'PENDING', 2: 'ACTIVE', 3: 'WAITING FOR RESULT', 4: 'WAITING FOR CANCEL ACK', 5: 'RECALLING', 6: 'PREEMPTING', 7: 'DONE' } #print 'State: ', state, ' ', states[state] #print 'Result: ', client.get_result() #rospy.logout( 'room_explore: loop' ) if state == 7 or state == 3: rospy.logout( 'room_explore: client no longer active' ) print 'State: ', state, ' ', states[state] time_last_moving = rospy.Time.now() break if preempt_func(): rospy.logout( 'room_explore: preempted at a higher level.' ) time_last_moving = rospy.Time.now() break new_pose = self.current_robot_position() dx = new_pose[0] - ref_pose[0] dy = new_pose[1] - ref_pose[1] da = new_pose[-1] - ref_pose[-1] # yaw if dx*dx + dy*dy > 0.02 or da*da > math.radians( 5 ): time_last_moving = rospy.Time.now() ref_pose = self.current_robot_position() rospy.logout('WE ARE MOVING') if rospy.Time.now() - time_last_moving > rospy.Duration( 8 ): rospy.logout( 'We do not appear to have moved. Aborting current goal.' ) client.cancel_all_goals() # Should force a break on GoalState time_last_moving = rospy.Time.now() break if rospy.Time.now() - goal_time > rospy.Duration( 30 ): rospy.logout( 'Goal not achieved after 30 seconds. Aborting.' ) client.cancel_all_goals() # Should force a break on GoalState time_last_moving = rospy.Time.now() break r.sleep() client.cancel_all_goals() # Just in case if preempt_func(): # immediately exit if overall action preempted break return True def current_robot_position( self ): ps = PoseStamped() ps.header.stamp = rospy.Time(0) ps.header.frame_id = '/base_link' ps.pose.orientation.w = 1.0 try: ps_map = self.listener.transformPose( '/map', ps ) except: rospy.logout( 'room_explore: Transform failed' ) ps_map = PoseStamped() ps_map.header.stamp = rospy.Time.now() ps_map.header.frame_id = '/map' ps_map.pose.orientation = new_quat roll, pitch, yaw = tf.transformations.euler_from_quaternion(( ps_map.pose.orientation.x, ps_map.pose.orientation.y, ps_map.pose.orientation.z, ps_map.pose.orientation.w )) rv = [ ps_map.pose.position.x, ps_map.pose.position.y, ps_map.pose.position.z, roll, pitch, yaw ] #print 'RV: ', rv return rv def setup_poses( self, radius ): self.radius = radius xdir = np.arange( self.radius / 2.0, self.height + self.radius / 2.0, self.radius ) ydir = np.arange( self.radius / 2.0, self.width + self.radius / 2.0, self.radius ) move_dir = 0.0 self.poses = [] mod = 0 for y in ydir: if mod == 0: xord = xdir else: xord = xdir[::-1] for x in xord: goal = MoveBaseGoal() goal.target_pose.header.frame_id = self.frame goal.target_pose.header.stamp = rospy.Time.now() goal.target_pose.pose.position.x = x goal.target_pose.pose.position.y = y quat = tf.transformations.quaternion_from_euler( 0.0, 0.0, move_dir ) goal.target_pose.pose.orientation.x = quat[0] goal.target_pose.pose.orientation.y = quat[1] goal.target_pose.pose.orientation.z = quat[2] goal.target_pose.pose.orientation.w = quat[3] self.poses.append( goal ) move_dir = standard_rad( move_dir + np.pi ) mod = ( mod + 1 ) % 2 return self.poses def destroy_old_markers( self ): for m in self.old_markers: m.action = m.DELETE self.pub.publish( m ) self.old_markers = [] def publish_markers( self ): self.destroy_old_markers() for i,g in enumerate(self.poses): self.mid += 1 m = Marker() m.ns = 'explore_poses' m.id = self.mid m.action = m.ADD m.type = m.ARROW m.header.frame_id = self.frame m.header.stamp = rospy.Time.now() m.scale = Vector3( 0.15, 1.0, 1.0 ) m.color = ColorRGBA( 0.2, 1.0, 0.2, 0.7 ) m.pose = g.target_pose.pose self.old_markers.append( m ) self.pub.publish( m ) def goals( self ): return self.poses #self.explore_act = actionlib.SimpleActionClient('explore', explore_hrl.msg.ExploreAction) if __name__ == '__main__': import optparse p = optparse.OptionParser() p.add_option('--yaml', action='store', type='string', dest='yaml', help='Room definition file (required)', default='') p.add_option('--room', action='store', type='string', dest='room', help='Specific room [default \'hrl\']', default='hrl') opt, args = p.parse_args() if opt.yaml == '': print 'room_explore: YAML FILE REQUIRED.' else: print 'Using YAML file: ', opt.yaml f = open( opt.yaml ) dat = yaml.load( f ) f.close() TFthread( dat ) re = RoomExplore( dat, opt.room, 1.5 ) rospy.sleep( 4 ) re.publish_markers() rospy.spin() # r = rospy.Rate( 2 ) # while not rospy.is_shutdown(): # re.publish_markers() # r.sleep() #re.begin_explore( 0.8 ) # rosservice call /explore 0.8 # explore_act = actionlib.SimpleActionClient('explore', ExploreAction) # rospy.logout( 'Waiting for explore.' ) # explore_act.wait_for_server() # rospy.logout( 'Done waiting.' ) # goal = ExploreGoal( radius = 0.8 ) # explore_act.send_goal(goal) # rospy.sleep( 0.5 ) # explore_act.wait_for_result()
ajibawa-2023/Python-Code-Large/train/row_99381
200
346
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0087, 0.0029, 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_99381:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0116, 0.0029, 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('rfid_explore_room')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0145, 0.0029, 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_99381:Import_L7_C0", "label": "tf import tf", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0202, 0.0029, 0, 0.66, 0.1667, 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_99381:ImportFrom_L8_C0", "label": "from threading import Thread", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0231, 0.0029, 0, 0.66, 0.2222, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["Thread"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import Thread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Import_L9_C0", "label": "actionlib import actionlib", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.026, 0.0029, 0, 0.66, 0.2778, 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_99381:ImportFrom_L11_C0", "label": "from move_base_msgs.msg import MoveBaseGoal, MoveBaseAction", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0318, 0.0029, 0, 0.66, 0.3333, 440, 0, 2, 0, 0, 440, 0, 0], "semantic": {"name": "move_base_msgs.msg", "arg_names": [], "import_names": ["MoveBaseGoal", "MoveBaseAction"], "rhs_call_name": "", "annotation": ""}, "snippet": "from move_base_msgs.msg import MoveBaseGoal, MoveBaseAction"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:ImportFrom_L12_C0", "label": "from visualization_msgs.msg import MarkerArray", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0347, 0.0029, 0, 0.66, 0.3889, 124, 0, 1, 0, 0, 124, 0, 0], "semantic": {"name": "visualization_msgs.msg", "arg_names": [], "import_names": ["MarkerArray"], "rhs_call_name": "", "annotation": ""}, "snippet": "from visualization_msgs.msg import MarkerArray"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:ImportFrom_L13_C0", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0376, 0.0029, 0, 0.66, 0.4444, 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_99381:ImportFrom_L14_C0", "label": "from geometry_msgs.msg import Vector3, PoseStamped, Quaternion", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0405, 0.0029, 0, 0.66, 0.5, 951, 0, 3, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Vector3", "PoseStamped", "Quaternion"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Vector3, PoseStamped, Quaternion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:ImportFrom_L15_C0", "label": "from std_msgs.msg import ColorRGBA", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0434, 0.0029, 0, 0.66, 0.5556, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["ColorRGBA"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import ColorRGBA"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:ImportFrom_L17_C0", "label": "from explore_hrl.msg import ExploreAction, ExploreResult, ExploreGoal", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0491, 0.0029, 0, 0.66, 0.6111, 232, 0, 3, 0, 0, 232, 0, 0], "semantic": {"name": "explore_hrl.msg", "arg_names": [], "import_names": ["ExploreAction", "ExploreResult", "ExploreGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from explore_hrl.msg import ExploreAction, ExploreResult, ExploreGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Import_L19_C0", "label": "yaml import yaml", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0549, 0.0029, 0, 0.66, 0.6667, 960, 0, 1, 0, 0, 960, 0, 0], "semantic": {"name": "yaml", "arg_names": [], "import_names": ["yaml"], "rhs_call_name": "", "annotation": ""}, "snippet": "import yaml"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Import_L20_C0", "label": "numpy import np, math", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0578, 0.0029, 0, 0.66, 0.7222, 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_99381:FunctionDef_L22_C0", "label": "retfalse", "type": "function", "loc": [22, 23], "level": 0, "parent": null, "vector": [2, 0, 0.065, 0.0058, 0, 0.66, 0.7778, 71, 0, 0, 1, 0, 0, 0, 0], "semantic": {"name": "retfalse", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def retfalse():\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Return_L23_C4", "label": "return", "type": "return", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L22_C0", "vector": [13, 1, 0.0665, 0.0029, 1, 0.69, 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_99381:ClassDef_L25_C0", "label": "TFthread", "type": "class", "loc": [25, 66], "level": 0, "parent": null, "vector": [3, 0, 0.1315, 0.1214, 0, 0.66, 0.8333, 93, 0, 4, 0, 0, 134, 0, 16], "semantic": {"name": "TFthread", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TFthread( Thread ):\n def __init__( self, df ):\n Thread.__init__( self )\n try:\n rospy.init_node( 'TFthread' )\n except:\n pass # parent probably already initialized node.\n self.df = df # yaml dictionary of rooms"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L26_C4", "label": "__init__", "type": "function", "loc": [26, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L25_C0", "vector": [2, 1, 0.0882, 0.0289, 1, 0.16, 0.0, 555, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "df"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, df ):\n Thread.__init__( self )\n try:\n rospy.init_node( 'TFthread' )\n except:\n pass # parent probably already initialized node.\n self.df = df # yaml dictionary of rooms\n self.bc = tf.TransformBroadcaster()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L27_C8", "label": "__init__()", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L26_C4", "vector": [8, 2, 0.078, 0.0029, 2, 0.07, 0.0, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Thread.__init__( self )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L28_C8", "label": "try", "type": "try", "loc": [28, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L26_C4", "vector": [7, 2, 0.0853, 0.0116, 2, 0.07, 0.2, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node( 'TFthread' )\n except:\n pass # parent probably already initialized node."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L29_C12", "label": "init_node()", "type": "expression", "loc": [29, 29], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L28_C8", "vector": [8, 3, 0.0838, 0.0029, 3, 0.47, 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( 'TFthread' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L32_C8", "label": "self.df =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L26_C4", "vector": [14, 2, 0.0925, 0.0029, 2, 0.07, 0.4, 14, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.df", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.df = df # yaml dictionary of rooms"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L33_C8", "label": "self.bc = TransformBroadcaster()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L26_C4", "vector": [14, 2, 0.0954, 0.0029, 2, 0.07, 0.6, 0, 3, 0, 0, 0, 986, 10, 1], "semantic": {"name": "self.bc", "arg_names": [], "import_names": [], "rhs_call_name": "TransformBroadcaster", "annotation": ""}, "snippet": " self.bc = tf.TransformBroadcaster()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L34_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L26_C4", "vector": [14, 2, 0.0983, 0.0029, 2, 0.07, 0.8, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L35_C8", "label": "start()", "type": "expression", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L26_C4", "vector": [8, 2, 0.1012, 0.0029, 2, 0.07, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L37_C4", "label": "publish_transform", "type": "function", "loc": [37, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L25_C0", "vector": [2, 1, 0.1228, 0.0347, 1, 0.16, 0.3333, 288, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "publish_transform", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def publish_transform( self ):\n for room in self.df.keys():\n self.bc.sendTransform( ( self.df[room]['position']['x'],\n self.df[room]['position']['y'],\n self.df[room]['position']['z'] ),\n ( self.df[room]['orientation']['x'],\n self.df[room]['orientation']['y'],\n self.df[room]['orientation']['z'],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L38_C8", "label": "for room", "type": "for", "loc": [38, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L37_C4", "vector": [6, 2, 0.1243, 0.0318, 2, 0.93, 0.0, 846, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "room", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for room in self.df.keys():\n self.bc.sendTransform( ( self.df[room]['position']['x'],\n self.df[room]['position']['y'],\n self.df[room]['position']['z'] ),\n ( self.df[room]['orientation']['x'],\n self.df[room]['orientation']['y'],\n self.df[room]['orientation']['z'],\n self.df[room]['orientation']['w'] ),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L39_C12", "label": "sendTransform()", "type": "expression", "loc": [39, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L38_C8", "vector": [8, 3, 0.1257, 0.0289, 3, 0.86, 0.0, 373, 3, 5, 0, 0, 0, 0, 2], "semantic": {"name": "sendTransform", "arg_names": [], "import_names": [], "rhs_call_name": "sendTransform", "annotation": ""}, "snippet": " self.bc.sendTransform( ( self.df[room]['position']['x'],\n self.df[room]['position']['y'],\n self.df[room]['position']['z'] ),\n ( self.df[room]['orientation']['x'],\n self.df[room]['orientation']['y'],\n self.df[room]['orientation']['z'],\n self.df[room]['orientation']['w'] ),\n rospy.Time.now(),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L50_C4", "label": "run", "type": "function", "loc": [50, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L25_C0", "vector": [2, 1, 0.1575, 0.0289, 1, 0.16, 0.6667, 679, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run( self ):\n rospy.logout( 'TFthread: Starting ' )\n r = rospy.Rate( 10 )\n while self.should_run and not rospy.is_shutdown():\n self.publish_transform()\n try:\n r.sleep()\n except:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L51_C8", "label": "logout()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L50_C4", "vector": [8, 2, 0.1474, 0.0029, 2, 0.6, 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( 'TFthread: Starting ' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L52_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L50_C4", "vector": [14, 2, 0.1503, 0.0029, 2, 0.6, 0.3333, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " r = rospy.Rate( 10 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L53_C8", "label": "while", "type": "while", "loc": [53, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L50_C4", "vector": [5, 2, 0.1604, 0.0173, 2, 0.6, 0.6667, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.should_run and not rospy.is_shutdown():\n self.publish_transform()\n try:\n r.sleep()\n except:\n pass # ROS exception."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L54_C12", "label": "publish_transform()", "type": "expression", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L53_C8", "vector": [8, 3, 0.1561, 0.0029, 3, 0.39, 0.0, 288, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "publish_transform", "arg_names": [], "import_names": [], "rhs_call_name": "publish_transform", "annotation": ""}, "snippet": " self.publish_transform()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L55_C12", "label": "try", "type": "try", "loc": [55, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L53_C8", "vector": [7, 3, 0.1633, 0.0116, 3, 0.39, 1.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n r.sleep()\n except:\n pass # ROS exception."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L56_C16", "label": "sleep()", "type": "expression", "loc": [56, 56], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L55_C12", "vector": [8, 4, 0.1618, 0.0029, 4, 0.94, 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_99381:Expr_L59_C8", "label": "logout()", "type": "expression", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L50_C4", "vector": [8, 2, 0.1705, 0.0029, 2, 0.6, 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( 'TFthread: Starting ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L61_C4", "label": "stop", "type": "function", "loc": [61, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L25_C0", "vector": [2, 1, 0.1835, 0.0173, 1, 0.16, 1.0, 343, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "stop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop( self ):\n # Kill off the poller thread.\n self.should_run = False\n self.join(5)\n if (self.isAlive()):\n raise RuntimeError('TFthread: Unable to stop thread ' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L63_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L61_C4", "vector": [14, 2, 0.1821, 0.0029, 2, 0.23, 0.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L64_C8", "label": "join()", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L61_C4", "vector": [8, 2, 0.185, 0.0029, 2, 0.23, 0.5, 933, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.join(5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L65_C8", "label": "if", "type": "if", "loc": [65, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L61_C4", "vector": [4, 2, 0.1893, 0.0058, 2, 0.23, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.isAlive()):\n raise RuntimeError('TFthread: Unable to stop thread ' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L77_C0", "label": "standard_rad", "type": "function", "loc": [77, 81], "level": 0, "parent": null, "vector": [2, 0, 0.2283, 0.0145, 0, 0.66, 0.8889, 54, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "standard_rad", "arg_names": ["t"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def standard_rad(t):\n if t > 0:\n return ((t + np.pi) % (np.pi * 2)) - np.pi\n else:\n return ((t - np.pi) % (np.pi * -2)) + np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L78_C4", "label": "if", "type": "if", "loc": [78, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L77_C0", "vector": [4, 1, 0.2298, 0.0116, 1, 0.18, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if t > 0:\n return ((t + np.pi) % (np.pi * 2)) - np.pi\n else:\n return ((t - np.pi) % (np.pi * -2)) + np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Return_L79_C8", "label": "return", "type": "return", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L78_C4", "vector": [13, 2, 0.2283, 0.0029, 2, 0.57, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ((t + np.pi) % (np.pi * 2)) - np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Return_L81_C8", "label": "return", "type": "return", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L78_C4", "vector": [13, 2, 0.2341, 0.0029, 2, 0.57, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ((t - np.pi) % (np.pi * -2)) + np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L84_C0", "label": "RoomExplore", "type": "class", "loc": [84, 293], "level": 0, "parent": null, "vector": [3, 0, 0.5448, 0.6069, 0, 0.66, 0.9444, 610, 0, 9, 0, 0, 0, 0, 84], "semantic": {"name": "RoomExplore", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RoomExplore( ):\n def __init__( self, df, room, start_rad = 1.5 ):\n try:\n rospy.init_node( 'RoomExplore' )\n except:\n pass\n self.should_run = True\n self.frame = '/' + room"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "label": "__init__", "type": "function", "loc": [85, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L84_C0", "vector": [2, 1, 0.2803, 0.0723, 1, 0.65, 0.0, 555, 0, 4, 0, 0, 0, 0, 14], "semantic": {"name": "__init__", "arg_names": ["self", "df", "room", "start_rad"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, df, room, start_rad = 1.5 ):\n try:\n rospy.init_node( 'RoomExplore' )\n except:\n pass\n self.should_run = True\n self.frame = '/' + room\n self.old_markers = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L86_C8", "label": "try", "type": "try", "loc": [86, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "vector": [7, 2, 0.2529, 0.0116, 2, 0.67, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node( 'RoomExplore' )\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L87_C12", "label": "init_node()", "type": "expression", "loc": [87, 87], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L86_C8", "vector": [8, 3, 0.2514, 0.0029, 3, 0.12, 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( 'RoomExplore' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L90_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "vector": [14, 2, 0.2601, 0.0029, 2, 0.67, 0.0625, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L91_C8", "label": "self.frame =", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "vector": [14, 2, 0.263, 0.0029, 2, 0.67, 0.125, 409, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.frame = '/' + room"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L92_C8", "label": "self.old_markers =", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "vector": [14, 2, 0.2659, 0.0029, 2, 0.67, 0.1875, 297, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.old_markers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.old_markers = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L93_C8", "label": "self.mid =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "vector": [14, 2, 0.2688, 0.0029, 2, 0.67, 0.25, 732, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.mid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mid = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L95_C8", "label": "self.height =", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "vector": [14, 2, 0.2746, 0.0029, 2, 0.67, 0.3125, 466, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.height", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.height = df[room]['height']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L96_C8", "label": "self.width =", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "vector": [14, 2, 0.2775, 0.0029, 2, 0.67, 0.375, 901, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.width = df[room]['width']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L98_C8", "label": "self.listener = TransformListener()", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "vector": [14, 2, 0.2832, 0.0029, 2, 0.67, 0.4375, 686, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.listener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L99_C8", "label": "waitForTransform()", "type": "expression", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "vector": [8, 2, 0.2861, 0.0029, 2, 0.67, 0.5, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.listener.waitForTransform( '/base_link', '/map', rospy.Time(0), timeout = rospy.Duration(100))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L100_C8", "label": "self.pub = Publisher()", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "vector": [14, 2, 0.289, 0.0029, 2, 0.67, 0.5625, 86, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.pub = rospy.Publisher( 'visarr', Marker )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L102_C8", "label": "setup_poses()", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "vector": [8, 2, 0.2948, 0.0029, 2, 0.67, 0.625, 64, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setup_poses", "arg_names": [], "import_names": [], "rhs_call_name": "setup_poses", "annotation": ""}, "snippet": " self.setup_poses( radius = start_rad ) # also initializes radius"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L103_C8", "label": "print()", "type": "expression", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "vector": [8, 2, 0.2977, 0.0029, 2, 0.67, 0.6875, 535, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Len: ', len(self.poses), ' Publishing.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L104_C8", "label": "publish_markers()", "type": "expression", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "vector": [8, 2, 0.3006, 0.0029, 2, 0.67, 0.75, 116, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "publish_markers", "arg_names": [], "import_names": [], "rhs_call_name": "publish_markers", "annotation": ""}, "snippet": " self.publish_markers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L106_C8", "label": "self._as = SimpleActionServer()", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "vector": [14, 2, 0.3064, 0.0029, 2, 0.67, 0.8125, 777, 3, 3, 0, 0, 975, 10, 1], "semantic": {"name": "self._as", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionServer", "annotation": ""}, "snippet": " self._as = actionlib.SimpleActionServer( '/explore', ExploreAction, execute_cb = self.action_request )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L107_C8", "label": "start()", "type": "expression", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "vector": [8, 2, 0.3092, 0.0029, 2, 0.67, 0.875, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self._as.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L108_C8", "label": "publish_markers()", "type": "expression", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "vector": [8, 2, 0.3121, 0.0029, 2, 0.67, 0.9375, 116, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "publish_markers", "arg_names": [], "import_names": [], "rhs_call_name": "publish_markers", "annotation": ""}, "snippet": " self.publish_markers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L109_C8", "label": "logout()", "type": "expression", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "vector": [8, 2, 0.315, 0.0029, 2, 0.67, 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('Action should be started.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L111_C4", "label": "action_request", "type": "function", "loc": [111, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L84_C0", "vector": [2, 1, 0.341, 0.0434, 1, 0.65, 0.1429, 616, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "action_request", "arg_names": ["self", "goal"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def action_request( self, goal ):\n rospy.logout( 'room_explore: action_request received for radius: \\'%2.2f\\'' % goal.radius )\n \n def preempt_func():\n # self._as should be in scope and bound @ function def. (I think for python...)\n check = self._as.is_preempt_requested()\n if check:\n rospy.logout( 'room_explore: action_request preempted!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L112_C8", "label": "logout()", "type": "expression", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L111_C4", "vector": [8, 2, 0.3237, 0.0029, 2, 0.17, 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( 'room_explore: action_request received for radius: \\'%2.2f\\'' % goal.radius )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L114_C8", "label": "preempt_func", "type": "function", "loc": [114, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L111_C4", "vector": [2, 2, 0.3367, 0.0173, 2, 0.17, 0.25, 314, 0, 0, 1, 0, 0, 0, 2], "semantic": {"name": "preempt_func", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def preempt_func():\n # self._as should be in scope and bound @ function def. (I think for python...)\n check = self._as.is_preempt_requested()\n if check:\n rospy.logout( 'room_explore: action_request preempted!' )\n return check"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L116_C12", "label": "check = is_preempt_requested()", "type": "assigned_variable", "loc": [116, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L114_C8", "vector": [14, 3, 0.3353, 0.0029, 3, 0.5, 0.0, 803, 3, 0, 0, 0, 468, 10, 1], "semantic": {"name": "check", "arg_names": [], "import_names": [], "rhs_call_name": "is_preempt_requested", "annotation": ""}, "snippet": " check = self._as.is_preempt_requested()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L117_C12", "label": "if", "type": "if", "loc": [117, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L114_C8", "vector": [4, 3, 0.3396, 0.0058, 3, 0.5, 0.5, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if check:\n rospy.logout( 'room_explore: action_request preempted!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L118_C16", "label": "logout()", "type": "expression", "loc": [118, 118], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L117_C12", "vector": [8, 4, 0.341, 0.0029, 4, 0.67, 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( 'room_explore: action_request preempted!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Return_L119_C12", "label": "return", "type": "return", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L114_C8", "vector": [13, 3, 0.3439, 0.0029, 3, 0.5, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return check"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L121_C8", "label": "rv = begin_explore()", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L111_C4", "vector": [14, 2, 0.3497, 0.0029, 2, 0.17, 0.5, 222, 3, 2, 0, 0, 417, 10, 1], "semantic": {"name": "rv", "arg_names": [], "import_names": [], "rhs_call_name": "begin_explore", "annotation": ""}, "snippet": " rv = self.begin_explore( goal.radius, preempt_func = preempt_func )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L122_C8", "label": "logout()", "type": "expression", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L111_C4", "vector": [8, 2, 0.3526, 0.0029, 2, 0.17, 0.75, 525, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'room_explore: action_request received result %d' % int(rv) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L124_C8", "label": "if", "type": "if", "loc": [124, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L111_C4", "vector": [4, 2, 0.3598, 0.0058, 2, 0.17, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rv == True:\n self._as.set_succeeded( ExploreResult() )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L125_C12", "label": "set_succeeded()", "type": "expression", "loc": [125, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L124_C8", "vector": [8, 3, 0.3613, 0.0029, 3, 0.01, 0.0, 825, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_succeeded", "arg_names": [], "import_names": [], "rhs_call_name": "set_succeeded", "annotation": ""}, "snippet": " self._as.set_succeeded( ExploreResult() )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L128_C4", "label": "begin_explore", "type": "function", "loc": [128, 203], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L84_C0", "vector": [2, 1, 0.4783, 0.2197, 1, 0.65, 0.2857, 417, 0, 3, 1, 0, 0, 0, 39], "semantic": {"name": "begin_explore", "arg_names": ["self", "radius", "preempt_func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def begin_explore( self, radius, preempt_func = retfalse ):\n client = actionlib.SimpleActionClient( 'move_base', MoveBaseAction )\n rospy.logout( 'Waiting for move_base server' )\n client.wait_for_server()\n\n rospy.logout( 'room_explore: setting radius' )\n all_goals = self.setup_poses( radius )\n self.publish_markers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L129_C8", "label": "client = SimpleActionClient()", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L128_C4", "vector": [14, 2, 0.3728, 0.0029, 2, 0.12, 0.0, 608, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " client = actionlib.SimpleActionClient( 'move_base', MoveBaseAction )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L130_C8", "label": "logout()", "type": "expression", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L128_C4", "vector": [8, 2, 0.3757, 0.0029, 2, 0.12, 0.1429, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'Waiting for move_base server' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L131_C8", "label": "wait_for_server()", "type": "expression", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L128_C4", "vector": [8, 2, 0.3786, 0.0029, 2, 0.12, 0.2857, 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_99381:Expr_L133_C8", "label": "logout()", "type": "expression", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L128_C4", "vector": [8, 2, 0.3844, 0.0029, 2, 0.12, 0.4286, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'room_explore: setting radius' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L134_C8", "label": "all_goals = setup_poses()", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L128_C4", "vector": [14, 2, 0.3873, 0.0029, 2, 0.12, 0.5714, 768, 3, 1, 0, 0, 64, 10, 1], "semantic": {"name": "all_goals", "arg_names": [], "import_names": [], "rhs_call_name": "setup_poses", "annotation": ""}, "snippet": " all_goals = self.setup_poses( radius )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L135_C8", "label": "publish_markers()", "type": "expression", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L128_C4", "vector": [8, 2, 0.3902, 0.0029, 2, 0.12, 0.7143, 116, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "publish_markers", "arg_names": [], "import_names": [], "rhs_call_name": "publish_markers", "annotation": ""}, "snippet": " self.publish_markers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L136_C8", "label": "for goal", "type": "for", "loc": [136, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L128_C4", "vector": [6, 2, 0.487, 0.1908, 2, 0.12, 0.8571, 914, 2, 0, 0, 0, 0, 0, 33], "semantic": {"name": "goal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for goal in all_goals:\n #print 'room_explore: sending goal ', goal\n goal.target_pose.header.stamp = rospy.Time.now()\n\n client.send_goal( goal )\n\n time_last_moving = rospy.Time.now()\n goal_time = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L138_C12", "label": "goal.target_pose.header.stamp = now()", "type": "assigned_variable", "loc": [138, 138], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L136_C8", "vector": [14, 3, 0.3988, 0.0029, 3, 0.0, 0.0, 212, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "goal.target_pose.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " goal.target_pose.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L140_C12", "label": "send_goal()", "type": "expression", "loc": [140, 140], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L136_C8", "vector": [8, 3, 0.4046, 0.0029, 3, 0.0, 0.1111, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " client.send_goal( goal )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L142_C12", "label": "time_last_moving = now()", "type": "assigned_variable", "loc": [142, 142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L136_C8", "vector": [14, 3, 0.4104, 0.0029, 3, 0.0, 0.2222, 83, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "time_last_moving", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " time_last_moving = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L143_C12", "label": "goal_time = now()", "type": "assigned_variable", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L136_C8", "vector": [14, 3, 0.4133, 0.0029, 3, 0.0, 0.3333, 297, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "goal_time", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " goal_time = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L145_C12", "label": "new_pose = current_robot_position()", "type": "assigned_variable", "loc": [145, 145], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L136_C8", "vector": [14, 3, 0.4191, 0.0029, 3, 0.0, 0.4444, 216, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "new_pose", "arg_names": [], "import_names": [], "rhs_call_name": "current_robot_position", "annotation": ""}, "snippet": " new_pose = self.current_robot_position()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L146_C12", "label": "ref_pose = current_robot_position()", "type": "assigned_variable", "loc": [146, 146], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L136_C8", "vector": [14, 3, 0.422, 0.0029, 3, 0.0, 0.5556, 213, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "ref_pose", "arg_names": [], "import_names": [], "rhs_call_name": "current_robot_position", "annotation": ""}, "snippet": " ref_pose = self.current_robot_position()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L148_C12", "label": "r = Rate()", "type": "assigned_variable", "loc": [148, 148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L136_C8", "vector": [14, 3, 0.4277, 0.0029, 3, 0.0, 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( 5 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "label": "while", "type": "while", "loc": [149, 196], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L136_C8", "vector": [5, 3, 0.4986, 0.1387, 3, 0.0, 0.7778, 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 state = client.get_state()\n states = { 0: 'WAITING FOR GOAL ACK',\n 1: 'PENDING',\n 2: 'ACTIVE',\n 3: 'WAITING FOR RESULT',\n 4: 'WAITING FOR CANCEL ACK',\n 5: 'RECALLING',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L150_C16", "label": "state = get_state()", "type": "assigned_variable", "loc": [150, 150], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "vector": [14, 4, 0.4335, 0.0029, 4, 0.86, 0.0, 688, 3, 0, 0, 0, 650, 10, 1], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "get_state", "annotation": ""}, "snippet": " state = client.get_state()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L151_C16", "label": "states =", "type": "assigned_variable", "loc": [151, 158], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "vector": [14, 4, 0.4465, 0.0231, 4, 0.86, 0.0909, 728, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "states", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " states = { 0: 'WAITING FOR GOAL ACK',\n 1: 'PENDING',\n 2: 'ACTIVE',\n 3: 'WAITING FOR RESULT',\n 4: 'WAITING FOR CANCEL ACK',\n 5: 'RECALLING',\n 6: 'PREEMPTING',\n 7: 'DONE' }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L163_C16", "label": "if", "type": "if", "loc": [163, 167], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "vector": [4, 4, 0.4769, 0.0145, 4, 0.86, 0.1818, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if state == 7 or state == 3:\n rospy.logout( 'room_explore: client no longer active' )\n print('State: ', state, ' ', states[state])\n time_last_moving = rospy.Time.now()\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L164_C20", "label": "logout()", "type": "expression", "loc": [164, 164], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L163_C16", "vector": [8, 5, 0.474, 0.0029, 5, 0.96, 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( 'room_explore: client no longer active' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L165_C20", "label": "print()", "type": "expression", "loc": [165, 165], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L163_C16", "vector": [8, 5, 0.4769, 0.0029, 5, 0.96, 0.5, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('State: ', state, ' ', states[state])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L166_C20", "label": "time_last_moving = now()", "type": "assigned_variable", "loc": [166, 166], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L163_C16", "vector": [14, 5, 0.4798, 0.0029, 5, 0.96, 1.0, 83, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "time_last_moving", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " time_last_moving = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L169_C16", "label": "if", "type": "if", "loc": [169, 172], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "vector": [4, 4, 0.4928, 0.0116, 4, 0.86, 0.2727, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if preempt_func():\n rospy.logout( 'room_explore: preempted at a higher level.' )\n time_last_moving = rospy.Time.now()\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L170_C20", "label": "logout()", "type": "expression", "loc": [170, 170], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L169_C16", "vector": [8, 5, 0.4913, 0.0029, 5, 0.39, 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( 'room_explore: preempted at a higher level.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L171_C20", "label": "time_last_moving = now()", "type": "assigned_variable", "loc": [171, 171], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L169_C16", "vector": [14, 5, 0.4942, 0.0029, 5, 0.39, 1.0, 83, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "time_last_moving", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " time_last_moving = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L174_C16", "label": "new_pose = current_robot_position()", "type": "assigned_variable", "loc": [174, 174], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "vector": [14, 4, 0.5029, 0.0029, 4, 0.86, 0.3636, 216, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "new_pose", "arg_names": [], "import_names": [], "rhs_call_name": "current_robot_position", "annotation": ""}, "snippet": " new_pose = self.current_robot_position()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L175_C16", "label": "dx =", "type": "assigned_variable", "loc": [175, 175], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "vector": [14, 4, 0.5058, 0.0029, 4, 0.86, 0.4545, 870, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dx = new_pose[0] - ref_pose[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L176_C16", "label": "dy =", "type": "assigned_variable", "loc": [176, 176], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "vector": [14, 4, 0.5087, 0.0029, 4, 0.86, 0.5455, 477, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dy = new_pose[1] - ref_pose[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L177_C16", "label": "da =", "type": "assigned_variable", "loc": [177, 177], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "vector": [14, 4, 0.5116, 0.0029, 4, 0.86, 0.6364, 444, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "da", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " da = new_pose[-1] - ref_pose[-1] # yaw"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L179_C16", "label": "if", "type": "if", "loc": [179, 182], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "vector": [4, 4, 0.5217, 0.0116, 4, 0.86, 0.7273, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dx*dx + dy*dy > 0.02 or da*da > math.radians( 5 ):\n time_last_moving = rospy.Time.now()\n ref_pose = self.current_robot_position()\n rospy.logout('WE ARE MOVING')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L180_C20", "label": "time_last_moving = now()", "type": "assigned_variable", "loc": [180, 180], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L179_C16", "vector": [14, 5, 0.5202, 0.0029, 5, 0.21, 0.0, 83, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "time_last_moving", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " time_last_moving = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L181_C20", "label": "ref_pose = current_robot_position()", "type": "assigned_variable", "loc": [181, 181], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L179_C16", "vector": [14, 5, 0.5231, 0.0029, 5, 0.21, 0.5, 213, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "ref_pose", "arg_names": [], "import_names": [], "rhs_call_name": "current_robot_position", "annotation": ""}, "snippet": " ref_pose = self.current_robot_position()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L182_C20", "label": "logout()", "type": "expression", "loc": [182, 182], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L179_C16", "vector": [8, 5, 0.526, 0.0029, 5, 0.21, 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('WE ARE MOVING')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L184_C16", "label": "if", "type": "if", "loc": [184, 188], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "vector": [4, 4, 0.5376, 0.0145, 4, 0.86, 0.8182, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rospy.Time.now() - time_last_moving > rospy.Duration( 8 ):\n rospy.logout( 'We do not appear to have moved. Aborting current goal.' )\n client.cancel_all_goals() # Should force a break on GoalState\n time_last_moving = rospy.Time.now()\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L185_C20", "label": "logout()", "type": "expression", "loc": [185, 185], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L184_C16", "vector": [8, 5, 0.5347, 0.0029, 5, 0.44, 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( 'We do not appear to have moved. Aborting current goal.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L186_C20", "label": "cancel_all_goals()", "type": "expression", "loc": [186, 186], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L184_C16", "vector": [8, 5, 0.5376, 0.0029, 5, 0.44, 0.5, 699, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel_all_goals", "arg_names": [], "import_names": [], "rhs_call_name": "cancel_all_goals", "annotation": ""}, "snippet": " client.cancel_all_goals() # Should force a break on GoalState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L187_C20", "label": "time_last_moving = now()", "type": "assigned_variable", "loc": [187, 187], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L184_C16", "vector": [14, 5, 0.5405, 0.0029, 5, 0.44, 1.0, 83, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "time_last_moving", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " time_last_moving = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L190_C16", "label": "if", "type": "if", "loc": [190, 194], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "vector": [4, 4, 0.5549, 0.0145, 4, 0.86, 0.9091, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rospy.Time.now() - goal_time > rospy.Duration( 30 ):\n rospy.logout( 'Goal not achieved after 30 seconds. Aborting.' )\n client.cancel_all_goals() # Should force a break on GoalState\n time_last_moving = rospy.Time.now()\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L191_C20", "label": "logout()", "type": "expression", "loc": [191, 191], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L190_C16", "vector": [8, 5, 0.552, 0.0029, 5, 0.46, 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( 'Goal not achieved after 30 seconds. Aborting.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L192_C20", "label": "cancel_all_goals()", "type": "expression", "loc": [192, 192], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L190_C16", "vector": [8, 5, 0.5549, 0.0029, 5, 0.46, 0.5, 699, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel_all_goals", "arg_names": [], "import_names": [], "rhs_call_name": "cancel_all_goals", "annotation": ""}, "snippet": " client.cancel_all_goals() # Should force a break on GoalState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L193_C20", "label": "time_last_moving = now()", "type": "assigned_variable", "loc": [193, 193], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L190_C16", "vector": [14, 5, 0.5578, 0.0029, 5, 0.46, 1.0, 83, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "time_last_moving", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " time_last_moving = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L196_C16", "label": "sleep()", "type": "expression", "loc": [196, 196], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "vector": [8, 4, 0.5665, 0.0029, 4, 0.86, 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_99381:Expr_L198_C12", "label": "cancel_all_goals()", "type": "expression", "loc": [198, 198], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L136_C8", "vector": [8, 3, 0.5723, 0.0029, 3, 0.0, 0.8889, 699, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel_all_goals", "arg_names": [], "import_names": [], "rhs_call_name": "cancel_all_goals", "annotation": ""}, "snippet": " client.cancel_all_goals() # Just in case"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L200_C12", "label": "if", "type": "if", "loc": [200, 201], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L136_C8", "vector": [4, 3, 0.5795, 0.0058, 3, 0.0, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if preempt_func(): # immediately exit if overall action preempted\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Return_L203_C8", "label": "return", "type": "return", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L128_C4", "vector": [13, 2, 0.5867, 0.0029, 2, 0.12, 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_99381:FunctionDef_L206_C4", "label": "current_robot_position", "type": "function", "loc": [206, 234], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L84_C0", "vector": [2, 1, 0.6358, 0.0838, 1, 0.65, 0.4286, 908, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "current_robot_position", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def current_robot_position( self ):\n ps = PoseStamped()\n ps.header.stamp = rospy.Time(0)\n ps.header.frame_id = '/base_link'\n ps.pose.orientation.w = 1.0\n\n try:\n ps_map = self.listener.transformPose( '/map', ps )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L207_C8", "label": "ps = PoseStamped()", "type": "assigned_variable", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L206_C4", "vector": [14, 2, 0.5983, 0.0029, 2, 0.1, 0.0, 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_99381:Assign_L208_C8", "label": "ps.header.stamp = Time()", "type": "assigned_variable", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L206_C4", "vector": [14, 2, 0.6012, 0.0029, 2, 0.1, 0.1429, 161, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " ps.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L209_C8", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L206_C4", "vector": [14, 2, 0.604, 0.0029, 2, 0.1, 0.2857, 293, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ps.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.header.frame_id = '/base_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L210_C8", "label": "ps.pose.orientation.w =", "type": "assigned_variable", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L206_C4", "vector": [14, 2, 0.6069, 0.0029, 2, 0.1, 0.4286, 163, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "ps.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.w = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L212_C8", "label": "try", "type": "try", "loc": [212, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L206_C4", "vector": [7, 2, 0.6228, 0.0231, 2, 0.1, 0.5714, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n ps_map = self.listener.transformPose( '/map', ps )\n except:\n rospy.logout( 'room_explore: Transform failed' )\n ps_map = PoseStamped()\n ps_map.header.stamp = rospy.Time.now()\n ps_map.header.frame_id = '/map'\n ps_map.pose.orientation = new_quat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L213_C12", "label": "ps_map = transformPose()", "type": "assigned_variable", "loc": [213, 213], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L212_C8", "vector": [14, 3, 0.6156, 0.0029, 3, 0.27, 0.0, 938, 3, 2, 0, 0, 654, 10, 1], "semantic": {"name": "ps_map", "arg_names": [], "import_names": [], "rhs_call_name": "transformPose", "annotation": ""}, "snippet": " ps_map = self.listener.transformPose( '/map', ps )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L215_C12", "label": "logout()", "type": "expression", "loc": [215, 215], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L212_C8", "vector": [8, 3, 0.6214, 0.0029, 3, 0.27, 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( 'room_explore: Transform failed' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L216_C12", "label": "ps_map = PoseStamped()", "type": "assigned_variable", "loc": [216, 216], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L212_C8", "vector": [14, 3, 0.6243, 0.0029, 3, 0.27, 0.25, 938, 3, 0, 0, 0, 226, 10, 1], "semantic": {"name": "ps_map", "arg_names": [], "import_names": [], "rhs_call_name": "PoseStamped", "annotation": ""}, "snippet": " ps_map = PoseStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L217_C12", "label": "ps_map.header.stamp = now()", "type": "assigned_variable", "loc": [217, 217], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L212_C8", "vector": [14, 3, 0.6272, 0.0029, 3, 0.27, 0.5, 322, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "ps_map.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " ps_map.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L218_C12", "label": "ps_map.header.frame_id =", "type": "assigned_variable", "loc": [218, 218], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L212_C8", "vector": [14, 3, 0.6301, 0.0029, 3, 0.27, 0.75, 933, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ps_map.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps_map.header.frame_id = '/map'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L219_C12", "label": "ps_map.pose.orientation =", "type": "assigned_variable", "loc": [219, 219], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L212_C8", "vector": [14, 3, 0.6329, 0.0029, 3, 0.27, 1.0, 49, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps_map.pose.orientation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps_map.pose.orientation = new_quat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L221_C8", "label": "roll, pitch, yaw = euler_from_quaternion()", "type": "assigned_variable", "loc": [221, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L206_C4", "vector": [14, 2, 0.6431, 0.0116, 2, 0.1, 0.7143, 633, 3, 1, 0, 0, 409, 10, 1], "semantic": {"name": "roll, pitch, yaw", "arg_names": [], "import_names": [], "rhs_call_name": "euler_from_quaternion", "annotation": ""}, "snippet": " roll, pitch, yaw = tf.transformations.euler_from_quaternion(( ps_map.pose.orientation.x,\n ps_map.pose.orientation.y,\n ps_map.pose.orientation.z,\n ps_map.pose.orientation.w ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L226_C8", "label": "rv =", "type": "assigned_variable", "loc": [226, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L206_C4", "vector": [14, 2, 0.6604, 0.0173, 2, 0.1, 0.8571, 222, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "rv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rv = [ ps_map.pose.position.x,\n ps_map.pose.position.y,\n ps_map.pose.position.z,\n roll,\n pitch,\n yaw ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Return_L234_C8", "label": "return", "type": "return", "loc": [234, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L206_C4", "vector": [13, 2, 0.6763, 0.0029, 2, 0.1, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L237_C4", "label": "setup_poses", "type": "function", "loc": [237, 266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L84_C0", "vector": [2, 1, 0.7269, 0.0867, 1, 0.65, 0.5714, 64, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "setup_poses", "arg_names": ["self", "radius"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setup_poses( self, radius ):\n self.radius = radius\n xdir = np.arange( self.radius / 2.0, self.height + self.radius / 2.0, self.radius )\n ydir = np.arange( self.radius / 2.0, self.width + self.radius / 2.0, self.radius )\n\n move_dir = 0.0\n self.poses = []\n mod = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L238_C8", "label": "self.radius =", "type": "assigned_variable", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L237_C4", "vector": [14, 2, 0.6879, 0.0029, 2, 0.47, 0.0, 390, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.radius", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.radius = radius"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L239_C8", "label": "xdir = arange()", "type": "assigned_variable", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L237_C4", "vector": [14, 2, 0.6908, 0.0029, 2, 0.47, 0.1429, 622, 3, 3, 0, 0, 489, 10, 1], "semantic": {"name": "xdir", "arg_names": [], "import_names": [], "rhs_call_name": "arange", "annotation": ""}, "snippet": " xdir = np.arange( self.radius / 2.0, self.height + self.radius / 2.0, self.radius )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L240_C8", "label": "ydir = arange()", "type": "assigned_variable", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L237_C4", "vector": [14, 2, 0.6936, 0.0029, 2, 0.47, 0.2857, 232, 3, 3, 0, 0, 489, 10, 1], "semantic": {"name": "ydir", "arg_names": [], "import_names": [], "rhs_call_name": "arange", "annotation": ""}, "snippet": " ydir = np.arange( self.radius / 2.0, self.width + self.radius / 2.0, self.radius )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L242_C8", "label": "move_dir =", "type": "assigned_variable", "loc": [242, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L237_C4", "vector": [14, 2, 0.6994, 0.0029, 2, 0.47, 0.4286, 21, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "move_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " move_dir = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L243_C8", "label": "self.poses =", "type": "assigned_variable", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L237_C4", "vector": [14, 2, 0.7023, 0.0029, 2, 0.47, 0.5714, 872, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.poses", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.poses = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L244_C8", "label": "mod =", "type": "assigned_variable", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L237_C4", "vector": [14, 2, 0.7052, 0.0029, 2, 0.47, 0.7143, 25, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "mod", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mod = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L245_C8", "label": "for y", "type": "for", "loc": [245, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L237_C4", "vector": [6, 2, 0.737, 0.0607, 2, 0.47, 0.8571, 304, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for y in ydir:\n if mod == 0:\n xord = xdir\n else:\n xord = xdir[::-1]\n \n for x in xord:\n goal = MoveBaseGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L246_C12", "label": "if", "type": "if", "loc": [246, 249], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L245_C8", "vector": [4, 3, 0.7153, 0.0116, 3, 0.94, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mod == 0:\n xord = xdir\n else:\n xord = xdir[::-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L247_C16", "label": "xord =", "type": "assigned_variable", "loc": [247, 247], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L246_C12", "vector": [14, 4, 0.7139, 0.0029, 4, 0.67, 0.0, 622, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xord", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xord = xdir"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L249_C16", "label": "xord =", "type": "assigned_variable", "loc": [249, 249], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L246_C12", "vector": [14, 4, 0.7197, 0.0029, 4, 0.67, 1.0, 622, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xord", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xord = xdir[::-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L251_C12", "label": "for x", "type": "for", "loc": [251, 263], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L245_C8", "vector": [6, 3, 0.7428, 0.0376, 3, 0.94, 0.3333, 190, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x in xord:\n goal = MoveBaseGoal()\n goal.target_pose.header.frame_id = self.frame\n goal.target_pose.header.stamp = rospy.Time.now()\n goal.target_pose.pose.position.x = x\n goal.target_pose.pose.position.y = y\n quat = tf.transformations.quaternion_from_euler( 0.0, 0.0, move_dir )\n goal.target_pose.pose.orientation.x = quat[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L252_C16", "label": "goal = MoveBaseGoal()", "type": "assigned_variable", "loc": [252, 252], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L251_C12", "vector": [14, 4, 0.7283, 0.0029, 4, 0.99, 0.0, 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_99381:Assign_L253_C16", "label": "goal.target_pose.header.frame_id =", "type": "assigned_variable", "loc": [253, 253], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L251_C12", "vector": [14, 4, 0.7312, 0.0029, 4, 0.99, 0.1, 138, 7, 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 = self.frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L254_C16", "label": "goal.target_pose.header.stamp = now()", "type": "assigned_variable", "loc": [254, 254], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L251_C12", "vector": [14, 4, 0.7341, 0.0029, 4, 0.99, 0.2, 212, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "goal.target_pose.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " goal.target_pose.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L255_C16", "label": "goal.target_pose.pose.position.x =", "type": "assigned_variable", "loc": [255, 255], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L251_C12", "vector": [14, 4, 0.737, 0.0029, 4, 0.99, 0.3, 47, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.target_pose.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.target_pose.pose.position.x = x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L256_C16", "label": "goal.target_pose.pose.position.y =", "type": "assigned_variable", "loc": [256, 256], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L251_C12", "vector": [14, 4, 0.7399, 0.0029, 4, 0.99, 0.4, 87, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.target_pose.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.target_pose.pose.position.y = y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L257_C16", "label": "quat = quaternion_from_euler()", "type": "assigned_variable", "loc": [257, 257], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L251_C12", "vector": [14, 4, 0.7428, 0.0029, 4, 0.99, 0.5, 367, 3, 3, 0, 0, 561, 10, 1], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_from_euler", "annotation": ""}, "snippet": " quat = tf.transformations.quaternion_from_euler( 0.0, 0.0, move_dir )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L258_C16", "label": "goal.target_pose.pose.orientation.x =", "type": "assigned_variable", "loc": [258, 258], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L251_C12", "vector": [14, 4, 0.7457, 0.0029, 4, 0.99, 0.6, 171, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.target_pose.pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.target_pose.pose.orientation.x = quat[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L259_C16", "label": "goal.target_pose.pose.orientation.y =", "type": "assigned_variable", "loc": [259, 259], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L251_C12", "vector": [14, 4, 0.7486, 0.0029, 4, 0.99, 0.7, 381, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.target_pose.pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.target_pose.pose.orientation.y = quat[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L260_C16", "label": "goal.target_pose.pose.orientation.z =", "type": "assigned_variable", "loc": [260, 260], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L251_C12", "vector": [14, 4, 0.7514, 0.0029, 4, 0.99, 0.8, 258, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.target_pose.pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.target_pose.pose.orientation.z = quat[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L261_C16", "label": "goal.target_pose.pose.orientation.w =", "type": "assigned_variable", "loc": [261, 261], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L251_C12", "vector": [14, 4, 0.7543, 0.0029, 4, 0.99, 0.9, 361, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.target_pose.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.target_pose.pose.orientation.w = quat[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L263_C16", "label": "append()", "type": "expression", "loc": [263, 263], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L251_C12", "vector": [8, 4, 0.7601, 0.0029, 4, 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": " self.poses.append( goal )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L264_C12", "label": "move_dir = standard_rad()", "type": "assigned_variable", "loc": [264, 264], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L245_C8", "vector": [14, 3, 0.763, 0.0029, 3, 0.94, 0.6667, 21, 3, 1, 0, 0, 54, 10, 1], "semantic": {"name": "move_dir", "arg_names": [], "import_names": [], "rhs_call_name": "standard_rad", "annotation": ""}, "snippet": " move_dir = standard_rad( move_dir + np.pi )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L265_C12", "label": "mod =", "type": "assigned_variable", "loc": [265, 265], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L245_C8", "vector": [14, 3, 0.7659, 0.0029, 3, 0.94, 1.0, 25, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mod", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mod = ( mod + 1 ) % 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Return_L266_C8", "label": "return", "type": "return", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L237_C4", "vector": [13, 2, 0.7688, 0.0029, 2, 0.47, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.poses"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L268_C4", "label": "destroy_old_markers", "type": "function", "loc": [268, 272], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L84_C0", "vector": [2, 1, 0.7803, 0.0145, 1, 0.65, 0.7143, 102, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "destroy_old_markers", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def destroy_old_markers( self ):\n for m in self.old_markers:\n m.action = m.DELETE\n self.pub.publish( m )\n self.old_markers = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L269_C8", "label": "for m", "type": "for", "loc": [269, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L268_C4", "vector": [6, 2, 0.7803, 0.0087, 2, 0.82, 0.0, 711, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for m in self.old_markers:\n m.action = m.DELETE\n self.pub.publish( m )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L270_C12", "label": "m.action =", "type": "assigned_variable", "loc": [270, 270], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L269_C8", "vector": [14, 3, 0.7803, 0.0029, 3, 0.17, 0.0, 654, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.action = m.DELETE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L271_C12", "label": "publish()", "type": "expression", "loc": [271, 271], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L269_C8", "vector": [8, 3, 0.7832, 0.0029, 3, 0.17, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.pub.publish( m )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L272_C8", "label": "self.old_markers =", "type": "assigned_variable", "loc": [272, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L268_C4", "vector": [14, 2, 0.7861, 0.0029, 2, 0.82, 1.0, 297, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.old_markers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.old_markers = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L274_C4", "label": "publish_markers", "type": "function", "loc": [274, 290], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L84_C0", "vector": [2, 1, 0.815, 0.0491, 1, 0.65, 0.8571, 116, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "publish_markers", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def publish_markers( self ):\n self.destroy_old_markers()\n for i,g in enumerate(self.poses):\n self.mid += 1\n m = Marker()\n m.ns = 'explore_poses'\n m.id = self.mid\n m.action = m.ADD"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L275_C8", "label": "destroy_old_markers()", "type": "expression", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L274_C4", "vector": [8, 2, 0.7948, 0.0029, 2, 0.5, 0.0, 102, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "destroy_old_markers", "arg_names": [], "import_names": [], "rhs_call_name": "destroy_old_markers", "annotation": ""}, "snippet": " self.destroy_old_markers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "label": "for i, g", "type": "for", "loc": [276, 290], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L274_C4", "vector": [6, 2, 0.8179, 0.0434, 2, 0.5, 1.0, 674, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "i, g", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,g in enumerate(self.poses):\n self.mid += 1\n m = Marker()\n m.ns = 'explore_poses'\n m.id = self.mid\n m.action = m.ADD\n m.type = m.ARROW\n m.header.frame_id = self.frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L278_C12", "label": "m = Marker()", "type": "assigned_variable", "loc": [278, 278], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "vector": [14, 3, 0.8035, 0.0029, 3, 0.4, 0.0, 711, 3, 0, 0, 0, 923, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "Marker", "annotation": ""}, "snippet": " m = Marker()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L279_C12", "label": "m.ns =", "type": "assigned_variable", "loc": [279, 279], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "vector": [14, 3, 0.8064, 0.0029, 3, 0.4, 0.0909, 889, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "m.ns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.ns = 'explore_poses'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L280_C12", "label": "m.id =", "type": "assigned_variable", "loc": [280, 280], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "vector": [14, 3, 0.8092, 0.0029, 3, 0.4, 0.1818, 46, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.id = self.mid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L281_C12", "label": "m.action =", "type": "assigned_variable", "loc": [281, 281], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "vector": [14, 3, 0.8121, 0.0029, 3, 0.4, 0.2727, 654, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.action = m.ADD"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L282_C12", "label": "m.type =", "type": "assigned_variable", "loc": [282, 282], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "vector": [14, 3, 0.815, 0.0029, 3, 0.4, 0.3636, 148, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.type = m.ARROW"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L283_C12", "label": "m.header.frame_id =", "type": "assigned_variable", "loc": [283, 283], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "vector": [14, 3, 0.8179, 0.0029, 3, 0.4, 0.4545, 636, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.header.frame_id = self.frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L284_C12", "label": "m.header.stamp = now()", "type": "assigned_variable", "loc": [284, 284], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "vector": [14, 3, 0.8208, 0.0029, 3, 0.4, 0.5455, 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_99381:Assign_L285_C12", "label": "m.scale = Vector3()", "type": "assigned_variable", "loc": [285, 285], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "vector": [14, 3, 0.8237, 0.0029, 3, 0.4, 0.6364, 508, 3, 3, 0, 0, 759, 10, 1], "semantic": {"name": "m.scale", "arg_names": [], "import_names": [], "rhs_call_name": "Vector3", "annotation": ""}, "snippet": " m.scale = Vector3( 0.15, 1.0, 1.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L286_C12", "label": "m.color = ColorRGBA()", "type": "assigned_variable", "loc": [286, 286], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "vector": [14, 3, 0.8266, 0.0029, 3, 0.4, 0.7273, 882, 3, 4, 0, 0, 927, 10, 1], "semantic": {"name": "m.color", "arg_names": [], "import_names": [], "rhs_call_name": "ColorRGBA", "annotation": ""}, "snippet": " m.color = ColorRGBA( 0.2, 1.0, 0.2, 0.7 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L287_C12", "label": "m.pose =", "type": "assigned_variable", "loc": [287, 287], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "vector": [14, 3, 0.8295, 0.0029, 3, 0.4, 0.8182, 927, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.pose = g.target_pose.pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L289_C12", "label": "append()", "type": "expression", "loc": [289, 289], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "vector": [8, 3, 0.8353, 0.0029, 3, 0.4, 0.9091, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.old_markers.append( m )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L290_C12", "label": "publish()", "type": "expression", "loc": [290, 290], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "vector": [8, 3, 0.8382, 0.0029, 3, 0.4, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.pub.publish( m )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L292_C4", "label": "goals", "type": "function", "loc": [292, 293], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L84_C0", "vector": [2, 1, 0.8454, 0.0058, 1, 0.65, 1.0, 747, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "goals", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def goals( self ):\n return self.poses"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Return_L293_C8", "label": "return", "type": "return", "loc": [293, 293], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L292_C4", "vector": [13, 2, 0.8468, 0.0029, 2, 0.67, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.poses"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "label": "if", "type": "if", "loc": [301, 325], "level": 0, "parent": null, "vector": [4, 0, 0.9046, 0.0723, 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 optparse\n p = optparse.OptionParser()\n p.add_option('--yaml', action='store', type='string', dest='yaml',\n help='Room definition file (required)', default='')\n p.add_option('--room', action='store', type='string', dest='room',\n help='Specific room [default \\'hrl\\']', default='hrl')\n opt, args = p.parse_args()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Import_L302_C4", "label": "optparse import optparse", "type": "import", "loc": [302, 302], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "vector": [1, 1, 0.8728, 0.0029, 1, 0.36, 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_99381:Assign_L303_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [303, 303], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "vector": [14, 1, 0.8757, 0.0029, 1, 0.36, 0.0769, 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_99381:Expr_L304_C4", "label": "add_option()", "type": "expression", "loc": [304, 305], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "vector": [8, 1, 0.8801, 0.0058, 1, 0.36, 0.1538, 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('--yaml', action='store', type='string', dest='yaml',\n help='Room definition file (required)', default='')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L306_C4", "label": "add_option()", "type": "expression", "loc": [306, 307], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "vector": [8, 1, 0.8858, 0.0058, 1, 0.36, 0.2308, 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('--room', action='store', type='string', dest='room',\n help='Specific room [default \\'hrl\\']', default='hrl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L308_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [308, 308], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "vector": [14, 1, 0.8902, 0.0029, 1, 0.36, 0.3077, 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_99381:If_L310_C4", "label": "if", "type": "if", "loc": [310, 313], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "vector": [4, 1, 0.9003, 0.0116, 1, 0.36, 0.3846, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.yaml == '':\n print('room_explore: YAML FILE REQUIRED.')\n else:\n print('Using YAML file: ', opt.yaml)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L311_C8", "label": "print()", "type": "expression", "loc": [311, 311], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L310_C4", "vector": [8, 2, 0.8988, 0.0029, 2, 0.13, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('room_explore: YAML FILE REQUIRED.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L313_C8", "label": "print()", "type": "expression", "loc": [313, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L310_C4", "vector": [8, 2, 0.9046, 0.0029, 2, 0.13, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Using YAML file: ', opt.yaml)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L315_C4", "label": "f = open()", "type": "assigned_variable", "loc": [315, 315], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "vector": [14, 1, 0.9104, 0.0029, 1, 0.36, 0.4615, 899, 3, 1, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " f = open( opt.yaml )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L316_C4", "label": "dat = load()", "type": "assigned_variable", "loc": [316, 316], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "vector": [14, 1, 0.9133, 0.0029, 1, 0.36, 0.5385, 934, 3, 1, 0, 0, 37, 10, 1], "semantic": {"name": "dat", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": " dat = yaml.load( f )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L317_C4", "label": "close()", "type": "expression", "loc": [317, 317], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "vector": [8, 1, 0.9162, 0.0029, 1, 0.36, 0.6154, 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_99381:Expr_L319_C4", "label": "TFthread()", "type": "expression", "loc": [319, 319], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "vector": [8, 1, 0.922, 0.0029, 1, 0.36, 0.6923, 93, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "TFthread", "arg_names": [], "import_names": [], "rhs_call_name": "TFthread", "annotation": ""}, "snippet": " TFthread( dat ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L321_C4", "label": "re = RoomExplore()", "type": "assigned_variable", "loc": [321, 321], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "vector": [14, 1, 0.9277, 0.0029, 1, 0.36, 0.7692, 540, 3, 3, 0, 0, 610, 10, 1], "semantic": {"name": "re", "arg_names": [], "import_names": [], "rhs_call_name": "RoomExplore", "annotation": ""}, "snippet": " re = RoomExplore( dat, opt.room, 1.5 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L322_C4", "label": "sleep()", "type": "expression", "loc": [322, 322], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "vector": [8, 1, 0.9306, 0.0029, 1, 0.36, 0.8462, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( 4 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L323_C4", "label": "publish_markers()", "type": "expression", "loc": [323, 323], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "vector": [8, 1, 0.9335, 0.0029, 1, 0.36, 0.9231, 116, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "publish_markers", "arg_names": [], "import_names": [], "rhs_call_name": "publish_markers", "annotation": ""}, "snippet": " re.publish_markers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L325_C4", "label": "spin()", "type": "expression", "loc": [325, 325], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "vector": [8, 1, 0.9393, 0.0029, 1, 0.36, 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_99381:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Return_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L28_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L29_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L39_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L55_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L56_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Return_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Return_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L86_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L114_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L114_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L117_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L118_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L114_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Return_L119_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L138_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L142_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L145_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L146_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L148_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L150_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L151_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L163_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L163_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L164_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L163_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L165_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L163_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L166_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L169_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L169_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L170_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L169_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L171_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L174_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L175_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L176_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L177_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L179_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L179_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L180_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L179_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L181_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L179_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L182_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L184_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L184_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L185_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L184_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L186_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L184_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L187_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L190_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L190_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L191_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L190_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L192_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L190_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L193_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:While_L149_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L196_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L198_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L200_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Return_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L206_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L212_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L213_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L212_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L215_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L212_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L216_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L212_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L217_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L212_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L218_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:Try_L212_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L219_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Return_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L245_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L246_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L246_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L247_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L246_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L249_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L245_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L251_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L251_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L252_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L251_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L253_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L251_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L254_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L251_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L255_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L251_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L256_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L251_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L257_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L251_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L258_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L251_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L259_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L251_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L260_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L251_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L261_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L251_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L263_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L245_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L264_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L245_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L265_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Return_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L268_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L268_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L269_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L270_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L269_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L271_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L268_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L272_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L274_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L278_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L279_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L280_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L281_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L282_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L283_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L284_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L285_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L286_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L287_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L289_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:For_L276_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L290_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:ClassDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L292_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:FunctionDef_L292_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Return_L293_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Import_L302_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L303_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L304_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L306_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L308_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L310_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L311_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L313_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L315_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L316_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L317_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L319_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Assign_L321_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L322_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L323_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99381:If_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99381:Expr_L325_C4"}]
#! /usr/bin/python # Without the in-hand RFID reader, use ARToolKit instead for upclose # (nearfield) validation import roslib roslib.load_manifest('rfid_artoolkit') import rospy import rfid_servoing.servo as servo import costmap_services.python_client as costmap import artoolkit_detector as artag import actionlib from rfid_artoolkit.srv import ARServoSrv, ARServoSrvResponse from rfid_artoolkit.msg import UpCloseAction, UpCloseResult, UpCloseGoal class ARservoScan(): # Uses ARtagScan along with costmap functionality (ie. in rfid_servoing) to # determine when to preempt the ARtagScan and continue servoing. # This class is used to keep the artoolkit_detector somewhat decoupled from all this other jazz. def __init__( self ): try: rospy.init_node('artag_superclass') except: # Parent already initialized pass rospy.logout( 'ARservoScan: Initializing' ) self.scanner = artag.ARtagScan() # Create Costmap Services obj self.cs = costmap.CostmapServices( accum = 15 ) self._service = rospy.Service( '/rfid_artoolkit/upclose', ARServoSrv, self.service_request ) self._as = actionlib.SimpleActionServer( '/rfid_artoolkit/upclose_act', UpCloseAction, execute_cb = self.action_request ) self._as.start() # Note: After moving, this will require accum * -1's before stopping. rospy.logout( 'ARservoScan: Ready and Running.' ) def service_request( self, req ): success, found_tag, pos, frame = self.scan( req.tagid ) rv = ARServoSrvResponse() rv.success = success and found_tag # not preempted & found tag if success and found_tag: rv.ps.header.frame_id = frame rv.ps.header.stamp = rospy.Time.now() rv.ps.point.x = pos[0] rv.ps.point.y = pos[1] rv.ps.point.z = pos[2] return rv def action_request( self, goal ): rospy.logout( 'ARservoScan: action_request received for tagid: \'%s\'' % goal.tagid ) zc = servo.ZedCalc( filt_len = 5, tag_id = goal.tagid ) def free_to_move_preempt(): # Note: I believe the variables are scoped at time of func def zed_next = zc.next_pub() # Where does RFID want to go? costmap_rv = self.cs.scoreTraj_NegHyst( 0.1, 0.0, zed_next ) #print zed_next #print costmap_rv if costmap_rv == -1.0: #rospy.logout( 'Obstacle still present.' ) return False # Still keep scaning else: rospy.logout( 'ARservoScan: Obstacle Gone... PREEMPT!' ) return True # Whatever was in way is gone. Should go back to servoing. def actionlib_preempt(): check = self._as.is_preempt_requested() if check: rospy.logout( 'ARservoScan: actionlib Preempt requested. PREEMPT!' ) return check def preempt_func(): return free_to_move_preempt() or actionlib_preempt() success, found_tag, pos, frame = self.scanner.scan( preempt_func = preempt_func ) # Success will be false if it was preempted (eg. preempt_func returns True) zc.stop() # Stop the RFID reader... if success and found_tag: found_tag, pos, frame = self.scanner.settle( pos, frame ) if success: # Weren't preempted if found_tag: status = 'SUCCEEDED' else: status = 'FAILED' else: if actionlib_preempt(): # preempt caused by actionlib status = 'PREEMPTED' else: # obstacle is clear status = 'RESERVO' rospy.logout( 'ARservoScan: Scan completed.' ) rv = UpCloseResult() rv.success = success and found_tag # not preempted & found tag rv.status = status if success and found_tag: rv.ps.header.frame_id = frame rv.ps.header.stamp = rospy.Time.now() rv.ps.point.x = pos[0] rv.ps.point.y = pos[1] rv.ps.point.z = pos[2] self._as.set_succeeded( rv ) def scan( self, tag_id ): # Note: action_request does pretty much the same thing, but with preemption. rospy.logout( 'ARservoScan: Scan requested for tagid \'%s\'' % tag_id ) # Subscribe to RFID reader to figure out where it wants to go. zc = servo.ZedCalc( filt_len = 5, tag_id = tag_id ) def preempt_func(): # Note: I believe the variables are scoped at time of func def zed_next = zc.next_pub() # Where does RFID want to go? costmap_rv = self.cs.scoreTraj_NegHyst( 0.1, 0.0, zed_next ) #print zed_next #print costmap_rv if costmap_rv == -1.0: #rospy.logout( 'Obstacle still present.' ) return False # Still keep scaning else: rospy.logout( 'ARservoScan: Obstacle Gone... PREEMPT!' ) return True # Whatever was in way is gone. Should go back to servoing. success, found_tag, pos, frame = self.scanner.scan( preempt_func = preempt_func ) # Success will be false if it was preempted (eg. preempt_func returns True) zc.stop() # Stop the RFID reader... if success and found_tag: found_tag, pos, frame = self.scanner.settle( pos, frame ) rospy.logout( 'ARservoScan: Scan completed.' ) #print 'scan result: ', success, found_tag, pos, frame return ( success, found_tag, pos, frame ) def testScan(): rospy.init_node( 'testScan' ) servoScan = ARservoScan() success, found_tag, pos, frame = servoScan.scan( 'person ' ) print 'results: ', success, found_tag, pos, frame if __name__ == '__main__': ss = ARservoScan() rospy.spin() # There are (at least) three ways to call this code. # 1) Python: # testScan() # 2) ROS service: # rosservice call /rfid_artoolkit/upclose "'person '" # 3) ROS actionlib: # try: # client = actionlib.SimpleActionClient( '/rfid_artoolkit/upclose_act', UpCloseAction ) # client.wait_for_server() # client.send_goal( UpCloseGoal( 'person ' )) # # Test Preempt # # rospy.sleep( 10 ) # # client.cancel_all_goals() # client.wait_for_result() # print client.get_result() # except rospy.ROSInterruptException: # print 'Program interrupted before completion' # rospy.spin()
ajibawa-2023/Python-Code-Large/train/row_99382
94
193
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Import_L6_C0", "label": "roslib import roslib", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0311, 0.0052, 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_99382:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0363, 0.0052, 0, 0.66, 0.0909, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('rfid_artoolkit')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Import_L8_C0", "label": "rospy import rospy", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0415, 0.0052, 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_99382:Import_L10_C0", "label": "rfid_servoing.servo import servo", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0518, 0.0052, 0, 0.66, 0.2727, 34, 0, 1, 0, 0, 34, 0, 0], "semantic": {"name": "rfid_servoing.servo", "arg_names": [], "import_names": ["servo"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rfid_servoing.servo as servo"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Import_L11_C0", "label": "costmap_services.python_client import costmap", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.057, 0.0052, 0, 0.66, 0.3636, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "costmap_services.python_client", "arg_names": [], "import_names": ["costmap"], "rhs_call_name": "", "annotation": ""}, "snippet": "import costmap_services.python_client as costmap"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Import_L12_C0", "label": "artoolkit_detector import artag", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0622, 0.0052, 0, 0.66, 0.4545, 776, 0, 1, 0, 0, 776, 0, 0], "semantic": {"name": "artoolkit_detector", "arg_names": [], "import_names": ["artag"], "rhs_call_name": "", "annotation": ""}, "snippet": "import artoolkit_detector as artag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Import_L13_C0", "label": "actionlib import actionlib", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0674, 0.0052, 0, 0.66, 0.5455, 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_99382:ImportFrom_L15_C0", "label": "from rfid_artoolkit.srv import ARServoSrv, ARServoSrvResponse", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0777, 0.0052, 0, 0.66, 0.6364, 293, 0, 2, 0, 0, 293, 0, 0], "semantic": {"name": "rfid_artoolkit.srv", "arg_names": [], "import_names": ["ARServoSrv", "ARServoSrvResponse"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_artoolkit.srv import ARServoSrv, ARServoSrvResponse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:ImportFrom_L16_C0", "label": "from rfid_artoolkit.msg import UpCloseAction, UpCloseResult, UpCloseGoal", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0829, 0.0052, 0, 0.66, 0.7273, 547, 0, 3, 0, 0, 547, 0, 0], "semantic": {"name": "rfid_artoolkit.msg", "arg_names": [], "import_names": ["UpCloseAction", "UpCloseResult", "UpCloseGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_artoolkit.msg import UpCloseAction, UpCloseResult, UpCloseGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:ClassDef_L18_C0", "label": "ARservoScan", "type": "class", "loc": [18, 151], "level": 0, "parent": null, "vector": [3, 0, 0.4378, 0.6943, 0, 0.66, 0.8182, 810, 0, 8, 0, 0, 0, 0, 37], "semantic": {"name": "ARservoScan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ARservoScan():\n # Uses ARtagScan along with costmap functionality (ie. in rfid_servoing) to\n # determine when to preempt the ARtagScan and continue servoing.\n\n # This class is used to keep the artoolkit_detector somewhat decoupled from all this other jazz.\n def __init__( self ):\n try:\n rospy.init_node('artag_superclass')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L23_C4", "label": "__init__", "type": "function", "loc": [23, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:ClassDef_L18_C0", "vector": [2, 1, 0.1684, 0.1036, 1, 0.02, 0.0, 555, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self ):\n try:\n rospy.init_node('artag_superclass')\n except: # Parent already initialized\n pass\n\n rospy.logout( 'ARservoScan: Initializing' )\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Try_L24_C8", "label": "try", "type": "try", "loc": [24, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L23_C4", "vector": [7, 2, 0.1321, 0.0207, 2, 0.42, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node('artag_superclass')\n except: # Parent already initialized\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L25_C12", "label": "init_node()", "type": "expression", "loc": [25, 25], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:Try_L24_C8", "vector": [8, 3, 0.1295, 0.0052, 3, 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('artag_superclass')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L29_C8", "label": "logout()", "type": "expression", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L23_C4", "vector": [8, 2, 0.1503, 0.0052, 2, 0.42, 0.1429, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'ARservoScan: Initializing' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L31_C8", "label": "self.scanner = ARtagScan()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L23_C4", "vector": [14, 2, 0.1606, 0.0052, 2, 0.42, 0.2857, 509, 3, 0, 0, 0, 523, 10, 1], "semantic": {"name": "self.scanner", "arg_names": [], "import_names": [], "rhs_call_name": "ARtagScan", "annotation": ""}, "snippet": " self.scanner = artag.ARtagScan()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L34_C8", "label": "self.cs = CostmapServices()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L23_C4", "vector": [14, 2, 0.1762, 0.0052, 2, 0.42, 0.4286, 23, 3, 1, 0, 0, 974, 10, 1], "semantic": {"name": "self.cs", "arg_names": [], "import_names": [], "rhs_call_name": "CostmapServices", "annotation": ""}, "snippet": " self.cs = costmap.CostmapServices( accum = 15 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L35_C8", "label": "self._service = Service()", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L23_C4", "vector": [14, 2, 0.1813, 0.0052, 2, 0.42, 0.5714, 143, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self._service", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self._service = rospy.Service( '/rfid_artoolkit/upclose', ARServoSrv, self.service_request )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L36_C8", "label": "self._as = SimpleActionServer()", "type": "assigned_variable", "loc": [36, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L23_C4", "vector": [14, 2, 0.1891, 0.0104, 2, 0.42, 0.7143, 777, 3, 3, 0, 0, 975, 10, 1], "semantic": {"name": "self._as", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionServer", "annotation": ""}, "snippet": " self._as = actionlib.SimpleActionServer( '/rfid_artoolkit/upclose_act',\n UpCloseAction, execute_cb = self.action_request )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L38_C8", "label": "start()", "type": "expression", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L23_C4", "vector": [8, 2, 0.1969, 0.0052, 2, 0.42, 0.8571, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self._as.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L42_C8", "label": "logout()", "type": "expression", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L23_C4", "vector": [8, 2, 0.2176, 0.0052, 2, 0.42, 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( 'ARservoScan: Ready and Running.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L45_C4", "label": "service_request", "type": "function", "loc": [45, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:ClassDef_L18_C0", "vector": [2, 1, 0.2642, 0.0674, 1, 0.02, 0.3333, 396, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "service_request", "arg_names": ["self", "req"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def service_request( self, req ):\n success, found_tag, pos, frame = self.scan( req.tagid )\n \n rv = ARServoSrvResponse()\n rv.success = success and found_tag # not preempted & found tag\n if success and found_tag:\n rv.ps.header.frame_id = frame\n rv.ps.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L46_C8", "label": "success, found_tag, pos, frame = scan()", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L45_C4", "vector": [14, 2, 0.2383, 0.0052, 2, 0.45, 0.0, 469, 3, 1, 0, 0, 202, 10, 1], "semantic": {"name": "success, found_tag, pos, frame", "arg_names": [], "import_names": [], "rhs_call_name": "scan", "annotation": ""}, "snippet": " success, found_tag, pos, frame = self.scan( req.tagid )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L48_C8", "label": "rv = ARServoSrvResponse()", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L45_C4", "vector": [14, 2, 0.2487, 0.0052, 2, 0.45, 0.25, 222, 3, 0, 0, 0, 858, 10, 1], "semantic": {"name": "rv", "arg_names": [], "import_names": [], "rhs_call_name": "ARServoSrvResponse", "annotation": ""}, "snippet": " rv = ARServoSrvResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L49_C8", "label": "rv.success =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L45_C4", "vector": [14, 2, 0.2539, 0.0052, 2, 0.45, 0.5, 331, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rv.success", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rv.success = success and found_tag # not preempted & found tag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L50_C8", "label": "if", "type": "if", "loc": [50, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L45_C4", "vector": [4, 2, 0.272, 0.0311, 2, 0.45, 0.75, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if success and found_tag:\n rv.ps.header.frame_id = frame\n rv.ps.header.stamp = rospy.Time.now()\n rv.ps.point.x = pos[0]\n rv.ps.point.y = pos[1]\n rv.ps.point.z = pos[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L51_C12", "label": "rv.ps.header.frame_id =", "type": "assigned_variable", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L50_C8", "vector": [14, 3, 0.2642, 0.0052, 3, 0.74, 0.0, 159, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rv.ps.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rv.ps.header.frame_id = frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L52_C12", "label": "rv.ps.header.stamp = now()", "type": "assigned_variable", "loc": [52, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L50_C8", "vector": [14, 3, 0.2694, 0.0052, 3, 0.74, 0.25, 715, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "rv.ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " rv.ps.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L53_C12", "label": "rv.ps.point.x =", "type": "assigned_variable", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L50_C8", "vector": [14, 3, 0.2746, 0.0052, 3, 0.74, 0.5, 233, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rv.ps.point.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rv.ps.point.x = pos[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L54_C12", "label": "rv.ps.point.y =", "type": "assigned_variable", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L50_C8", "vector": [14, 3, 0.2798, 0.0052, 3, 0.74, 0.75, 208, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rv.ps.point.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rv.ps.point.y = pos[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L55_C12", "label": "rv.ps.point.z =", "type": "assigned_variable", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L50_C8", "vector": [14, 3, 0.285, 0.0052, 3, 0.74, 1.0, 784, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rv.ps.point.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rv.ps.point.z = pos[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Return_L57_C8", "label": "return", "type": "return", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L45_C4", "vector": [13, 2, 0.2953, 0.0052, 2, 0.45, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "label": "action_request", "type": "function", "loc": [60, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:ClassDef_L18_C0", "vector": [2, 1, 0.4611, 0.3057, 1, 0.02, 0.6667, 616, 0, 2, 1, 0, 0, 0, 17], "semantic": {"name": "action_request", "arg_names": ["self", "goal"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def action_request( self, goal ):\n rospy.logout( 'ARservoScan: action_request received for tagid: \\'%s\\'' % goal.tagid )\n\n zc = servo.ZedCalc( filt_len = 5, tag_id = goal.tagid )\n\n def free_to_move_preempt():\n # Note: I believe the variables are scoped at time of func def\n zed_next = zc.next_pub() # Where does RFID want to go?"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L61_C8", "label": "logout()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "vector": [8, 2, 0.3161, 0.0052, 2, 0.29, 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( 'ARservoScan: action_request received for tagid: \\'%s\\'' % goal.tagid )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L63_C8", "label": "zc = ZedCalc()", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "vector": [14, 2, 0.3264, 0.0052, 2, 0.29, 0.0714, 477, 3, 2, 0, 0, 714, 10, 1], "semantic": {"name": "zc", "arg_names": [], "import_names": [], "rhs_call_name": "ZedCalc", "annotation": ""}, "snippet": " zc = servo.ZedCalc( filt_len = 5, tag_id = goal.tagid )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L65_C8", "label": "free_to_move_preempt", "type": "function", "loc": [65, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "vector": [2, 2, 0.3653, 0.0622, 2, 0.29, 0.1429, 903, 0, 0, 1, 0, 0, 0, 3], "semantic": {"name": "free_to_move_preempt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def free_to_move_preempt():\n # Note: I believe the variables are scoped at time of func def\n zed_next = zc.next_pub() # Where does RFID want to go?\n costmap_rv = self.cs.scoreTraj_NegHyst( 0.1, 0.0, zed_next )\n #print zed_next\n #print costmap_rv\n if costmap_rv == -1.0:\n #rospy.logout( 'Obstacle still present.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L67_C12", "label": "zed_next = next_pub()", "type": "assigned_variable", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L65_C8", "vector": [14, 3, 0.3472, 0.0052, 3, 0.87, 0.0, 677, 3, 0, 0, 0, 134, 10, 1], "semantic": {"name": "zed_next", "arg_names": [], "import_names": [], "rhs_call_name": "next_pub", "annotation": ""}, "snippet": " zed_next = zc.next_pub() # Where does RFID want to go?"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L68_C12", "label": "costmap_rv = scoreTraj_NegHyst()", "type": "assigned_variable", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L65_C8", "vector": [14, 3, 0.3523, 0.0052, 3, 0.87, 0.5, 588, 3, 3, 0, 0, 867, 10, 1], "semantic": {"name": "costmap_rv", "arg_names": [], "import_names": [], "rhs_call_name": "scoreTraj_NegHyst", "annotation": ""}, "snippet": " costmap_rv = self.cs.scoreTraj_NegHyst( 0.1, 0.0, zed_next )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L71_C12", "label": "if", "type": "if", "loc": [71, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L65_C8", "vector": [4, 3, 0.3808, 0.0311, 3, 0.87, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if costmap_rv == -1.0:\n #rospy.logout( 'Obstacle still present.' )\n return False # Still keep scaning\n else:\n rospy.logout( 'ARservoScan: Obstacle Gone... PREEMPT!' )\n return True # Whatever was in way is gone. Should go back to servoing."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Return_L73_C16", "label": "return", "type": "return", "loc": [73, 73], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L71_C12", "vector": [13, 4, 0.3782, 0.0052, 4, 0.53, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False # Still keep scaning"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L75_C16", "label": "logout()", "type": "expression", "loc": [75, 75], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L71_C12", "vector": [8, 4, 0.3886, 0.0052, 4, 0.53, 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( 'ARservoScan: Obstacle Gone... PREEMPT!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Return_L76_C16", "label": "return", "type": "return", "loc": [76, 76], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L71_C12", "vector": [13, 4, 0.3938, 0.0052, 4, 0.53, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True # Whatever was in way is gone. Should go back to servoing."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L78_C8", "label": "actionlib_preempt", "type": "function", "loc": [78, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "vector": [2, 2, 0.4145, 0.0259, 2, 0.29, 0.2143, 876, 0, 0, 1, 0, 0, 0, 2], "semantic": {"name": "actionlib_preempt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def actionlib_preempt():\n check = self._as.is_preempt_requested()\n if check:\n rospy.logout( 'ARservoScan: actionlib Preempt requested. PREEMPT!' )\n return check"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L79_C12", "label": "check = is_preempt_requested()", "type": "assigned_variable", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L78_C8", "vector": [14, 3, 0.4093, 0.0052, 3, 0.1, 0.0, 803, 3, 0, 0, 0, 468, 10, 1], "semantic": {"name": "check", "arg_names": [], "import_names": [], "rhs_call_name": "is_preempt_requested", "annotation": ""}, "snippet": " check = self._as.is_preempt_requested()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L80_C12", "label": "if", "type": "if", "loc": [80, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L78_C8", "vector": [4, 3, 0.4171, 0.0104, 3, 0.1, 0.5, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if check:\n rospy.logout( 'ARservoScan: actionlib Preempt requested. PREEMPT!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L81_C16", "label": "logout()", "type": "expression", "loc": [81, 81], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L80_C12", "vector": [8, 4, 0.4197, 0.0052, 4, 0.56, 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( 'ARservoScan: actionlib Preempt requested. PREEMPT!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Return_L82_C12", "label": "return", "type": "return", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L78_C8", "vector": [13, 3, 0.4249, 0.0052, 3, 0.1, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return check"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L84_C8", "label": "preempt_func", "type": "function", "loc": [84, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "vector": [2, 2, 0.4378, 0.0104, 2, 0.29, 0.2857, 314, 0, 0, 1, 0, 0, 0, 2], "semantic": {"name": "preempt_func", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def preempt_func():\n return free_to_move_preempt() or actionlib_preempt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Return_L85_C12", "label": "return", "type": "return", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L84_C8", "vector": [13, 3, 0.4404, 0.0052, 3, 0.75, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return free_to_move_preempt() or actionlib_preempt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L87_C8", "label": "success, found_tag, pos, frame = scan()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "vector": [14, 2, 0.4508, 0.0052, 2, 0.29, 0.3571, 469, 3, 1, 0, 0, 202, 10, 1], "semantic": {"name": "success, found_tag, pos, frame", "arg_names": [], "import_names": [], "rhs_call_name": "scan", "annotation": ""}, "snippet": " success, found_tag, pos, frame = self.scanner.scan( preempt_func = preempt_func )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L90_C8", "label": "stop()", "type": "expression", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "vector": [8, 2, 0.4663, 0.0052, 2, 0.29, 0.4286, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " zc.stop() # Stop the RFID reader..."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L92_C8", "label": "if", "type": "if", "loc": [92, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "vector": [4, 2, 0.4793, 0.0104, 2, 0.29, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if success and found_tag:\n found_tag, pos, frame = self.scanner.settle( pos, frame )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L93_C12", "label": "found_tag, pos, frame = settle()", "type": "assigned_variable", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L92_C8", "vector": [14, 3, 0.4819, 0.0052, 3, 0.32, 0.0, 676, 3, 2, 0, 0, 684, 10, 1], "semantic": {"name": "found_tag, pos, frame", "arg_names": [], "import_names": [], "rhs_call_name": "settle", "annotation": ""}, "snippet": " found_tag, pos, frame = self.scanner.settle( pos, frame )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L95_C8", "label": "if", "type": "if", "loc": [95, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "vector": [4, 2, 0.5155, 0.0518, 2, 0.29, 0.5714, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if success: # Weren't preempted\n if found_tag:\n status = 'SUCCEEDED'\n else:\n status = 'FAILED'\n else:\n if actionlib_preempt(): # preempt caused by actionlib\n status = 'PREEMPTED'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L96_C12", "label": "if", "type": "if", "loc": [96, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L95_C8", "vector": [4, 3, 0.5052, 0.0207, 3, 0.97, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if found_tag:\n status = 'SUCCEEDED'\n else:\n status = 'FAILED'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L97_C16", "label": "status =", "type": "assigned_variable", "loc": [97, 97], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L96_C12", "vector": [14, 4, 0.5026, 0.0052, 4, 0.35, 0.0, 699, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " status = 'SUCCEEDED'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L99_C16", "label": "status =", "type": "assigned_variable", "loc": [99, 99], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L96_C12", "vector": [14, 4, 0.513, 0.0052, 4, 0.35, 1.0, 699, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " status = 'FAILED'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L101_C12", "label": "if", "type": "if", "loc": [101, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L95_C8", "vector": [4, 3, 0.5311, 0.0207, 3, 0.97, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if actionlib_preempt(): # preempt caused by actionlib\n status = 'PREEMPTED'\n else: # obstacle is clear\n status = 'RESERVO'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L102_C16", "label": "status =", "type": "assigned_variable", "loc": [102, 102], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L101_C12", "vector": [14, 4, 0.5285, 0.0052, 4, 0.64, 0.0, 699, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " status = 'PREEMPTED'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L104_C16", "label": "status =", "type": "assigned_variable", "loc": [104, 104], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L101_C12", "vector": [14, 4, 0.5389, 0.0052, 4, 0.64, 1.0, 699, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " status = 'RESERVO'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L106_C8", "label": "logout()", "type": "expression", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "vector": [8, 2, 0.5492, 0.0052, 2, 0.29, 0.6429, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'ARservoScan: Scan completed.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L108_C8", "label": "rv = UpCloseResult()", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "vector": [14, 2, 0.5596, 0.0052, 2, 0.29, 0.7143, 222, 3, 0, 0, 0, 374, 10, 1], "semantic": {"name": "rv", "arg_names": [], "import_names": [], "rhs_call_name": "UpCloseResult", "annotation": ""}, "snippet": " rv = UpCloseResult()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L109_C8", "label": "rv.success =", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "vector": [14, 2, 0.5648, 0.0052, 2, 0.29, 0.7857, 331, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rv.success", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rv.success = success and found_tag # not preempted & found tag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L110_C8", "label": "rv.status =", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "vector": [14, 2, 0.5699, 0.0052, 2, 0.29, 0.8571, 153, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rv.status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rv.status = status"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L111_C8", "label": "if", "type": "if", "loc": [111, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "vector": [4, 2, 0.5881, 0.0311, 2, 0.29, 0.9286, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if success and found_tag:\n rv.ps.header.frame_id = frame\n rv.ps.header.stamp = rospy.Time.now()\n rv.ps.point.x = pos[0]\n rv.ps.point.y = pos[1]\n rv.ps.point.z = pos[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L112_C12", "label": "rv.ps.header.frame_id =", "type": "assigned_variable", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L111_C8", "vector": [14, 3, 0.5803, 0.0052, 3, 0.92, 0.0, 159, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rv.ps.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rv.ps.header.frame_id = frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L113_C12", "label": "rv.ps.header.stamp = now()", "type": "assigned_variable", "loc": [113, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L111_C8", "vector": [14, 3, 0.5855, 0.0052, 3, 0.92, 0.25, 715, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "rv.ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " rv.ps.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L114_C12", "label": "rv.ps.point.x =", "type": "assigned_variable", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L111_C8", "vector": [14, 3, 0.5907, 0.0052, 3, 0.92, 0.5, 233, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rv.ps.point.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rv.ps.point.x = pos[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L115_C12", "label": "rv.ps.point.y =", "type": "assigned_variable", "loc": [115, 115], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L111_C8", "vector": [14, 3, 0.5959, 0.0052, 3, 0.92, 0.75, 208, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rv.ps.point.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rv.ps.point.y = pos[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L116_C12", "label": "rv.ps.point.z =", "type": "assigned_variable", "loc": [116, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L111_C8", "vector": [14, 3, 0.601, 0.0052, 3, 0.92, 1.0, 784, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rv.ps.point.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rv.ps.point.z = pos[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L118_C8", "label": "set_succeeded()", "type": "expression", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "vector": [8, 2, 0.6114, 0.0052, 2, 0.29, 1.0, 825, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_succeeded", "arg_names": [], "import_names": [], "rhs_call_name": "set_succeeded", "annotation": ""}, "snippet": " self._as.set_succeeded( rv )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L121_C4", "label": "scan", "type": "function", "loc": [121, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:ClassDef_L18_C0", "vector": [2, 1, 0.7047, 0.1606, 1, 0.02, 1.0, 202, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "scan", "arg_names": ["self", "tag_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def scan( self, tag_id ):\n # Note: action_request does pretty much the same thing, but with preemption.\n\n rospy.logout( 'ARservoScan: Scan requested for tagid \\'%s\\'' % tag_id )\n # Subscribe to RFID reader to figure out where it wants to go.\n zc = servo.ZedCalc( filt_len = 5, tag_id = tag_id )\n\n def preempt_func():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L124_C8", "label": "logout()", "type": "expression", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L121_C4", "vector": [8, 2, 0.6425, 0.0052, 2, 0.19, 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( 'ARservoScan: Scan requested for tagid \\'%s\\'' % tag_id )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L126_C8", "label": "zc = ZedCalc()", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L121_C4", "vector": [14, 2, 0.6528, 0.0052, 2, 0.19, 0.1429, 477, 3, 2, 0, 0, 714, 10, 1], "semantic": {"name": "zc", "arg_names": [], "import_names": [], "rhs_call_name": "ZedCalc", "annotation": ""}, "snippet": " zc = servo.ZedCalc( filt_len = 5, tag_id = tag_id )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L128_C8", "label": "preempt_func", "type": "function", "loc": [128, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L121_C4", "vector": [2, 2, 0.6917, 0.0622, 2, 0.19, 0.2857, 314, 0, 0, 1, 0, 0, 0, 3], "semantic": {"name": "preempt_func", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def preempt_func():\n # Note: I believe the variables are scoped at time of func def\n zed_next = zc.next_pub() # Where does RFID want to go?\n costmap_rv = self.cs.scoreTraj_NegHyst( 0.1, 0.0, zed_next )\n #print zed_next\n #print costmap_rv\n if costmap_rv == -1.0:\n #rospy.logout( 'Obstacle still present.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L130_C12", "label": "zed_next = next_pub()", "type": "assigned_variable", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L128_C8", "vector": [14, 3, 0.6736, 0.0052, 3, 0.24, 0.0, 677, 3, 0, 0, 0, 134, 10, 1], "semantic": {"name": "zed_next", "arg_names": [], "import_names": [], "rhs_call_name": "next_pub", "annotation": ""}, "snippet": " zed_next = zc.next_pub() # Where does RFID want to go?"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L131_C12", "label": "costmap_rv = scoreTraj_NegHyst()", "type": "assigned_variable", "loc": [131, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L128_C8", "vector": [14, 3, 0.6788, 0.0052, 3, 0.24, 0.5, 588, 3, 3, 0, 0, 867, 10, 1], "semantic": {"name": "costmap_rv", "arg_names": [], "import_names": [], "rhs_call_name": "scoreTraj_NegHyst", "annotation": ""}, "snippet": " costmap_rv = self.cs.scoreTraj_NegHyst( 0.1, 0.0, zed_next )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L134_C12", "label": "if", "type": "if", "loc": [134, 139], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L128_C8", "vector": [4, 3, 0.7073, 0.0311, 3, 0.24, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if costmap_rv == -1.0:\n #rospy.logout( 'Obstacle still present.' )\n return False # Still keep scaning\n else:\n rospy.logout( 'ARservoScan: Obstacle Gone... PREEMPT!' )\n return True # Whatever was in way is gone. Should go back to servoing."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Return_L136_C16", "label": "return", "type": "return", "loc": [136, 136], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L134_C12", "vector": [13, 4, 0.7047, 0.0052, 4, 0.88, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False # Still keep scaning"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L138_C16", "label": "logout()", "type": "expression", "loc": [138, 138], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L134_C12", "vector": [8, 4, 0.715, 0.0052, 4, 0.88, 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( 'ARservoScan: Obstacle Gone... PREEMPT!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Return_L139_C16", "label": "return", "type": "return", "loc": [139, 139], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L134_C12", "vector": [13, 4, 0.7202, 0.0052, 4, 0.88, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True # Whatever was in way is gone. Should go back to servoing."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L141_C8", "label": "success, found_tag, pos, frame = scan()", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L121_C4", "vector": [14, 2, 0.7306, 0.0052, 2, 0.19, 0.4286, 469, 3, 1, 0, 0, 202, 10, 1], "semantic": {"name": "success, found_tag, pos, frame", "arg_names": [], "import_names": [], "rhs_call_name": "scan", "annotation": ""}, "snippet": " success, found_tag, pos, frame = self.scanner.scan( preempt_func = preempt_func )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L144_C8", "label": "stop()", "type": "expression", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L121_C4", "vector": [8, 2, 0.7461, 0.0052, 2, 0.19, 0.5714, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " zc.stop() # Stop the RFID reader..."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L146_C8", "label": "if", "type": "if", "loc": [146, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L121_C4", "vector": [4, 2, 0.7591, 0.0104, 2, 0.19, 0.7143, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if success and found_tag:\n found_tag, pos, frame = self.scanner.settle( pos, frame )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L147_C12", "label": "found_tag, pos, frame = settle()", "type": "assigned_variable", "loc": [147, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L146_C8", "vector": [14, 3, 0.7617, 0.0052, 3, 0.18, 0.0, 676, 3, 2, 0, 0, 684, 10, 1], "semantic": {"name": "found_tag, pos, frame", "arg_names": [], "import_names": [], "rhs_call_name": "settle", "annotation": ""}, "snippet": " found_tag, pos, frame = self.scanner.settle( pos, frame )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L149_C8", "label": "logout()", "type": "expression", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L121_C4", "vector": [8, 2, 0.772, 0.0052, 2, 0.19, 0.8571, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'ARservoScan: Scan completed.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Return_L151_C8", "label": "return", "type": "return", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L121_C4", "vector": [13, 2, 0.7824, 0.0052, 2, 0.19, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ( success, found_tag, pos, frame )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L154_C0", "label": "testScan", "type": "function", "loc": [154, 159], "level": 0, "parent": null, "vector": [2, 0, 0.8109, 0.0311, 0, 0.66, 0.9091, 15, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "testScan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def testScan():\n rospy.init_node( 'testScan' )\n\n servoScan = ARservoScan()\n success, found_tag, pos, frame = servoScan.scan( 'person ' )\n print('results: ', success, found_tag, pos, frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L155_C4", "label": "init_node()", "type": "expression", "loc": [155, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L154_C0", "vector": [8, 1, 0.8031, 0.0052, 1, 0.45, 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( 'testScan' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L157_C4", "label": "servoScan = ARservoScan()", "type": "assigned_variable", "loc": [157, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L154_C0", "vector": [14, 1, 0.8135, 0.0052, 1, 0.45, 0.3333, 768, 3, 0, 0, 0, 810, 10, 1], "semantic": {"name": "servoScan", "arg_names": [], "import_names": [], "rhs_call_name": "ARservoScan", "annotation": ""}, "snippet": " servoScan = ARservoScan()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L158_C4", "label": "success, found_tag, pos, frame = scan()", "type": "assigned_variable", "loc": [158, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L154_C0", "vector": [14, 1, 0.8187, 0.0052, 1, 0.45, 0.6667, 469, 3, 1, 0, 0, 202, 10, 1], "semantic": {"name": "success, found_tag, pos, frame", "arg_names": [], "import_names": [], "rhs_call_name": "scan", "annotation": ""}, "snippet": " success, found_tag, pos, frame = servoScan.scan( 'person ' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L159_C4", "label": "print()", "type": "expression", "loc": [159, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L154_C0", "vector": [8, 1, 0.8238, 0.0052, 1, 0.45, 1.0, 535, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('results: ', success, found_tag, pos, frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L161_C0", "label": "if", "type": "if", "loc": [161, 164], "level": 0, "parent": null, "vector": [4, 0, 0.842, 0.0207, 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\n ss = ARservoScan()\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L163_C4", "label": "ss = ARservoScan()", "type": "assigned_variable", "loc": [163, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L161_C0", "vector": [14, 1, 0.8446, 0.0052, 1, 0.6, 0.0, 582, 3, 0, 0, 0, 810, 10, 1], "semantic": {"name": "ss", "arg_names": [], "import_names": [], "rhs_call_name": "ARservoScan", "annotation": ""}, "snippet": " ss = ARservoScan()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L164_C4", "label": "spin()", "type": "expression", "loc": [164, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L161_C0", "vector": [8, 1, 0.8497, 0.0052, 1, 0.6, 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_99382:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Try_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:Try_L24_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L25_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Return_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L71_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Return_L73_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L71_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L75_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L71_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Return_L76_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L80_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L81_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Return_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L84_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Return_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L96_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L96_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L97_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L96_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L99_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L101_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L102_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L101_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L104_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L115_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L128_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L128_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L131_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L128_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L134_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L134_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Return_L136_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L134_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L138_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L134_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Return_L139_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L146_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Return_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L154_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L154_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L154_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:FunctionDef_L154_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L161_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Assign_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99382:If_L161_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99382:Expr_L164_C4"}]
#! /usr/bin/python import roslib roslib.load_manifest('rfid_artoolkit') import rospy import tf import actionlib from actionlib_msgs.msg import GoalStatus from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal from geometry_msgs.msg import PointStamped from ar_pose.msg import ARMarkers import time from threading import Thread, Lock import numpy as np, math from collections import deque def ctime(): return rospy.Time.now().to_time() def retfalse(): return False def goal( frame, pos, d ): g = PointHeadGoal() g.target.header.frame_id = frame g.target.point.x = pos[0] g.target.point.y = pos[1] g.target.point.z = pos[2] g.min_duration = rospy.Duration( d ) # Note, looking @ head action source, it seems pointing_frame unimplemented... # Just account with a static offset (for now) where desired. return g class ARtagDetect(): def __init__( self ): try: rospy.init_node('ar_detect_tracker') except: # Parent already initialized pass rospy.logout('ARtagDetect: Initializing.') self.lock = Lock() # for last_pos & found_tag self.found_tag = False self.init_pos = [ 0.54, 0.0, 0.35 ] self.last_pos = [ 0.54, 0.0, 0.35 ] self.listener = tf.TransformListener() self.listener.waitForTransform('/torso_lift_link', '/openni_rgb_optical_frame', rospy.Time(0), timeout = rospy.Duration(100) ) self.artag_sub = rospy.Subscriber( '/artag_marker_handoff', ARMarkers, self.processARtag ) rospy.logout('ARtagDetect: Ready and Running.') def processARtag( self, msg ): if msg.markers != []: frame = msg.markers[0].header.frame_id p = msg.markers[0].pose.pose.position pt = PointStamped() pt.header.frame_id = frame pt.point.x = p.x pt.point.y = p.y pt.point.z = p.z pt.header.stamp = rospy.Time(0) try: pt_bl = self.listener.transformPoint( '/torso_lift_link', pt ) pbl = pt_bl.point # pointing_frame manual offset (should actually be on p.y, # but this is a good approximation with less noise in robot frame). pbl.z = pbl.z - 0.2 self.lock.acquire() self.last_pos = [ pbl.x, pbl.y, pbl.z ] self.found_tag = True self.lock.release() except: rospy.logout( 'ARtagDetect: Transform failed' ) def init_new_detection( self ): self.lock.acquire() self.last_pos = self.init_pos self.found_tag = False self.lock.release() def found_new_tag( self ): self.lock.acquire() rv = ( self.found_tag, self.last_pos, '/torso_lift_link' ) self.lock.release() return rv class ARtagScan(): def __init__( self ): try: rospy.init_node('artag_scanner') except: # Parent already initialized pass rospy.logout( 'ARtagScan: Initializing' ) self.detector = ARtagDetect() self.hc = actionlib.SimpleActionClient('/head_traj_controller/point_head_action', PointHeadAction) # headclient self.hc.wait_for_server() rospy.logout( 'ARtagScan: Ready and Running.' ) def scan( self, preempt_func = retfalse ): # self.hc.send_goal( goal( 'torso_lift_link', [0.54, 0.2, 0.25], 2.0 )) # self.hc.wait_for_result( rospy.Duration( 2.0 )) rospy.logout('ARtagScan: starting sweep') cmds = [ [0.54, -0.2, 0.25], [0.54, 0.2, -0.10], [0.54, -0.2, 0.0], [0.54, 0.2, 0.20], [0.54, -0.2, 0.30], [0.54, 0.0, 0.35] ] self.detector.init_new_detection() found_tag, pos, frame = self.detector.found_new_tag() for cmd in cmds: if not rospy.is_shutdown() and not found_tag and not preempt_func(): self.hc.send_goal( goal( 'torso_lift_link', cmd, 6.0 )) found_tag, pos, frame = self.detector.found_new_tag() goal_done = False while not rospy.is_shutdown() and not goal_done and not found_tag and not preempt_func(): found_tag, pos, frame = self.detector.found_new_tag() goal_done = self.hc.wait_for_result( rospy.Duration( 0.05 )) # ~20Hz self.hc.cancel_all_goals() # just in case if preempt_func(): rospy.logout( 'ARtagScan: Preempt was requested. May not have finished.' ) rospy.logout( 'ARtagScan: Exiting' ) return ( False, found_tag, pos, frame ) else: rospy.logout( 'ARtagScan: Exiting' ) return ( True, found_tag, pos, frame ) def settle( self, init_pos, init_frame, preempt_func = retfalse ): rospy.logout('ARtagScan: Starting settle. Looking at detection') # Look in direction of initial read self.hc.send_goal( goal( init_frame, init_pos, 2.0 )) self.hc.wait_for_result( rospy.Duration( 2.0 )) buff = deque() buff.append( init_pos ) rospy.sleep( 0.3 ) settle = 5.0 stime = ctime() rospy.logout('ARtagScan: Averaging scans') # Refine the estimate found_tag = False self.detector.init_new_detection() self.hc.send_goal( goal( init_frame, init_pos, 0.5 )) goal_reached = False r = rospy.Rate( 20 ) while not rospy.is_shutdown() and ctime() - stime < settle: #print 'Times: ', ctime(), stime found_tag, pos, frame = self.detector.found_new_tag() if found_tag: buff.append( pos ) found_tag = False self.detector.init_new_detection() goal_reached = self.hc.wait_for_result( rospy.Duration( 0.02 )) if goal_reached: mean_pos = np.mean( buff, axis = 0 ) self.hc.send_goal( goal( init_frame, mean_pos, 0.5 )) r.sleep() self.hc.wait_for_result( rospy.Duration( 2.0 )) mean_pos = np.mean( buff, axis = 0 ) return ( True, mean_pos, init_frame ) def testDetect(): rospy.init_node( 'testDetect' ) rate = rospy.Rate( 1.0 ) detector = ARtagDetect() detector.init_new_detection() found_tag, pos, frame = detector.found_new_tag() while not rospy.is_shutdown(): found_tag, pos, frame = detector.found_new_tag() print found_tag, pos, frame rate.sleep() def testScan(): rospy.init_node( 'testScan' ) rate = rospy.Rate( 1.0 ) scanner = ARtagScan() rv = scanner.scan() print 'scanner res: ', rv success, found_tag, pos, frame = rv rv = scanner.settle( pos, frame ) print 'settle res: ', rv if __name__ == '__main__': #testDetect() testScan()
ajibawa-2023/Python-Code-Large/train/row_99383
146
221
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0136, 0.0045, 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_99383:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0181, 0.0045, 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": "roslib.load_manifest('rfid_artoolkit')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0226, 0.0045, 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_99383:Import_L7_C0", "label": "tf import tf", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0317, 0.0045, 0, 0.66, 0.15, 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_99383:Import_L8_C0", "label": "actionlib import actionlib", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0362, 0.0045, 0, 0.66, 0.2, 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_99383:ImportFrom_L9_C0", "label": "from actionlib_msgs.msg import GoalStatus", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0407, 0.0045, 0, 0.66, 0.25, 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_99383:ImportFrom_L10_C0", "label": "from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0452, 0.0045, 0, 0.66, 0.3, 457, 0, 2, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["PointHeadAction", "PointHeadGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:ImportFrom_L11_C0", "label": "from geometry_msgs.msg import PointStamped", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0498, 0.0045, 0, 0.66, 0.35, 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_99383:ImportFrom_L12_C0", "label": "from ar_pose.msg import ARMarkers", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0543, 0.0045, 0, 0.66, 0.4, 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_99383:Import_L14_C0", "label": "time import time", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0633, 0.0045, 0, 0.66, 0.45, 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_99383:ImportFrom_L15_C0", "label": "from threading import Thread, Lock", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0679, 0.0045, 0, 0.66, 0.5, 83, 0, 2, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["Thread", "Lock"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import Thread, Lock"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Import_L16_C0", "label": "numpy import np, math", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0724, 0.0045, 0, 0.66, 0.55, 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_99383:ImportFrom_L17_C0", "label": "from collections import deque", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0045, 0, 0.66, 0.6, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "collections", "arg_names": [], "import_names": ["deque"], "rhs_call_name": "", "annotation": ""}, "snippet": "from collections import deque"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L19_C0", "label": "ctime", "type": "function", "loc": [19, 20], "level": 0, "parent": null, "vector": [2, 0, 0.0882, 0.009, 0, 0.66, 0.65, 671, 0, 0, 1, 0, 0, 0, 2], "semantic": {"name": "ctime", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ctime():\n return rospy.Time.now().to_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Return_L20_C4", "label": "return", "type": "return", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L19_C0", "vector": [13, 1, 0.0905, 0.0045, 1, 0.0, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rospy.Time.now().to_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L22_C0", "label": "retfalse", "type": "function", "loc": [22, 23], "level": 0, "parent": null, "vector": [2, 0, 0.1018, 0.009, 0, 0.66, 0.7, 71, 0, 0, 1, 0, 0, 0, 0], "semantic": {"name": "retfalse", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def retfalse():\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Return_L23_C4", "label": "return", "type": "return", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L22_C0", "vector": [13, 1, 0.1041, 0.0045, 1, 0.62, 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_99383:FunctionDef_L25_C0", "label": "goal", "type": "function", "loc": [25, 34], "level": 0, "parent": null, "vector": [2, 0, 0.1335, 0.0452, 0, 0.66, 0.75, 914, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "goal", "arg_names": ["frame", "pos", "d"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def goal( frame, pos, d ):\n g = PointHeadGoal()\n g.target.header.frame_id = frame\n g.target.point.x = pos[0]\n g.target.point.y = pos[1]\n g.target.point.z = pos[2]\n g.min_duration = rospy.Duration( d )\n # Note, looking @ head action source, it seems pointing_frame unimplemented..."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L26_C4", "label": "g = PointHeadGoal()", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L25_C0", "vector": [14, 1, 0.1176, 0.0045, 1, 0.93, 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_99383:Assign_L27_C4", "label": "g.target.header.frame_id =", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L25_C0", "vector": [14, 1, 0.1222, 0.0045, 1, 0.93, 0.1667, 758, 2, 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 = frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L28_C4", "label": "g.target.point.x =", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L25_C0", "vector": [14, 1, 0.1267, 0.0045, 1, 0.93, 0.3333, 493, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "g.target.point.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " g.target.point.x = pos[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L29_C4", "label": "g.target.point.y =", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L25_C0", "vector": [14, 1, 0.1312, 0.0045, 1, 0.93, 0.5, 219, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "g.target.point.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " g.target.point.y = pos[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L30_C4", "label": "g.target.point.z =", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L25_C0", "vector": [14, 1, 0.1357, 0.0045, 1, 0.93, 0.6667, 906, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "g.target.point.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " g.target.point.z = pos[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L31_C4", "label": "g.min_duration = Duration()", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L25_C0", "vector": [14, 1, 0.1403, 0.0045, 1, 0.93, 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( d )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Return_L34_C4", "label": "return", "type": "return", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L25_C0", "vector": [13, 1, 0.1538, 0.0045, 1, 0.93, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return g"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:ClassDef_L36_C0", "label": "ARtagDetect", "type": "class", "loc": [36, 95], "level": 0, "parent": null, "vector": [3, 0, 0.2964, 0.2715, 0, 0.66, 0.8, 189, 0, 4, 0, 0, 0, 0, 19], "semantic": {"name": "ARtagDetect", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ARtagDetect():\n def __init__( self ):\n try:\n rospy.init_node('ar_detect_tracker')\n except: # Parent already initialized\n pass\n\n rospy.logout('ARtagDetect: Initializing.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L37_C4", "label": "__init__", "type": "function", "loc": [37, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:ClassDef_L36_C0", "vector": [2, 1, 0.2127, 0.095, 1, 0.23, 0.0, 555, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self ):\n try:\n rospy.init_node('ar_detect_tracker')\n except: # Parent already initialized\n pass\n\n rospy.logout('ARtagDetect: Initializing.')\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L38_C8", "label": "try", "type": "try", "loc": [38, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L37_C4", "vector": [7, 2, 0.1787, 0.0181, 2, 0.33, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node('ar_detect_tracker')\n except: # Parent already initialized\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L39_C12", "label": "init_node()", "type": "expression", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L38_C8", "vector": [8, 3, 0.1765, 0.0045, 3, 0.47, 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_detect_tracker')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L43_C8", "label": "logout()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L37_C4", "vector": [8, 2, 0.1946, 0.0045, 2, 0.33, 0.1111, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('ARtagDetect: Initializing.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L45_C8", "label": "self.lock = Lock()", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L37_C4", "vector": [14, 2, 0.2036, 0.0045, 2, 0.33, 0.2222, 45, 3, 0, 0, 0, 843, 10, 1], "semantic": {"name": "self.lock", "arg_names": [], "import_names": [], "rhs_call_name": "Lock", "annotation": ""}, "snippet": " self.lock = Lock() # for last_pos & found_tag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L46_C8", "label": "self.found_tag =", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L37_C4", "vector": [14, 2, 0.2081, 0.0045, 2, 0.33, 0.3333, 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_99383:Assign_L47_C8", "label": "self.init_pos =", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L37_C4", "vector": [14, 2, 0.2127, 0.0045, 2, 0.33, 0.4444, 284, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.init_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.init_pos = [ 0.54, 0.0, 0.35 ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L48_C8", "label": "self.last_pos =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L37_C4", "vector": [14, 2, 0.2172, 0.0045, 2, 0.33, 0.5556, 908, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.last_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.last_pos = [ 0.54, 0.0, 0.35 ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L50_C8", "label": "self.listener = TransformListener()", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L37_C4", "vector": [14, 2, 0.2262, 0.0045, 2, 0.33, 0.6667, 686, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.listener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L51_C8", "label": "waitForTransform()", "type": "expression", "loc": [51, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L37_C4", "vector": [8, 2, 0.233, 0.009, 2, 0.33, 0.7778, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.listener.waitForTransform('/torso_lift_link', '/openni_rgb_optical_frame',\n rospy.Time(0), timeout = rospy.Duration(100) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L54_C8", "label": "self.artag_sub = Subscriber()", "type": "assigned_variable", "loc": [54, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L37_C4", "vector": [14, 2, 0.2489, 0.0136, 2, 0.33, 0.8889, 164, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "self.artag_sub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " self.artag_sub = rospy.Subscriber( '/artag_marker_handoff',\n ARMarkers,\n self.processARtag )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L57_C8", "label": "logout()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L37_C4", "vector": [8, 2, 0.2579, 0.0045, 2, 0.33, 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('ARtagDetect: Ready and Running.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L59_C4", "label": "processARtag", "type": "function", "loc": [59, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:ClassDef_L36_C0", "vector": [2, 1, 0.3213, 0.1131, 1, 0.23, 0.3333, 121, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "processARtag", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def processARtag( self, msg ):\n if msg.markers != []:\n frame = msg.markers[0].header.frame_id\n p = msg.markers[0].pose.pose.position\n\n pt = PointStamped()\n pt.header.frame_id = frame\n pt.point.x = p.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L60_C8", "label": "if", "type": "if", "loc": [60, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L59_C4", "vector": [4, 2, 0.3235, 0.1086, 2, 0.55, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg.markers != []:\n frame = msg.markers[0].header.frame_id\n p = msg.markers[0].pose.pose.position\n\n pt = PointStamped()\n pt.header.frame_id = frame\n pt.point.x = p.x\n pt.point.y = p.y "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L61_C12", "label": "frame =", "type": "assigned_variable", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L60_C8", "vector": [14, 3, 0.276, 0.0045, 3, 0.69, 0.0, 313, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frame = msg.markers[0].header.frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L62_C12", "label": "p =", "type": "assigned_variable", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L60_C8", "vector": [14, 3, 0.2805, 0.0045, 3, 0.69, 0.125, 491, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = msg.markers[0].pose.pose.position"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L64_C12", "label": "pt = PointStamped()", "type": "assigned_variable", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L60_C8", "vector": [14, 3, 0.2896, 0.0045, 3, 0.69, 0.25, 989, 3, 0, 0, 0, 969, 10, 1], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "PointStamped", "annotation": ""}, "snippet": " pt = PointStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L65_C12", "label": "pt.header.frame_id =", "type": "assigned_variable", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L60_C8", "vector": [14, 3, 0.2941, 0.0045, 3, 0.69, 0.375, 78, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt.header.frame_id = frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L66_C12", "label": "pt.point.x =", "type": "assigned_variable", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L60_C8", "vector": [14, 3, 0.2986, 0.0045, 3, 0.69, 0.5, 984, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt.point.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt.point.x = p.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L67_C12", "label": "pt.point.y =", "type": "assigned_variable", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L60_C8", "vector": [14, 3, 0.3032, 0.0045, 3, 0.69, 0.625, 973, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt.point.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt.point.y = p.y "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L68_C12", "label": "pt.point.z =", "type": "assigned_variable", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L60_C8", "vector": [14, 3, 0.3077, 0.0045, 3, 0.69, 0.75, 715, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt.point.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt.point.z = p.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L69_C12", "label": "pt.header.stamp = Time()", "type": "assigned_variable", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L60_C8", "vector": [14, 3, 0.3122, 0.0045, 3, 0.69, 0.875, 580, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "pt.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " pt.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L71_C12", "label": "try", "type": "try", "loc": [71, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L60_C8", "vector": [7, 3, 0.3484, 0.0588, 3, 0.69, 1.0, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n pt_bl = self.listener.transformPoint( '/torso_lift_link', pt )\n pbl = pt_bl.point\n # pointing_frame manual offset (should actually be on p.y,\n # but this is a good approximation with less noise in robot frame).\n pbl.z = pbl.z - 0.2\n\n self.lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L72_C16", "label": "pt_bl = transformPoint()", "type": "assigned_variable", "loc": [72, 72], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L71_C12", "vector": [14, 4, 0.3258, 0.0045, 4, 0.63, 0.0, 853, 3, 2, 0, 0, 987, 10, 1], "semantic": {"name": "pt_bl", "arg_names": [], "import_names": [], "rhs_call_name": "transformPoint", "annotation": ""}, "snippet": " pt_bl = self.listener.transformPoint( '/torso_lift_link', pt )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L73_C16", "label": "pbl =", "type": "assigned_variable", "loc": [73, 73], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L71_C12", "vector": [14, 4, 0.3303, 0.0045, 4, 0.63, 0.1667, 618, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pbl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pbl = pt_bl.point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L76_C16", "label": "pbl.z =", "type": "assigned_variable", "loc": [76, 76], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L71_C12", "vector": [14, 4, 0.3439, 0.0045, 4, 0.63, 0.3333, 613, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pbl.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pbl.z = pbl.z - 0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L78_C16", "label": "acquire()", "type": "expression", "loc": [78, 78], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L71_C12", "vector": [8, 4, 0.3529, 0.0045, 4, 0.63, 0.5, 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_99383:Assign_L79_C16", "label": "self.last_pos =", "type": "assigned_variable", "loc": [79, 79], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L71_C12", "vector": [14, 4, 0.3575, 0.0045, 4, 0.63, 0.6667, 908, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.last_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.last_pos = [ pbl.x, pbl.y, pbl.z ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L80_C16", "label": "self.found_tag =", "type": "assigned_variable", "loc": [80, 80], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L71_C12", "vector": [14, 4, 0.362, 0.0045, 4, 0.63, 0.8333, 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_99383:Expr_L81_C16", "label": "release()", "type": "expression", "loc": [81, 81], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L71_C12", "vector": [8, 4, 0.3665, 0.0045, 4, 0.63, 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_99383:Expr_L83_C16", "label": "logout()", "type": "expression", "loc": [83, 83], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L71_C12", "vector": [8, 4, 0.3756, 0.0045, 4, 0.63, 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( 'ARtagDetect: Transform failed' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L85_C4", "label": "init_new_detection", "type": "function", "loc": [85, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:ClassDef_L36_C0", "vector": [2, 1, 0.3937, 0.0226, 1, 0.23, 0.6667, 291, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "init_new_detection", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def init_new_detection( self ):\n self.lock.acquire()\n self.last_pos = self.init_pos\n self.found_tag = False\n self.lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L86_C8", "label": "acquire()", "type": "expression", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L85_C4", "vector": [8, 2, 0.3891, 0.0045, 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.lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L87_C8", "label": "self.last_pos =", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L85_C4", "vector": [14, 2, 0.3937, 0.0045, 2, 0.85, 0.3333, 908, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.last_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.last_pos = self.init_pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L88_C8", "label": "self.found_tag =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L85_C4", "vector": [14, 2, 0.3982, 0.0045, 2, 0.85, 0.6667, 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_99383:Expr_L89_C8", "label": "release()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L85_C4", "vector": [8, 2, 0.4027, 0.0045, 2, 0.85, 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_99383:FunctionDef_L91_C4", "label": "found_new_tag", "type": "function", "loc": [91, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:ClassDef_L36_C0", "vector": [2, 1, 0.4208, 0.0226, 1, 0.23, 1.0, 84, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "found_new_tag", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def found_new_tag( self ):\n self.lock.acquire()\n rv = ( self.found_tag, self.last_pos, '/torso_lift_link' )\n self.lock.release()\n return rv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L92_C8", "label": "acquire()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L91_C4", "vector": [8, 2, 0.4163, 0.0045, 2, 0.72, 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_99383:Assign_L93_C8", "label": "rv =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L91_C4", "vector": [14, 2, 0.4208, 0.0045, 2, 0.72, 0.3333, 222, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "rv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rv = ( self.found_tag, self.last_pos, '/torso_lift_link' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L94_C8", "label": "release()", "type": "expression", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L91_C4", "vector": [8, 2, 0.4253, 0.0045, 2, 0.72, 0.6667, 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_99383:Return_L95_C8", "label": "return", "type": "return", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L91_C4", "vector": [13, 2, 0.4299, 0.0045, 2, 0.72, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:ClassDef_L98_C0", "label": "ARtagScan", "type": "class", "loc": [98, 190], "level": 0, "parent": null, "vector": [3, 0, 0.6516, 0.4208, 0, 0.66, 0.85, 523, 0, 3, 0, 0, 0, 0, 52], "semantic": {"name": "ARtagScan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ARtagScan():\n def __init__( self ):\n try:\n rospy.init_node('artag_scanner')\n except: # Parent already initialized\n pass\n\n rospy.logout( 'ARtagScan: Initializing' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L99_C4", "label": "__init__", "type": "function", "loc": [99, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:ClassDef_L98_C0", "vector": [2, 1, 0.4774, 0.0633, 1, 0.21, 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 try:\n rospy.init_node('artag_scanner')\n except: # Parent already initialized\n pass\n\n rospy.logout( 'ARtagScan: Initializing' )\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L100_C8", "label": "try", "type": "try", "loc": [100, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L99_C4", "vector": [7, 2, 0.4593, 0.0181, 2, 0.69, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node('artag_scanner')\n except: # Parent already initialized\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L101_C12", "label": "init_node()", "type": "expression", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L100_C8", "vector": [8, 3, 0.457, 0.0045, 3, 0.35, 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('artag_scanner')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L105_C8", "label": "logout()", "type": "expression", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L99_C4", "vector": [8, 2, 0.4751, 0.0045, 2, 0.69, 0.2, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'ARtagScan: Initializing' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L107_C8", "label": "self.detector = ARtagDetect()", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L99_C4", "vector": [14, 2, 0.4842, 0.0045, 2, 0.69, 0.4, 476, 3, 0, 0, 0, 189, 10, 1], "semantic": {"name": "self.detector", "arg_names": [], "import_names": [], "rhs_call_name": "ARtagDetect", "annotation": ""}, "snippet": " self.detector = ARtagDetect()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L109_C8", "label": "self.hc = SimpleActionClient()", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L99_C4", "vector": [14, 2, 0.4932, 0.0045, 2, 0.69, 0.6, 96, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "self.hc", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.hc = actionlib.SimpleActionClient('/head_traj_controller/point_head_action', PointHeadAction) # headclient"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L110_C8", "label": "wait_for_server()", "type": "expression", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L99_C4", "vector": [8, 2, 0.4977, 0.0045, 2, 0.69, 0.8, 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.hc.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L112_C8", "label": "logout()", "type": "expression", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L99_C4", "vector": [8, 2, 0.5068, 0.0045, 2, 0.69, 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( 'ARtagScan: Ready and Running.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L114_C4", "label": "scan", "type": "function", "loc": [114, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:ClassDef_L98_C0", "vector": [2, 1, 0.5928, 0.1584, 1, 0.21, 0.5, 202, 0, 2, 1, 0, 0, 0, 18], "semantic": {"name": "scan", "arg_names": ["self", "preempt_func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def scan( self, preempt_func = retfalse ):\n # self.hc.send_goal( goal( 'torso_lift_link', [0.54, 0.2, 0.25], 2.0 ))\n # self.hc.wait_for_result( rospy.Duration( 2.0 ))\n\n rospy.logout('ARtagScan: starting sweep')\n \n cmds = [ [0.54, -0.2, 0.25],\n [0.54, 0.2, -0.10],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L118_C8", "label": "logout()", "type": "expression", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L114_C4", "vector": [8, 2, 0.5339, 0.0045, 2, 0.86, 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('ARtagScan: starting sweep')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L120_C8", "label": "cmds =", "type": "assigned_variable", "loc": [120, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L114_C4", "vector": [14, 2, 0.5543, 0.0271, 2, 0.86, 0.2, 493, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "cmds", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cmds = [ [0.54, -0.2, 0.25],\n [0.54, 0.2, -0.10],\n [0.54, -0.2, 0.0],\n [0.54, 0.2, 0.20],\n [0.54, -0.2, 0.30],\n [0.54, 0.0, 0.35] ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L127_C8", "label": "init_new_detection()", "type": "expression", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L114_C4", "vector": [8, 2, 0.5747, 0.0045, 2, 0.86, 0.4, 291, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init_new_detection", "arg_names": [], "import_names": [], "rhs_call_name": "init_new_detection", "annotation": ""}, "snippet": " self.detector.init_new_detection()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L129_C8", "label": "found_tag, pos, frame = found_new_tag()", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L114_C4", "vector": [14, 2, 0.5837, 0.0045, 2, 0.86, 0.6, 676, 3, 0, 0, 0, 84, 10, 1], "semantic": {"name": "found_tag, pos, frame", "arg_names": [], "import_names": [], "rhs_call_name": "found_new_tag", "annotation": ""}, "snippet": " found_tag, pos, frame = self.detector.found_new_tag()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:For_L130_C8", "label": "for cmd", "type": "for", "loc": [130, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L114_C4", "vector": [6, 2, 0.6109, 0.0498, 2, 0.86, 0.8, 604, 2, 0, 0, 0, 0, 0, 11], "semantic": {"name": "cmd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for cmd in cmds:\n if not rospy.is_shutdown() and not found_tag and not preempt_func():\n self.hc.send_goal( goal( 'torso_lift_link', cmd, 6.0 ))\n found_tag, pos, frame = self.detector.found_new_tag()\n\n goal_done = False\n while not rospy.is_shutdown() and not goal_done and not found_tag and not preempt_func():\n found_tag, pos, frame = self.detector.found_new_tag()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L131_C12", "label": "if", "type": "if", "loc": [131, 140], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:For_L130_C8", "vector": [4, 3, 0.6131, 0.0452, 3, 0.68, 0.0, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not rospy.is_shutdown() and not found_tag and not preempt_func():\n self.hc.send_goal( goal( 'torso_lift_link', cmd, 6.0 ))\n found_tag, pos, frame = self.detector.found_new_tag()\n\n goal_done = False\n while not rospy.is_shutdown() and not goal_done and not found_tag and not preempt_func():\n found_tag, pos, frame = self.detector.found_new_tag()\n goal_done = self.hc.wait_for_result( rospy.Duration( 0.05 )) # ~20Hz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L132_C16", "label": "send_goal()", "type": "expression", "loc": [132, 132], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L131_C12", "vector": [8, 4, 0.5973, 0.0045, 4, 0.0, 0.0, 184, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.hc.send_goal( goal( 'torso_lift_link', cmd, 6.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L133_C16", "label": "found_tag, pos, frame = found_new_tag()", "type": "assigned_variable", "loc": [133, 133], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L131_C12", "vector": [14, 4, 0.6018, 0.0045, 4, 0.0, 0.25, 676, 3, 0, 0, 0, 84, 10, 1], "semantic": {"name": "found_tag, pos, frame", "arg_names": [], "import_names": [], "rhs_call_name": "found_new_tag", "annotation": ""}, "snippet": " found_tag, pos, frame = self.detector.found_new_tag()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L135_C16", "label": "goal_done =", "type": "assigned_variable", "loc": [135, 135], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L131_C12", "vector": [14, 4, 0.6109, 0.0045, 4, 0.0, 0.5, 125, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "goal_done", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal_done = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L136_C16", "label": "while", "type": "while", "loc": [136, 138], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L131_C12", "vector": [5, 4, 0.6199, 0.0136, 4, 0.0, 0.75, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown() and not goal_done and not found_tag and not preempt_func():\n found_tag, pos, frame = self.detector.found_new_tag()\n goal_done = self.hc.wait_for_result( rospy.Duration( 0.05 )) # ~20Hz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L137_C20", "label": "found_tag, pos, frame = found_new_tag()", "type": "assigned_variable", "loc": [137, 137], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L136_C16", "vector": [14, 5, 0.6199, 0.0045, 5, 0.61, 0.0, 676, 3, 0, 0, 0, 84, 10, 1], "semantic": {"name": "found_tag, pos, frame", "arg_names": [], "import_names": [], "rhs_call_name": "found_new_tag", "annotation": ""}, "snippet": " found_tag, pos, frame = self.detector.found_new_tag()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L138_C20", "label": "goal_done = wait_for_result()", "type": "assigned_variable", "loc": [138, 138], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L136_C16", "vector": [14, 5, 0.6244, 0.0045, 5, 0.61, 1.0, 125, 3, 1, 0, 0, 328, 10, 2], "semantic": {"name": "goal_done", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_result", "annotation": ""}, "snippet": " goal_done = self.hc.wait_for_result( rospy.Duration( 0.05 )) # ~20Hz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L140_C16", "label": "cancel_all_goals()", "type": "expression", "loc": [140, 140], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L131_C12", "vector": [8, 4, 0.6335, 0.0045, 4, 0.0, 1.0, 699, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel_all_goals", "arg_names": [], "import_names": [], "rhs_call_name": "cancel_all_goals", "annotation": ""}, "snippet": " self.hc.cancel_all_goals() # just in case"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L142_C8", "label": "if", "type": "if", "loc": [142, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L114_C4", "vector": [4, 2, 0.6561, 0.0317, 2, 0.86, 1.0, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if preempt_func():\n rospy.logout( 'ARtagScan: Preempt was requested. May not have finished.' )\n rospy.logout( 'ARtagScan: Exiting' )\n return ( False, found_tag, pos, frame )\n else:\n rospy.logout( 'ARtagScan: Exiting' )\n return ( True, found_tag, pos, frame )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L143_C12", "label": "logout()", "type": "expression", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L142_C8", "vector": [8, 3, 0.6471, 0.0045, 3, 0.79, 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( 'ARtagScan: Preempt was requested. May not have finished.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L144_C12", "label": "logout()", "type": "expression", "loc": [144, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L142_C8", "vector": [8, 3, 0.6516, 0.0045, 3, 0.79, 0.25, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'ARtagScan: Exiting' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Return_L145_C12", "label": "return", "type": "return", "loc": [145, 145], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L142_C8", "vector": [13, 3, 0.6561, 0.0045, 3, 0.79, 0.5, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ( False, found_tag, pos, frame )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L147_C12", "label": "logout()", "type": "expression", "loc": [147, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L142_C8", "vector": [8, 3, 0.6652, 0.0045, 3, 0.79, 0.75, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'ARtagScan: Exiting' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Return_L148_C12", "label": "return", "type": "return", "loc": [148, 148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L142_C8", "vector": [13, 3, 0.6697, 0.0045, 3, 0.79, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ( True, found_tag, pos, frame )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "label": "settle", "type": "function", "loc": [151, 190], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:ClassDef_L98_C0", "vector": [2, 1, 0.7715, 0.181, 1, 0.21, 1.0, 684, 0, 4, 1, 0, 0, 0, 28], "semantic": {"name": "settle", "arg_names": ["self", "init_pos", "init_frame", "preempt_func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def settle( self, init_pos, init_frame, preempt_func = retfalse ):\n rospy.logout('ARtagScan: Starting settle. Looking at detection')\n\n # Look in direction of initial read\n self.hc.send_goal( goal( init_frame, init_pos, 2.0 ))\n self.hc.wait_for_result( rospy.Duration( 2.0 ))\n \n buff = deque()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L152_C8", "label": "logout()", "type": "expression", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "vector": [8, 2, 0.6878, 0.0045, 2, 0.02, 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('ARtagScan: Starting settle. Looking at detection')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L155_C8", "label": "send_goal()", "type": "expression", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "vector": [8, 2, 0.7014, 0.0045, 2, 0.02, 0.0588, 184, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.hc.send_goal( goal( init_frame, init_pos, 2.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L156_C8", "label": "wait_for_result()", "type": "expression", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "vector": [8, 2, 0.7059, 0.0045, 2, 0.02, 0.1176, 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.hc.wait_for_result( rospy.Duration( 2.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L158_C8", "label": "buff = deque()", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "vector": [14, 2, 0.7149, 0.0045, 2, 0.02, 0.1765, 17, 3, 0, 0, 0, 650, 10, 1], "semantic": {"name": "buff", "arg_names": [], "import_names": [], "rhs_call_name": "deque", "annotation": ""}, "snippet": " buff = deque()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L159_C8", "label": "append()", "type": "expression", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "vector": [8, 2, 0.7195, 0.0045, 2, 0.02, 0.2353, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " buff.append( init_pos )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L161_C8", "label": "sleep()", "type": "expression", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "vector": [8, 2, 0.7285, 0.0045, 2, 0.02, 0.2941, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( 0.3 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L162_C8", "label": "settle =", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "vector": [14, 2, 0.733, 0.0045, 2, 0.02, 0.3529, 684, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "settle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " settle = 5.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L163_C8", "label": "stime = ctime()", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "vector": [14, 2, 0.7376, 0.0045, 2, 0.02, 0.4118, 971, 3, 0, 0, 0, 671, 10, 1], "semantic": {"name": "stime", "arg_names": [], "import_names": [], "rhs_call_name": "ctime", "annotation": ""}, "snippet": " stime = ctime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L165_C8", "label": "logout()", "type": "expression", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "vector": [8, 2, 0.7466, 0.0045, 2, 0.02, 0.4706, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('ARtagScan: Averaging scans')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L168_C8", "label": "found_tag =", "type": "assigned_variable", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "vector": [14, 2, 0.7602, 0.0045, 2, 0.02, 0.5294, 273, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "found_tag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " found_tag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L169_C8", "label": "init_new_detection()", "type": "expression", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "vector": [8, 2, 0.7647, 0.0045, 2, 0.02, 0.5882, 291, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init_new_detection", "arg_names": [], "import_names": [], "rhs_call_name": "init_new_detection", "annotation": ""}, "snippet": " self.detector.init_new_detection()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L170_C8", "label": "send_goal()", "type": "expression", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "vector": [8, 2, 0.7692, 0.0045, 2, 0.02, 0.6471, 184, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.hc.send_goal( goal( init_frame, init_pos, 0.5 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L171_C8", "label": "goal_reached =", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "vector": [14, 2, 0.7738, 0.0045, 2, 0.02, 0.7059, 176, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "goal_reached", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal_reached = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L172_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "vector": [14, 2, 0.7783, 0.0045, 2, 0.02, 0.7647, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " r = rospy.Rate( 20 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L173_C8", "label": "while", "type": "while", "loc": [173, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "vector": [5, 2, 0.8122, 0.0633, 2, 0.02, 0.8235, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown() and ctime() - stime < settle:\n #print 'Times: ', ctime(), stime\n found_tag, pos, frame = self.detector.found_new_tag()\n if found_tag:\n buff.append( pos )\n found_tag = False\n self.detector.init_new_detection()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L175_C12", "label": "found_tag, pos, frame = found_new_tag()", "type": "assigned_variable", "loc": [175, 175], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L173_C8", "vector": [14, 3, 0.7919, 0.0045, 3, 0.98, 0.0, 676, 3, 0, 0, 0, 84, 10, 1], "semantic": {"name": "found_tag, pos, frame", "arg_names": [], "import_names": [], "rhs_call_name": "found_new_tag", "annotation": ""}, "snippet": " found_tag, pos, frame = self.detector.found_new_tag()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L176_C12", "label": "if", "type": "if", "loc": [176, 179], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L173_C8", "vector": [4, 3, 0.8032, 0.0181, 3, 0.98, 0.25, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if found_tag:\n buff.append( pos )\n found_tag = False\n self.detector.init_new_detection()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L177_C16", "label": "append()", "type": "expression", "loc": [177, 177], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L176_C12", "vector": [8, 4, 0.8009, 0.0045, 4, 0.67, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " buff.append( pos )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L178_C16", "label": "found_tag =", "type": "assigned_variable", "loc": [178, 178], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L176_C12", "vector": [14, 4, 0.8054, 0.0045, 4, 0.67, 0.5, 273, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "found_tag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " found_tag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L179_C16", "label": "init_new_detection()", "type": "expression", "loc": [179, 179], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L176_C12", "vector": [8, 4, 0.81, 0.0045, 4, 0.67, 1.0, 291, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init_new_detection", "arg_names": [], "import_names": [], "rhs_call_name": "init_new_detection", "annotation": ""}, "snippet": " self.detector.init_new_detection()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L181_C12", "label": "goal_reached = wait_for_result()", "type": "assigned_variable", "loc": [181, 181], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L173_C8", "vector": [14, 3, 0.819, 0.0045, 3, 0.98, 0.5, 176, 3, 1, 0, 0, 328, 10, 2], "semantic": {"name": "goal_reached", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_result", "annotation": ""}, "snippet": " goal_reached = self.hc.wait_for_result( rospy.Duration( 0.02 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L182_C12", "label": "if", "type": "if", "loc": [182, 184], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L173_C8", "vector": [4, 3, 0.8281, 0.0136, 3, 0.98, 0.75, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if goal_reached:\n mean_pos = np.mean( buff, axis = 0 )\n self.hc.send_goal( goal( init_frame, mean_pos, 0.5 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L183_C16", "label": "mean_pos = mean()", "type": "assigned_variable", "loc": [183, 183], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L182_C12", "vector": [14, 4, 0.8281, 0.0045, 4, 0.79, 0.0, 812, 3, 2, 0, 0, 856, 10, 1], "semantic": {"name": "mean_pos", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " mean_pos = np.mean( buff, axis = 0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L184_C16", "label": "send_goal()", "type": "expression", "loc": [184, 184], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L182_C12", "vector": [8, 4, 0.8326, 0.0045, 4, 0.79, 1.0, 184, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.hc.send_goal( goal( init_frame, mean_pos, 0.5 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L186_C12", "label": "sleep()", "type": "expression", "loc": [186, 186], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L173_C8", "vector": [8, 3, 0.8416, 0.0045, 3, 0.98, 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_99383:Expr_L188_C8", "label": "wait_for_result()", "type": "expression", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "vector": [8, 2, 0.8507, 0.0045, 2, 0.02, 0.8824, 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.hc.wait_for_result( rospy.Duration( 2.0 ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L189_C8", "label": "mean_pos = mean()", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "vector": [14, 2, 0.8552, 0.0045, 2, 0.02, 0.9412, 812, 3, 2, 0, 0, 856, 10, 1], "semantic": {"name": "mean_pos", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " mean_pos = np.mean( buff, axis = 0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Return_L190_C8", "label": "return", "type": "return", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "vector": [13, 2, 0.8597, 0.0045, 2, 0.02, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ( True, mean_pos, init_frame )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L193_C0", "label": "testDetect", "type": "function", "loc": [193, 204], "level": 0, "parent": null, "vector": [2, 0, 0.8982, 0.0543, 0, 0.66, 0.9, 617, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "testDetect", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def testDetect():\n rospy.init_node( 'testDetect' )\n rate = rospy.Rate( 1.0 )\n detector = ARtagDetect()\n detector.init_new_detection()\n\n found_tag, pos, frame = detector.found_new_tag()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L194_C4", "label": "init_node()", "type": "expression", "loc": [194, 194], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L193_C0", "vector": [8, 1, 0.8778, 0.0045, 1, 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( 'testDetect' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L195_C4", "label": "rate = Rate()", "type": "assigned_variable", "loc": [195, 195], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L193_C0", "vector": [14, 1, 0.8824, 0.0045, 1, 0.7, 0.2, 477, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "rate", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " rate = rospy.Rate( 1.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L196_C4", "label": "detector = ARtagDetect()", "type": "assigned_variable", "loc": [196, 196], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L193_C0", "vector": [14, 1, 0.8869, 0.0045, 1, 0.7, 0.4, 61, 3, 0, 0, 0, 189, 10, 1], "semantic": {"name": "detector", "arg_names": [], "import_names": [], "rhs_call_name": "ARtagDetect", "annotation": ""}, "snippet": " detector = ARtagDetect()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L197_C4", "label": "init_new_detection()", "type": "expression", "loc": [197, 197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L193_C0", "vector": [8, 1, 0.8914, 0.0045, 1, 0.7, 0.6, 291, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init_new_detection", "arg_names": [], "import_names": [], "rhs_call_name": "init_new_detection", "annotation": ""}, "snippet": " detector.init_new_detection()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L199_C4", "label": "found_tag, pos, frame = found_new_tag()", "type": "assigned_variable", "loc": [199, 199], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L193_C0", "vector": [14, 1, 0.9005, 0.0045, 1, 0.7, 0.8, 676, 3, 0, 0, 0, 84, 10, 1], "semantic": {"name": "found_tag, pos, frame", "arg_names": [], "import_names": [], "rhs_call_name": "found_new_tag", "annotation": ""}, "snippet": " found_tag, pos, frame = detector.found_new_tag()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L201_C4", "label": "while", "type": "while", "loc": [201, 204], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L193_C0", "vector": [5, 1, 0.9163, 0.0181, 1, 0.7, 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 found_tag, pos, frame = detector.found_new_tag()\n print(found_tag, pos, frame)\n rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L202_C8", "label": "found_tag, pos, frame = found_new_tag()", "type": "assigned_variable", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L201_C4", "vector": [14, 2, 0.914, 0.0045, 2, 0.7, 0.0, 676, 3, 0, 0, 0, 84, 10, 1], "semantic": {"name": "found_tag, pos, frame", "arg_names": [], "import_names": [], "rhs_call_name": "found_new_tag", "annotation": ""}, "snippet": " found_tag, pos, frame = detector.found_new_tag()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L203_C8", "label": "print()", "type": "expression", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L201_C4", "vector": [8, 2, 0.9186, 0.0045, 2, 0.7, 0.5, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(found_tag, pos, frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L204_C8", "label": "sleep()", "type": "expression", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L201_C4", "vector": [8, 2, 0.9231, 0.0045, 2, 0.7, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L206_C0", "label": "testScan", "type": "function", "loc": [206, 216], "level": 0, "parent": null, "vector": [2, 0, 0.9548, 0.0498, 0, 0.66, 0.95, 15, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "testScan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def testScan():\n rospy.init_node( 'testScan' )\n rate = rospy.Rate( 1.0 )\n scanner = ARtagScan()\n\n rv = scanner.scan()\n print('scanner res: ', rv)\n success, found_tag, pos, frame = rv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L207_C4", "label": "init_node()", "type": "expression", "loc": [207, 207], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L206_C0", "vector": [8, 1, 0.9367, 0.0045, 1, 0.78, 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( 'testScan' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L208_C4", "label": "rate = Rate()", "type": "assigned_variable", "loc": [208, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L206_C0", "vector": [14, 1, 0.9412, 0.0045, 1, 0.78, 0.1429, 477, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "rate", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " rate = rospy.Rate( 1.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L209_C4", "label": "scanner = ARtagScan()", "type": "assigned_variable", "loc": [209, 209], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L206_C0", "vector": [14, 1, 0.9457, 0.0045, 1, 0.78, 0.2857, 802, 3, 0, 0, 0, 523, 10, 1], "semantic": {"name": "scanner", "arg_names": [], "import_names": [], "rhs_call_name": "ARtagScan", "annotation": ""}, "snippet": " scanner = ARtagScan()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L211_C4", "label": "rv = scan()", "type": "assigned_variable", "loc": [211, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L206_C0", "vector": [14, 1, 0.9548, 0.0045, 1, 0.78, 0.4286, 222, 3, 0, 0, 0, 202, 10, 1], "semantic": {"name": "rv", "arg_names": [], "import_names": [], "rhs_call_name": "scan", "annotation": ""}, "snippet": " rv = scanner.scan()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L212_C4", "label": "print()", "type": "expression", "loc": [212, 212], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L206_C0", "vector": [8, 1, 0.9593, 0.0045, 1, 0.78, 0.5714, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('scanner res: ', rv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L213_C4", "label": "success, found_tag, pos, frame =", "type": "assigned_variable", "loc": [213, 213], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L206_C0", "vector": [14, 1, 0.9638, 0.0045, 1, 0.78, 0.7143, 469, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "success, found_tag, pos, frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " success, found_tag, pos, frame = rv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L215_C4", "label": "rv = settle()", "type": "assigned_variable", "loc": [215, 215], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L206_C0", "vector": [14, 1, 0.9729, 0.0045, 1, 0.78, 0.8571, 222, 3, 2, 0, 0, 684, 10, 1], "semantic": {"name": "rv", "arg_names": [], "import_names": [], "rhs_call_name": "settle", "annotation": ""}, "snippet": " rv = scanner.settle( pos, frame )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L216_C4", "label": "print()", "type": "expression", "loc": [216, 216], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L206_C0", "vector": [8, 1, 0.9774, 0.0045, 1, 0.78, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('settle res: ', rv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L219_C0", "label": "if", "type": "if", "loc": [219, 221], "level": 0, "parent": null, "vector": [4, 0, 0.9955, 0.0136, 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 #testDetect()\n testScan()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L221_C4", "label": "testScan()", "type": "expression", "loc": [221, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L219_C0", "vector": [8, 1, 1.0, 0.0045, 1, 0.3, 0.0, 15, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "testScan", "arg_names": [], "import_names": [], "rhs_call_name": "testScan", "annotation": ""}, "snippet": " testScan()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Return_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Return_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Return_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L39_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L71_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L72_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L71_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L73_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L71_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L76_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L71_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L78_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L71_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L79_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L71_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L80_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L71_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L81_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L71_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L83_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Return_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:Try_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:For_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:For_L130_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L131_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L132_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L133_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L135_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L136_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L136_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L137_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L136_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L138_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L140_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L142_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L142_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L144_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L142_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Return_L145_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L142_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L142_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Return_L148_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L173_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L175_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L173_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L176_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L176_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L177_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L176_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L178_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L176_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L179_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L173_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L181_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L173_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L182_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L182_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L183_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L182_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L184_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L173_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L186_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Return_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L193_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L193_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L195_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L193_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L196_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L193_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L197_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L193_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L193_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L201_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L201_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L201_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:While_L201_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L206_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L207_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L206_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L208_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L206_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L206_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L211_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L206_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L212_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L206_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L213_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L206_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Assign_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:FunctionDef_L206_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L216_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99383:If_L219_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99383:Expr_L221_C4"}]
#! /usr/bin/python import roslib roslib.load_manifest('rfid_servoing') import rospy import hrl_rfid.ros_M5e_client as rmc from hrl_rfid.msg import RFIDread import robotis.ros_robotis as rr import costmap_services.python_client as costmap from geometry_msgs.msg import Twist import actionlib from rfid_servoing.srv import ServoSrv from rfid_servoing.msg import ServoAction, ServoResult, ServoGoal import numpy as np, math from collections import deque import os from threading import Lock def ctime(): return rospy.Time.now().to_time() def retfalse(): return False class ServoNode( ): def __init__( self ): rospy.logout('servo_node: Initializing') try: rospy.init_node('servo_node') except: # Node probably already initialized elsewhere pass # Create servos. self.p_left = rr.ROS_Robotis_Client( 'left_pan' ) self.t_left = rr.ROS_Robotis_Client( 'left_tilt' ) self.p_right = rr.ROS_Robotis_Client( 'right_pan' ) self.t_right = rr.ROS_Robotis_Client( 'right_tilt' ) # Create Costmap Services obj self.cs = costmap.CostmapServices( accum = 3 ) # Note: After moving, this will require accum * -1's before stopping. # Publish move_base command self._pub = rospy.Publisher( 'rfid_cmd_vel', Twist ) # Alterative ways to call servoing using ROS services / actionlib self._service_servo = rospy.Service( '/rfid_servo/servo', ServoSrv, self.service_request ) self._as = actionlib.SimpleActionServer( '/rfid_servo/servo_act', ServoAction, execute_cb = self.action_request ) self._as.start() rospy.logout( 'servo_node: Service ready and waiting' ) def service_request( self, req ): return self.run( req.tagid ) def action_request( self, goal ): rospy.logout( 'servo_node: action_request received for tagid: \'%s\'' % goal.tagid ) def preempt_func(): # self._as should be in scope and bound @ function def. (I think for python...) check = self._as.is_preempt_requested() if check: rospy.logout( 'servo_node: action_request preempted!' ) return check rv = self.run( goal.tagid, preempt_func = preempt_func ) rospy.logout( 'servo_node: action_request received result %d' % int(rv) ) if preempt_func(): # this is a relatively new addition rospy.logout('servo_node: returning actionlib state preempted.') self._as.set_preempted() elif rv == True: self._as.set_succeeded( ServoResult( int(rv) )) def run( self, tag_id, preempt_func = retfalse ): # tag_id => 12-character tag id # preempt_func => returns true when a preempt request is received, else false rospy.logout( 'servo_node: Run called for tagid: \'%s\'' % tag_id ) # Ears out. self.robotis_init() # Startup RFID reads zc = ZedCalc( filt_len = 5, tag_id = tag_id ) rospy.logout('servo_node: Running') zed_next = zc.next_pub() r = rospy.Rate( 10 ) while not rospy.is_shutdown() and self.cs.scoreTraj_PosHyst( 0.1, 0.0, zed_next ) != -1.0 and not preempt_func(): move_command = Twist() move_command.linear.x = 0.1 move_command.angular.z = zed_next self._pub.publish( move_command ) zc.update_last_pub( zed_next ) zed_next = zc.next_pub() # Don't do this too fast (avoid unwanted buffering / rate issues) try: r.sleep() except rospy.ROSInterruptException: # rospy shutdown request received pass self._pub.publish( Twist() ) # Stop moving. # Tuck ears # self.robotis_end() zc.stop() # Stop the RFID reader... if preempt_func(): rospy.logout( 'servo_node: Preempt was requested. May not have finished.' ) rospy.logout( 'servo_node: Exiting' ) return False else: rospy.logout( 'servo_node: Exiting' ) return True def robotis_init( self ): # Move Antennas into Servo mode self.t_left.move_angle( 0.0, math.radians(30), blocking = False ) self.t_right.move_angle( 0.0, math.radians(30), blocking = False ) self.p_left.move_angle( math.radians(40), math.radians(30), blocking = False ) self.p_right.move_angle( math.radians(-40), math.radians(30), blocking = True ) while self.p_left.is_moving() or self.p_right.is_moving(): rospy.sleep( 0.05 ) def robotis_end( self ): # Return servos to home position self.t_left.move_angle( 0.0, math.radians(10), blocking = False ) self.t_right.move_angle( 0.0, math.radians(10), blocking = False ) self.p_left.move_angle( 1.350, math.radians(10), blocking = False ) if not (os.environ.has_key('ROBOT') and os.environ['ROBOT'] == 'sim'): self.p_right.move_angle( -1.350, math.radians(10), blocking = False ) else: self.p_right.move_angle( -1.350, math.radians(10), blocking = True ) class ZedCalc( ): ### WARNING: Do not instantiate in init's. This object queries the RFID reader! def __init__( self, tag_id, sub_name = '/rfid/ears_reader', filt_len = 5 ): rospy.logout( 'ZedCalc: Initializing' ) # We will process the reads ourself self.values = { 'EleLeftEar': 75.0, 'EleRightEar': 75.0 } self.lock = Lock() self.buff_len = filt_len * 2 # two antennas' worth self.zed_buff = deque( np.zeros( self.buff_len )) # Angle filter length self.last_zed = 0.0 # last published command self.new_zed = 0.0 # projected new command self._sub = rospy.Subscriber( sub_name, RFIDread, self.callback) self.reader = rmc.ROS_M5e_Client('ears') self.reader.track_mode( tag_id ) rospy.logout( 'ZedCalc: Ready.' ) def stop( self ): rospy.logout( 'ZedCalc: Stopping RFID reader' ) self.reader.stop() # Stop RFID reads def callback( self, msg ): self.values[ msg.antenna_name ] = np.clip( msg.rssi, 75.0, 110.0 ) left = self.values[ 'EleLeftEar' ] right = self.values[ 'EleRightEar' ] self.lock.acquire() # lock on buff self.zed_buff.append( 0.10 * (left - right)/5.0 ) if len( self.zed_buff ) > self.buff_len: self.zed_buff.popleft() self.lock.release() def next_pub( self, angle_slew = math.radians( 10 )): self.lock.acquire() # lock on buff target = np.mean( self.zed_buff ) self.lock.release() lz = self.last_zed return lz + np.clip( target - lz, -1.0 * angle_slew, angle_slew ) def update_last_pub( self, pub_val ): self.last_zed = pub_val if __name__ == '__main__': sn = ServoNode() rospy.spin() # There are (at least) three ways to call this code. # 1) Python: # print sn.run( 'person ' ) # rospy.spin() # 2) ROS service: # rosservice call /rfid_servo/servo "'person '" # 3) ROS actionlib: # try: # client = actionlib.SimpleActionClient( '/rfid_servo/servo_act', ServoAction ) # client.wait_for_server() # client.send_goal( ServoGoal( 'person ' )) # client.wait_for_result() # print client.get_result() # except rospy.ROSInterruptException: # print 'Program interrupted before completion' # rospy.spin()
ajibawa-2023/Python-Code-Large/train/row_99384
124
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_99384:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0088, 0.0044, 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_99384:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0132, 0.0044, 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": "roslib.load_manifest('rfid_servoing')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0175, 0.0044, 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_99384:Import_L6_C0", "label": "hrl_rfid.ros_M5e_client import rmc", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0263, 0.0044, 0, 0.66, 0.1579, 460, 0, 1, 0, 0, 460, 0, 0], "semantic": {"name": "hrl_rfid.ros_M5e_client", "arg_names": [], "import_names": ["rmc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_rfid.ros_M5e_client as rmc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:ImportFrom_L7_C0", "label": "from hrl_rfid.msg import RFIDread", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0307, 0.0044, 0, 0.66, 0.2105, 328, 0, 1, 0, 0, 328, 0, 0], "semantic": {"name": "hrl_rfid.msg", "arg_names": [], "import_names": ["RFIDread"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_rfid.msg import RFIDread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Import_L8_C0", "label": "robotis.ros_robotis import rr", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0351, 0.0044, 0, 0.66, 0.2632, 570, 0, 1, 0, 0, 570, 0, 0], "semantic": {"name": "robotis.ros_robotis", "arg_names": [], "import_names": ["rr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import robotis.ros_robotis as rr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Import_L9_C0", "label": "costmap_services.python_client import costmap", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0395, 0.0044, 0, 0.66, 0.3158, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "costmap_services.python_client", "arg_names": [], "import_names": ["costmap"], "rhs_call_name": "", "annotation": ""}, "snippet": "import costmap_services.python_client as costmap"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:ImportFrom_L10_C0", "label": "from geometry_msgs.msg import Twist", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0439, 0.0044, 0, 0.66, 0.3684, 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_99384:Import_L11_C0", "label": "actionlib import actionlib", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0482, 0.0044, 0, 0.66, 0.4211, 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_99384:ImportFrom_L13_C0", "label": "from rfid_servoing.srv import ServoSrv", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.057, 0.0044, 0, 0.66, 0.4737, 46, 0, 1, 0, 0, 46, 0, 0], "semantic": {"name": "rfid_servoing.srv", "arg_names": [], "import_names": ["ServoSrv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_servoing.srv import ServoSrv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:ImportFrom_L14_C0", "label": "from rfid_servoing.msg import ServoAction, ServoResult, ServoGoal", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0614, 0.0044, 0, 0.66, 0.5263, 317, 0, 3, 0, 0, 317, 0, 0], "semantic": {"name": "rfid_servoing.msg", "arg_names": [], "import_names": ["ServoAction", "ServoResult", "ServoGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_servoing.msg import ServoAction, ServoResult, ServoGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Import_L17_C0", "label": "numpy import np, math", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0746, 0.0044, 0, 0.66, 0.5789, 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_99384:ImportFrom_L18_C0", "label": "from collections import deque", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0789, 0.0044, 0, 0.66, 0.6316, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "collections", "arg_names": [], "import_names": ["deque"], "rhs_call_name": "", "annotation": ""}, "snippet": "from collections import deque"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Import_L19_C0", "label": "os import os", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0044, 0, 0.66, 0.6842, 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_99384:ImportFrom_L20_C0", "label": "from threading import Lock", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0877, 0.0044, 0, 0.66, 0.7368, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["Lock"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import Lock"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L22_C0", "label": "ctime", "type": "function", "loc": [22, 23], "level": 0, "parent": null, "vector": [2, 0, 0.0987, 0.0088, 0, 0.66, 0.7895, 671, 0, 0, 1, 0, 0, 0, 2], "semantic": {"name": "ctime", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ctime():\n return rospy.Time.now().to_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Return_L23_C4", "label": "return", "type": "return", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L22_C0", "vector": [13, 1, 0.1009, 0.0044, 1, 0.44, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rospy.Time.now().to_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L25_C0", "label": "retfalse", "type": "function", "loc": [25, 26], "level": 0, "parent": null, "vector": [2, 0, 0.1118, 0.0088, 0, 0.66, 0.8421, 71, 0, 0, 1, 0, 0, 0, 0], "semantic": {"name": "retfalse", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def retfalse():\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Return_L26_C4", "label": "return", "type": "return", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L25_C0", "vector": [13, 1, 0.114, 0.0044, 1, 0.34, 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_99384:ClassDef_L28_C0", "label": "ServoNode", "type": "class", "loc": [28, 145], "level": 0, "parent": null, "vector": [3, 0, 0.3794, 0.5175, 0, 0.66, 0.8947, 654, 0, 7, 0, 0, 0, 0, 70], "semantic": {"name": "ServoNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ServoNode( ):\n def __init__( self ):\n rospy.logout('servo_node: Initializing')\n try:\n rospy.init_node('servo_node')\n except: # Node probably already initialized elsewhere\n pass\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "label": "__init__", "type": "function", "loc": [29, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:ClassDef_L28_C0", "vector": [2, 1, 0.1842, 0.1184, 1, 0.54, 0.0, 555, 0, 1, 0, 0, 0, 0, 12], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self ):\n rospy.logout('servo_node: Initializing')\n try:\n rospy.init_node('servo_node')\n except: # Node probably already initialized elsewhere\n pass\n\n # Create servos."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L30_C8", "label": "logout()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "vector": [8, 2, 0.1316, 0.0044, 2, 0.01, 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('servo_node: Initializing')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Try_L31_C8", "label": "try", "type": "try", "loc": [31, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "vector": [7, 2, 0.1425, 0.0175, 2, 0.01, 0.0909, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node('servo_node')\n except: # Node probably already initialized elsewhere\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L32_C12", "label": "init_node()", "type": "expression", "loc": [32, 32], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:Try_L31_C8", "vector": [8, 3, 0.1404, 0.0044, 3, 0.09, 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('servo_node')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L37_C8", "label": "self.p_left = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "vector": [14, 2, 0.1623, 0.0044, 2, 0.01, 0.1818, 577, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "self.p_left", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " self.p_left = rr.ROS_Robotis_Client( 'left_pan' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L38_C8", "label": "self.t_left = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "vector": [14, 2, 0.1667, 0.0044, 2, 0.01, 0.2727, 624, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "self.t_left", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " self.t_left = rr.ROS_Robotis_Client( 'left_tilt' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L39_C8", "label": "self.p_right = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "vector": [14, 2, 0.1711, 0.0044, 2, 0.01, 0.3636, 972, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "self.p_right", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " self.p_right = rr.ROS_Robotis_Client( 'right_pan' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L40_C8", "label": "self.t_right = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "vector": [14, 2, 0.1754, 0.0044, 2, 0.01, 0.4545, 359, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "self.t_right", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " self.t_right = rr.ROS_Robotis_Client( 'right_tilt' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L43_C8", "label": "self.cs = CostmapServices()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "vector": [14, 2, 0.1886, 0.0044, 2, 0.01, 0.5455, 23, 3, 1, 0, 0, 974, 10, 1], "semantic": {"name": "self.cs", "arg_names": [], "import_names": [], "rhs_call_name": "CostmapServices", "annotation": ""}, "snippet": " self.cs = costmap.CostmapServices( accum = 3 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L47_C8", "label": "self._pub = Publisher()", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "vector": [14, 2, 0.2061, 0.0044, 2, 0.01, 0.6364, 415, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self._pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self._pub = rospy.Publisher( 'rfid_cmd_vel', Twist )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L50_C8", "label": "self._service_servo = Service()", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "vector": [14, 2, 0.2193, 0.0044, 2, 0.01, 0.7273, 917, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self._service_servo", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self._service_servo = rospy.Service( '/rfid_servo/servo', ServoSrv, self.service_request )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L51_C8", "label": "self._as = SimpleActionServer()", "type": "assigned_variable", "loc": [51, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "vector": [14, 2, 0.2259, 0.0088, 2, 0.01, 0.8182, 777, 3, 3, 0, 0, 975, 10, 1], "semantic": {"name": "self._as", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionServer", "annotation": ""}, "snippet": " self._as = actionlib.SimpleActionServer( '/rfid_servo/servo_act',\n ServoAction, execute_cb = self.action_request )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L53_C8", "label": "start()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "vector": [8, 2, 0.2325, 0.0044, 2, 0.01, 0.9091, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self._as.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L55_C8", "label": "logout()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "vector": [8, 2, 0.2412, 0.0044, 2, 0.01, 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( 'servo_node: Service ready and waiting' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L58_C4", "label": "service_request", "type": "function", "loc": [58, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:ClassDef_L28_C0", "vector": [2, 1, 0.2566, 0.0088, 1, 0.54, 0.2, 396, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "service_request", "arg_names": ["self", "req"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def service_request( self, req ):\n return self.run( req.tagid )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Return_L59_C8", "label": "return", "type": "return", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L58_C4", "vector": [13, 2, 0.2588, 0.0044, 2, 0.29, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.run( req.tagid )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L61_C4", "label": "action_request", "type": "function", "loc": [61, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:ClassDef_L28_C0", "vector": [2, 1, 0.3048, 0.0789, 1, 0.54, 0.4, 616, 0, 2, 1, 0, 0, 0, 12], "semantic": {"name": "action_request", "arg_names": ["self", "goal"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def action_request( self, goal ):\n rospy.logout( 'servo_node: action_request received for tagid: \\'%s\\'' % goal.tagid )\n \n def preempt_func():\n # self._as should be in scope and bound @ function def. (I think for python...)\n check = self._as.is_preempt_requested()\n if check:\n rospy.logout( 'servo_node: action_request preempted!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L62_C8", "label": "logout()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L61_C4", "vector": [8, 2, 0.2719, 0.0044, 2, 0.66, 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( 'servo_node: action_request received for tagid: \\'%s\\'' % goal.tagid )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L64_C8", "label": "preempt_func", "type": "function", "loc": [64, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L61_C4", "vector": [2, 2, 0.2917, 0.0263, 2, 0.66, 0.25, 314, 0, 0, 1, 0, 0, 0, 2], "semantic": {"name": "preempt_func", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def preempt_func():\n # self._as should be in scope and bound @ function def. (I think for python...)\n check = self._as.is_preempt_requested()\n if check:\n rospy.logout( 'servo_node: action_request preempted!' )\n return check"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L66_C12", "label": "check = is_preempt_requested()", "type": "assigned_variable", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L64_C8", "vector": [14, 3, 0.2895, 0.0044, 3, 0.04, 0.0, 803, 3, 0, 0, 0, 468, 10, 1], "semantic": {"name": "check", "arg_names": [], "import_names": [], "rhs_call_name": "is_preempt_requested", "annotation": ""}, "snippet": " check = self._as.is_preempt_requested()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L67_C12", "label": "if", "type": "if", "loc": [67, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L64_C8", "vector": [4, 3, 0.2961, 0.0088, 3, 0.04, 0.5, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if check:\n rospy.logout( 'servo_node: action_request preempted!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L68_C16", "label": "logout()", "type": "expression", "loc": [68, 68], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L67_C12", "vector": [8, 4, 0.2982, 0.0044, 4, 0.15, 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( 'servo_node: action_request preempted!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Return_L69_C12", "label": "return", "type": "return", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L64_C8", "vector": [13, 3, 0.3026, 0.0044, 3, 0.04, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return check"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L71_C8", "label": "rv = run()", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L61_C4", "vector": [14, 2, 0.3114, 0.0044, 2, 0.66, 0.5, 222, 3, 2, 0, 0, 679, 10, 1], "semantic": {"name": "rv", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " rv = self.run( goal.tagid, preempt_func = preempt_func )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L72_C8", "label": "logout()", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L61_C4", "vector": [8, 2, 0.3158, 0.0044, 2, 0.66, 0.75, 525, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'servo_node: action_request received result %d' % int(rv) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L74_C8", "label": "if", "type": "if", "loc": [74, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L61_C4", "vector": [4, 2, 0.3333, 0.0219, 2, 0.66, 1.0, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if preempt_func(): # this is a relatively new addition\n rospy.logout('servo_node: returning actionlib state preempted.')\n self._as.set_preempted()\n elif rv == True:\n self._as.set_succeeded( ServoResult( int(rv) ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L75_C12", "label": "logout()", "type": "expression", "loc": [75, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L74_C8", "vector": [8, 3, 0.3289, 0.0044, 3, 0.57, 0.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('servo_node: returning actionlib state preempted.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L76_C12", "label": "set_preempted()", "type": "expression", "loc": [76, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L74_C8", "vector": [8, 3, 0.3333, 0.0044, 3, 0.57, 0.5, 196, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_preempted", "arg_names": [], "import_names": [], "rhs_call_name": "set_preempted", "annotation": ""}, "snippet": " self._as.set_preempted()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L77_C8", "label": "if", "type": "if", "loc": [77, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L74_C8", "vector": [4, 3, 0.3399, 0.0088, 3, 0.57, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif rv == True:\n self._as.set_succeeded( ServoResult( int(rv) ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L78_C12", "label": "set_succeeded()", "type": "expression", "loc": [78, 78], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L77_C8", "vector": [8, 4, 0.3421, 0.0044, 4, 0.75, 0.0, 825, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "set_succeeded", "arg_names": [], "import_names": [], "rhs_call_name": "set_succeeded", "annotation": ""}, "snippet": " self._as.set_succeeded( ServoResult( int(rv) ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L81_C4", "label": "run", "type": "function", "loc": [81, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:ClassDef_L28_C0", "vector": [2, 1, 0.4496, 0.193, 1, 0.54, 0.6, 679, 0, 3, 1, 0, 0, 0, 21], "semantic": {"name": "run", "arg_names": ["self", "tag_id", "preempt_func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run( self, tag_id, preempt_func = retfalse ):\n # tag_id => 12-character tag id\n # preempt_func => returns true when a preempt request is received, else false\n rospy.logout( 'servo_node: Run called for tagid: \\'%s\\'' % tag_id )\n\n # Ears out.\n self.robotis_init()\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L84_C8", "label": "logout()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L81_C4", "vector": [8, 2, 0.3684, 0.0044, 2, 0.88, 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( 'servo_node: Run called for tagid: \\'%s\\'' % tag_id )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L87_C8", "label": "robotis_init()", "type": "expression", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L81_C4", "vector": [8, 2, 0.3816, 0.0044, 2, 0.88, 0.1111, 832, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "robotis_init", "arg_names": [], "import_names": [], "rhs_call_name": "robotis_init", "annotation": ""}, "snippet": " self.robotis_init()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L90_C8", "label": "zc = ZedCalc()", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L81_C4", "vector": [14, 2, 0.3947, 0.0044, 2, 0.88, 0.2222, 477, 3, 2, 0, 0, 714, 10, 1], "semantic": {"name": "zc", "arg_names": [], "import_names": [], "rhs_call_name": "ZedCalc", "annotation": ""}, "snippet": " zc = ZedCalc( filt_len = 5, tag_id = tag_id ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L92_C8", "label": "logout()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L81_C4", "vector": [8, 2, 0.4035, 0.0044, 2, 0.88, 0.3333, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('servo_node: Running')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L94_C8", "label": "zed_next = next_pub()", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L81_C4", "vector": [14, 2, 0.4123, 0.0044, 2, 0.88, 0.4444, 677, 3, 0, 0, 0, 134, 10, 1], "semantic": {"name": "zed_next", "arg_names": [], "import_names": [], "rhs_call_name": "next_pub", "annotation": ""}, "snippet": " zed_next = zc.next_pub()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L95_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L81_C4", "vector": [14, 2, 0.4167, 0.0044, 2, 0.88, 0.5556, 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_99384:While_L96_C8", "label": "while", "type": "while", "loc": [96, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L81_C4", "vector": [5, 2, 0.4496, 0.0614, 2, 0.88, 0.6667, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown() and self.cs.scoreTraj_PosHyst( 0.1, 0.0, zed_next ) != -1.0 and not preempt_func():\n move_command = Twist()\n move_command.linear.x = 0.1\n move_command.angular.z = zed_next\n\n self._pub.publish( move_command )\n zc.update_last_pub( zed_next )\n zed_next = zc.next_pub() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L97_C12", "label": "move_command = Twist()", "type": "assigned_variable", "loc": [97, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:While_L96_C8", "vector": [14, 3, 0.4254, 0.0044, 3, 0.6, 0.0, 175, 3, 0, 0, 0, 9, 10, 1], "semantic": {"name": "move_command", "arg_names": [], "import_names": [], "rhs_call_name": "Twist", "annotation": ""}, "snippet": " move_command = Twist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L98_C12", "label": "move_command.linear.x =", "type": "assigned_variable", "loc": [98, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:While_L96_C8", "vector": [14, 3, 0.4298, 0.0044, 3, 0.6, 0.1667, 56, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "move_command.linear.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " move_command.linear.x = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L99_C12", "label": "move_command.angular.z =", "type": "assigned_variable", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:While_L96_C8", "vector": [14, 3, 0.4342, 0.0044, 3, 0.6, 0.3333, 153, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "move_command.angular.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " move_command.angular.z = zed_next"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L101_C12", "label": "publish()", "type": "expression", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:While_L96_C8", "vector": [8, 3, 0.443, 0.0044, 3, 0.6, 0.5, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self._pub.publish( move_command )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L102_C12", "label": "update_last_pub()", "type": "expression", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:While_L96_C8", "vector": [8, 3, 0.4474, 0.0044, 3, 0.6, 0.6667, 305, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update_last_pub", "arg_names": [], "import_names": [], "rhs_call_name": "update_last_pub", "annotation": ""}, "snippet": " zc.update_last_pub( zed_next )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L103_C12", "label": "zed_next = next_pub()", "type": "assigned_variable", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:While_L96_C8", "vector": [14, 3, 0.4518, 0.0044, 3, 0.6, 0.8333, 677, 3, 0, 0, 0, 134, 10, 1], "semantic": {"name": "zed_next", "arg_names": [], "import_names": [], "rhs_call_name": "next_pub", "annotation": ""}, "snippet": " zed_next = zc.next_pub() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Try_L106_C12", "label": "try", "type": "try", "loc": [106, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:While_L96_C8", "vector": [7, 3, 0.4715, 0.0175, 3, 0.6, 1.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n r.sleep()\n except rospy.ROSInterruptException: # rospy shutdown request received\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L107_C16", "label": "sleep()", "type": "expression", "loc": [107, 107], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:Try_L106_C12", "vector": [8, 4, 0.4693, 0.0044, 4, 0.7, 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_99384:Expr_L111_C8", "label": "publish()", "type": "expression", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L81_C4", "vector": [8, 2, 0.4868, 0.0044, 2, 0.88, 0.7778, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self._pub.publish( Twist() ) # Stop moving."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L116_C8", "label": "stop()", "type": "expression", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L81_C4", "vector": [8, 2, 0.5088, 0.0044, 2, 0.88, 0.8889, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " zc.stop() # Stop the RFID reader..."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L118_C8", "label": "if", "type": "if", "loc": [118, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L81_C4", "vector": [4, 2, 0.5307, 0.0307, 2, 0.88, 1.0, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if preempt_func():\n rospy.logout( 'servo_node: Preempt was requested. May not have finished.' )\n rospy.logout( 'servo_node: Exiting' )\n return False\n else:\n rospy.logout( 'servo_node: Exiting' )\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L119_C12", "label": "logout()", "type": "expression", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L118_C8", "vector": [8, 3, 0.5219, 0.0044, 3, 0.4, 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( 'servo_node: Preempt was requested. May not have finished.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L120_C12", "label": "logout()", "type": "expression", "loc": [120, 120], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L118_C8", "vector": [8, 3, 0.5263, 0.0044, 3, 0.4, 0.25, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'servo_node: Exiting' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Return_L121_C12", "label": "return", "type": "return", "loc": [121, 121], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L118_C8", "vector": [13, 3, 0.5307, 0.0044, 3, 0.4, 0.5, 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_99384:Expr_L123_C12", "label": "logout()", "type": "expression", "loc": [123, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L118_C8", "vector": [8, 3, 0.5395, 0.0044, 3, 0.4, 0.75, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'servo_node: Exiting' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Return_L124_C12", "label": "return", "type": "return", "loc": [124, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L118_C8", "vector": [13, 3, 0.5439, 0.0044, 3, 0.4, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L127_C4", "label": "robotis_init", "type": "function", "loc": [127, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:ClassDef_L28_C0", "vector": [2, 1, 0.5746, 0.0395, 1, 0.54, 0.8, 832, 0, 1, 0, 0, 0, 0, 13], "semantic": {"name": "robotis_init", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def robotis_init( self ):\n # Move Antennas into Servo mode\n self.t_left.move_angle( 0.0, math.radians(30), blocking = False )\n self.t_right.move_angle( 0.0, math.radians(30), blocking = False )\n self.p_left.move_angle( math.radians(40), math.radians(30), blocking = False )\n self.p_right.move_angle( math.radians(-40), math.radians(30), blocking = True )\n\n while self.p_left.is_moving() or self.p_right.is_moving():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L129_C8", "label": "move_angle()", "type": "expression", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L127_C4", "vector": [8, 2, 0.5658, 0.0044, 2, 0.3, 0.0, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.t_left.move_angle( 0.0, math.radians(30), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L130_C8", "label": "move_angle()", "type": "expression", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L127_C4", "vector": [8, 2, 0.5702, 0.0044, 2, 0.3, 0.25, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.t_right.move_angle( 0.0, math.radians(30), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L131_C8", "label": "move_angle()", "type": "expression", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L127_C4", "vector": [8, 2, 0.5746, 0.0044, 2, 0.3, 0.5, 293, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.p_left.move_angle( math.radians(40), math.radians(30), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L132_C8", "label": "move_angle()", "type": "expression", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L127_C4", "vector": [8, 2, 0.5789, 0.0044, 2, 0.3, 0.75, 293, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.p_right.move_angle( math.radians(-40), math.radians(30), blocking = True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:While_L134_C8", "label": "while", "type": "while", "loc": [134, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L127_C4", "vector": [5, 2, 0.5899, 0.0088, 2, 0.3, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.p_left.is_moving() or self.p_right.is_moving():\n rospy.sleep( 0.05 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L135_C12", "label": "sleep()", "type": "expression", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:While_L134_C8", "vector": [8, 3, 0.5921, 0.0044, 3, 0.83, 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.05 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L137_C4", "label": "robotis_end", "type": "function", "loc": [137, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:ClassDef_L28_C0", "vector": [2, 1, 0.6184, 0.0395, 1, 0.54, 1.0, 532, 0, 1, 0, 0, 0, 0, 11], "semantic": {"name": "robotis_end", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def robotis_end( self ):\n # Return servos to home position\n self.t_left.move_angle( 0.0, math.radians(10), blocking = False )\n self.t_right.move_angle( 0.0, math.radians(10), blocking = False )\n self.p_left.move_angle( 1.350, math.radians(10), blocking = False )\n if not (os.environ.has_key('ROBOT') and os.environ['ROBOT'] == 'sim'):\n self.p_right.move_angle( -1.350, math.radians(10), blocking = False )\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L139_C8", "label": "move_angle()", "type": "expression", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L137_C4", "vector": [8, 2, 0.6096, 0.0044, 2, 0.12, 0.0, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.t_left.move_angle( 0.0, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L140_C8", "label": "move_angle()", "type": "expression", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L137_C4", "vector": [8, 2, 0.614, 0.0044, 2, 0.12, 0.3333, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.t_right.move_angle( 0.0, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L141_C8", "label": "move_angle()", "type": "expression", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L137_C4", "vector": [8, 2, 0.6184, 0.0044, 2, 0.12, 0.6667, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.p_left.move_angle( 1.350, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L142_C8", "label": "if", "type": "if", "loc": [142, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L137_C4", "vector": [4, 2, 0.6294, 0.0175, 2, 0.12, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (os.environ.has_key('ROBOT') and os.environ['ROBOT'] == 'sim'):\n self.p_right.move_angle( -1.350, math.radians(10), blocking = False )\n else:\n self.p_right.move_angle( -1.350, math.radians(10), blocking = True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L143_C12", "label": "move_angle()", "type": "expression", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L142_C8", "vector": [8, 3, 0.6272, 0.0044, 3, 0.69, 0.0, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.p_right.move_angle( -1.350, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L145_C12", "label": "move_angle()", "type": "expression", "loc": [145, 145], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L142_C8", "vector": [8, 3, 0.636, 0.0044, 3, 0.69, 1.0, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.p_right.move_angle( -1.350, math.radians(10), blocking = True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:ClassDef_L149_C0", "label": "ZedCalc", "type": "class", "loc": [149, 195], "level": 0, "parent": null, "vector": [3, 0, 0.7544, 0.2061, 0, 0.66, 0.9474, 714, 0, 5, 0, 0, 0, 0, 21], "semantic": {"name": "ZedCalc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ZedCalc( ):\n ### WARNING: Do not instantiate in init's. This object queries the RFID reader!\n def __init__( self, tag_id, sub_name = '/rfid/ears_reader', filt_len = 5 ):\n rospy.logout( 'ZedCalc: Initializing' )\n # We will process the reads ourself\n self.values = { 'EleLeftEar': 75.0,\n 'EleRightEar': 75.0 }\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L151_C4", "label": "__init__", "type": "function", "loc": [151, 168], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:ClassDef_L149_C0", "vector": [2, 1, 0.6996, 0.0789, 1, 0.86, 0.0, 555, 0, 4, 0, 0, 0, 0, 8], "semantic": {"name": "__init__", "arg_names": ["self", "tag_id", "sub_name", "filt_len"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, tag_id, sub_name = '/rfid/ears_reader', filt_len = 5 ):\n rospy.logout( 'ZedCalc: Initializing' )\n # We will process the reads ourself\n self.values = { 'EleLeftEar': 75.0,\n 'EleRightEar': 75.0 }\n\n self.lock = Lock()\n self.buff_len = filt_len * 2 # two antennas' worth"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L152_C8", "label": "logout()", "type": "expression", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L151_C4", "vector": [8, 2, 0.6667, 0.0044, 2, 0.45, 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( 'ZedCalc: Initializing' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L154_C8", "label": "self.values =", "type": "assigned_variable", "loc": [154, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L151_C4", "vector": [14, 2, 0.6776, 0.0088, 2, 0.45, 0.1, 397, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.values", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.values = { 'EleLeftEar': 75.0,\n 'EleRightEar': 75.0 }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L157_C8", "label": "self.lock = Lock()", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L151_C4", "vector": [14, 2, 0.6886, 0.0044, 2, 0.45, 0.2, 45, 3, 0, 0, 0, 843, 10, 1], "semantic": {"name": "self.lock", "arg_names": [], "import_names": [], "rhs_call_name": "Lock", "annotation": ""}, "snippet": " self.lock = Lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L158_C8", "label": "self.buff_len =", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L151_C4", "vector": [14, 2, 0.693, 0.0044, 2, 0.45, 0.3, 862, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.buff_len", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.buff_len = filt_len * 2 # two antennas' worth"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L159_C8", "label": "self.zed_buff = deque()", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L151_C4", "vector": [14, 2, 0.6974, 0.0044, 2, 0.45, 0.4, 243, 3, 1, 0, 0, 650, 10, 2], "semantic": {"name": "self.zed_buff", "arg_names": [], "import_names": [], "rhs_call_name": "deque", "annotation": ""}, "snippet": " self.zed_buff = deque( np.zeros( self.buff_len )) # Angle filter length"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L161_C8", "label": "self.last_zed =", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L151_C4", "vector": [14, 2, 0.7061, 0.0044, 2, 0.45, 0.5, 174, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.last_zed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.last_zed = 0.0 # last published command"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L162_C8", "label": "self.new_zed =", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L151_C4", "vector": [14, 2, 0.7105, 0.0044, 2, 0.45, 0.6, 429, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.new_zed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.new_zed = 0.0 # projected new command"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L164_C8", "label": "self._sub = Subscriber()", "type": "assigned_variable", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L151_C4", "vector": [14, 2, 0.7193, 0.0044, 2, 0.45, 0.7, 531, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "self._sub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " self._sub = rospy.Subscriber( sub_name, RFIDread, self.callback)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L165_C8", "label": "self.reader = ROS_M5e_Client()", "type": "assigned_variable", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L151_C4", "vector": [14, 2, 0.7237, 0.0044, 2, 0.45, 0.8, 536, 3, 1, 0, 0, 479, 10, 1], "semantic": {"name": "self.reader", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_M5e_Client", "annotation": ""}, "snippet": " self.reader = rmc.ROS_M5e_Client('ears')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L166_C8", "label": "track_mode()", "type": "expression", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L151_C4", "vector": [8, 2, 0.7281, 0.0044, 2, 0.45, 0.9, 884, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "track_mode", "arg_names": [], "import_names": [], "rhs_call_name": "track_mode", "annotation": ""}, "snippet": " self.reader.track_mode( tag_id )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L168_C8", "label": "logout()", "type": "expression", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L151_C4", "vector": [8, 2, 0.7368, 0.0044, 2, 0.45, 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( 'ZedCalc: Ready.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L170_C4", "label": "stop", "type": "function", "loc": [170, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:ClassDef_L149_C0", "vector": [2, 1, 0.75, 0.0132, 1, 0.86, 0.25, 343, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "stop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop( self ):\n rospy.logout( 'ZedCalc: Stopping RFID reader' )\n self.reader.stop() # Stop RFID reads"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L171_C8", "label": "logout()", "type": "expression", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L170_C4", "vector": [8, 2, 0.75, 0.0044, 2, 0.19, 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( 'ZedCalc: Stopping RFID reader' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L172_C8", "label": "stop()", "type": "expression", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L170_C4", "vector": [8, 2, 0.7544, 0.0044, 2, 0.19, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " self.reader.stop() # Stop RFID reads"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L175_C4", "label": "callback", "type": "function", "loc": [175, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:ClassDef_L149_C0", "vector": [2, 1, 0.7873, 0.0439, 1, 0.86, 0.5, 342, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "callback", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def callback( self, msg ):\n self.values[ msg.antenna_name ] = np.clip( msg.rssi, 75.0, 110.0 )\n left = self.values[ 'EleLeftEar' ]\n right = self.values[ 'EleRightEar' ]\n\n self.lock.acquire() # lock on buff \n self.zed_buff.append( 0.10 * (left - right)/5.0 )\n if len( self.zed_buff ) > self.buff_len:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L176_C8", "label": " = clip()", "type": "assigned_variable", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L175_C4", "vector": [14, 2, 0.7719, 0.0044, 2, 0.9, 0.0, 0, 3, 3, 0, 0, 689, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "clip", "annotation": ""}, "snippet": " self.values[ msg.antenna_name ] = np.clip( msg.rssi, 75.0, 110.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L177_C8", "label": "left =", "type": "assigned_variable", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L175_C4", "vector": [14, 2, 0.7763, 0.0044, 2, 0.9, 0.1667, 605, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "left", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " left = self.values[ 'EleLeftEar' ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L178_C8", "label": "right =", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L175_C4", "vector": [14, 2, 0.7807, 0.0044, 2, 0.9, 0.3333, 724, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "right", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " right = self.values[ 'EleRightEar' ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L180_C8", "label": "acquire()", "type": "expression", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L175_C4", "vector": [8, 2, 0.7895, 0.0044, 2, 0.9, 0.5, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.lock.acquire() # lock on buff "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L181_C8", "label": "append()", "type": "expression", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L175_C4", "vector": [8, 2, 0.7939, 0.0044, 2, 0.9, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.zed_buff.append( 0.10 * (left - right)/5.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L182_C8", "label": "if", "type": "if", "loc": [182, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L175_C4", "vector": [4, 2, 0.8004, 0.0088, 2, 0.9, 0.8333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len( self.zed_buff ) > self.buff_len:\n self.zed_buff.popleft()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L183_C12", "label": "popleft()", "type": "expression", "loc": [183, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L182_C8", "vector": [8, 3, 0.8026, 0.0044, 3, 0.97, 0.0, 285, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "popleft", "arg_names": [], "import_names": [], "rhs_call_name": "popleft", "annotation": ""}, "snippet": " self.zed_buff.popleft()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L184_C8", "label": "release()", "type": "expression", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L175_C4", "vector": [8, 2, 0.807, 0.0044, 2, 0.9, 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_99384:FunctionDef_L186_C4", "label": "next_pub", "type": "function", "loc": [186, 192], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:ClassDef_L149_C0", "vector": [2, 1, 0.8289, 0.0307, 1, 0.86, 0.75, 134, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "next_pub", "arg_names": ["self", "angle_slew"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def next_pub( self, angle_slew = math.radians( 10 )):\n self.lock.acquire() # lock on buff\n target = np.mean( self.zed_buff )\n self.lock.release()\n \n lz = self.last_zed\n return lz + np.clip( target - lz, -1.0 * angle_slew, angle_slew )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L187_C8", "label": "acquire()", "type": "expression", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L186_C4", "vector": [8, 2, 0.8202, 0.0044, 2, 0.61, 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() # lock on buff"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L188_C8", "label": "target = mean()", "type": "assigned_variable", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L186_C4", "vector": [14, 2, 0.8246, 0.0044, 2, 0.61, 0.25, 766, 3, 1, 0, 0, 856, 10, 1], "semantic": {"name": "target", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " target = np.mean( self.zed_buff )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L189_C8", "label": "release()", "type": "expression", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L186_C4", "vector": [8, 2, 0.8289, 0.0044, 2, 0.61, 0.5, 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_99384:Assign_L191_C8", "label": "lz =", "type": "assigned_variable", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L186_C4", "vector": [14, 2, 0.8377, 0.0044, 2, 0.61, 0.75, 682, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lz = self.last_zed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Return_L192_C8", "label": "return", "type": "return", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L186_C4", "vector": [13, 2, 0.8421, 0.0044, 2, 0.61, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return lz + np.clip( target - lz, -1.0 * angle_slew, angle_slew )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L194_C4", "label": "update_last_pub", "type": "function", "loc": [194, 195], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:ClassDef_L149_C0", "vector": [2, 1, 0.8531, 0.0088, 1, 0.86, 1.0, 305, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "update_last_pub", "arg_names": ["self", "pub_val"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update_last_pub( self, pub_val ):\n self.last_zed = pub_val"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L195_C8", "label": "self.last_zed =", "type": "assigned_variable", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L194_C4", "vector": [14, 2, 0.8553, 0.0044, 2, 0.35, 0.0, 174, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.last_zed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.last_zed = pub_val"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L199_C0", "label": "if", "type": "if", "loc": [199, 202], "level": 0, "parent": null, "vector": [4, 0, 0.8794, 0.0175, 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\n sn = ServoNode()\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L201_C4", "label": "sn = ServoNode()", "type": "assigned_variable", "loc": [201, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L199_C0", "vector": [14, 1, 0.8816, 0.0044, 1, 0.49, 0.0, 981, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "sn", "arg_names": [], "import_names": [], "rhs_call_name": "ServoNode", "annotation": ""}, "snippet": " sn = ServoNode()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L202_C4", "label": "spin()", "type": "expression", "loc": [202, 202], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L199_C0", "vector": [8, 1, 0.886, 0.0044, 1, 0.49, 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_99384:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Return_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Return_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Try_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:Try_L31_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L32_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Return_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L67_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L68_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Return_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:While_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:While_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L97_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:While_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:While_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:While_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:While_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:While_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:While_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Try_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:Try_L106_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L107_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L118_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L119_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L118_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L120_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L118_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Return_L121_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L118_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L123_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L118_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Return_L124_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:While_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:While_L134_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L142_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L142_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L145_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:ClassDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:ClassDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:ClassDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L182_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L183_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:ClassDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L186_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Return_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:ClassDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L199_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Assign_L201_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99384:If_L199_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99384:Expr_L202_C4"}]
#! /usr/bin/python import roslib roslib.load_manifest('rfid_servoing') import rospy from geometry_msgs.msg import Twist from std_msgs.msg import Float64 from rfid_people_following.srv import StringInt32_Int32 from rfid_people_following.srv import Int32_Int32 from rfid_people_following.srv import StringInt32_Int32Response from std_srvs.srv import Empty import numpy as np, math import os import hrl_rfid.ros_M5e_client as rmc import robotis.ros_robotis as rr from threading import Thread from collections import deque SCORE_BUFFER_LEN = 5 SCORE_BUFFER_MOVE = 3 # number of checked buffer elements that must not be -1. ANGLE_FILTER_LEN = 5 ANGLE_SLEW = math.radians( 10 ) def ctime(): return rospy.Time.now().to_time() class ServoNode( ): def __init__( self ): rospy.logout('servo_node: Initializing') try: rospy.init_node('servo_node') except: pass # Unfold "ears" to servo positions self.p_left = rr.ROS_Robotis_Client( 'left_pan' ) self.t_left = rr.ROS_Robotis_Client( 'left_tilt' ) self.p_right = rr.ROS_Robotis_Client( 'right_pan' ) self.t_right = rr.ROS_Robotis_Client( 'right_tilt' ) # Use assisted teleop as pseudo-callback to see if valid movement: self.scores = deque() self.og_pub = rospy.Publisher( 'assisted_teleop_check', Twist ) self.og_sub = rospy.Subscriber( 'assisted_teleop_score', Float64, self.og_score_cb ) self.command_pub = rospy.Publisher( 'rfid_cmd_vel', Twist ) self._service_servo = rospy.Service('/rfid_servo/servo', StringInt32_Int32, self.run ) self._service_stop = rospy.Service('/rfid_servo/stop', Empty, self.servo_stop ) self._service_stop = rospy.Service('/rfid_servo/abort', Empty, self.servo_abort ) self._service_stop_next_obs = rospy.Service('/rfid_servo/stop_next_obs', Int32_Int32, self.stop_request ) self.stop_next_obs = False # run forever self.should_run = True self.abort = False rospy.logout( 'servo_node: Service ready and waiting' ) def stop_request( self, msg = None ): #self.stop_next_obs = bool( msg.data ) self.stop_next_obs = not self.stop_next_obs rospy.logout( 'servo_node: Stop after next obstacle flag set to %s' % str( self.stop_next_obs )) return True def servo_stop( self, msg = None ): # Note... should now be called "toggle" self.should_run = not self.should_run rospy.logout( 'servo_node: Toggled should_run to %s' % str( self.should_run )) def servo_abort( self, msg = None ): # Note... should now be called "toggle" self.abort = True rospy.logout( 'servo_node: Aborting!' ) def og_score_cb( self, msg ): self.scores.append( msg.data ) if len( self.scores ) > SCORE_BUFFER_LEN: self.scores.popleft() def run( self, request ): rospy.logout( 'servo_node: Called for tagid: \'%s\', continous: %d' % (request.data, request.cont) ) # Move Antennas into Servo mode self.t_left.move_angle( 0.0, math.radians(30), blocking = False ) self.t_right.move_angle( 0.0, math.radians(30), blocking = False ) self.p_left.move_angle( math.radians(-40), math.radians(30), blocking = False ) self.p_right.move_angle( math.radians(40), math.radians(30), blocking = True ) while self.p_left.is_moving() or self.p_right.is_moving(): #time.sleep( 0.01 ) # Not such a good idea when doing simulation. rospy.sleep( 0.05 ) self.stop_next_obs = bool( request.cont ) self.should_run = True self.abort = False # Startup RFID reads self.rp = rfid_poller( request.data ) rospy.logout('servo_node: Running') rate = rospy.Rate( 15.0 ) zed = deque([ 0.0 ]) last_zed = 0.0 #self.scores = deque() last_print = ctime() while self.should_run and not rospy.is_shutdown(): rate.sleep() left, right = self.rp.values #zed.append( 0.07 * (left - right)/5.0 ) zed.append( 0.10 * (left - right)/5.0 ) if len( zed ) > ANGLE_FILTER_LEN: zed.popleft() target_zed = np.mean( zed ) new_zed = last_zed + np.clip( target_zed - last_zed, -1.0 * ANGLE_SLEW, ANGLE_SLEW ) last_zed = new_zed check = Twist() check.linear.x = 0.1 check.angular.z = new_zed self.og_pub.publish( check ) move_command = Twist() if self.abort: self.should_run = False elif len( self.scores ) < SCORE_BUFFER_LEN: rospy.logout( 'servo_node: Score buffer filling: %d of %d' % (len(self.scores), SCORE_BUFFER_LEN) ) elif sum([ i != -1 for i in self.scores]) < SCORE_BUFFER_MOVE: # Check for tag detected! if ctime() - last_print > 1.0: rospy.logout( 'servo_node: Obstacle detected' ) last_print = ctime() if self.stop_next_obs: # Stop after next obstacle detected self.should_run = False elif len( zed ) < ANGLE_FILTER_LEN: rospy.logout( 'servo_node: Angle buffer filling' ) else: move_command.linear.x = check.linear.x move_command.angular.z = check.angular.z self.command_pub.publish( move_command ) # When servo node shuts down... self.command_pub.publish( Twist() ) # Halt the base self.rp.stop() # Stop the reader # Return servos to home position self.t_left.move_angle( 0.0, math.radians(10), blocking = False ) self.t_right.move_angle( 0.0, math.radians(10), blocking = False ) self.p_left.move_angle( -1.350, math.radians(10), blocking = False ) if not (os.environ.has_key('ROBOT') and os.environ['ROBOT'] == 'sim'): self.p_right.move_angle( 1.350, math.radians(10), blocking = False ) else: self.p_right.move_angle( 1.350, math.radians(10), blocking = True ) rospy.logout('servo_node: Returning') return StringInt32_Int32Response( int( True )) class ServoNodeClient(): def __init__( self, service_name = '/rfid_servo/servo' ): rospy.logout( 'servo_node_client: Waiting for service: \'%s\'' % service_name ) rospy.wait_for_service( service_name ) rospy.logout( 'servo_node_client: Service ready.' ) self._servo_service = rospy.ServiceProxy( service_name, StringInt32_Int32 ) def servo( self, tagid, continuous_operation = True ): return self._servo_service( tagid, int( continuous_operation )) class rfid_poller( Thread ): def __init__( self, tagid ): Thread.__init__( self ) self.reader = rmc.ROS_M5e_Client('ears') self.reader.track_mode( tagid ) self.should_run = True self.values = [75.0, 75.0] self.start() def stop( self ): self.should_run = False self.join(3) if (self.isAlive()): raise RuntimeError("rfid_poller: Unable to stop thread") def run( self ): rospy.logout( 'rfid_poller: Starting' ) while self.should_run and not rospy.is_shutdown(): left = np.clip( self.reader.read('EleLeftEar')[-1], 75.0, 110.0 ) right = np.clip( self.reader.read('EleRightEar')[-1], 75.0, 110.0 ) self.values = [left, right] try: # Shut it down to conserve power. Something of a race condition (exception) self.reader.stop() except: pass rospy.logout( 'rfid_poller: Exiting' ) if __name__ == '__main__': sn = ServoNode() rospy.spin()
ajibawa-2023/Python-Code-Large/train/row_99385
144
212
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0094, 0.0047, 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_99385:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0142, 0.0047, 0, 0.66, 0.0435, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('rfid_servoing')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0189, 0.0047, 0, 0.66, 0.087, 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_99385:ImportFrom_L6_C0", "label": "from geometry_msgs.msg import Twist", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0283, 0.0047, 0, 0.66, 0.1304, 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_99385:ImportFrom_L7_C0", "label": "from std_msgs.msg import Float64", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.033, 0.0047, 0, 0.66, 0.1739, 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_99385:ImportFrom_L8_C0", "label": "from rfid_people_following.srv import StringInt32_Int32", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0377, 0.0047, 0, 0.66, 0.2174, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["StringInt32_Int32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import StringInt32_Int32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:ImportFrom_L9_C0", "label": "from rfid_people_following.srv import Int32_Int32", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0425, 0.0047, 0, 0.66, 0.2609, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["Int32_Int32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import Int32_Int32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:ImportFrom_L10_C0", "label": "from rfid_people_following.srv import StringInt32_Int32Response", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0472, 0.0047, 0, 0.66, 0.3043, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["StringInt32_Int32Response"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import StringInt32_Int32Response"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:ImportFrom_L11_C0", "label": "from std_srvs.srv import Empty", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0519, 0.0047, 0, 0.66, 0.3478, 261, 0, 1, 0, 0, 261, 0, 0], "semantic": {"name": "std_srvs.srv", "arg_names": [], "import_names": ["Empty"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_srvs.srv import Empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Import_L13_C0", "label": "numpy import np, math", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0613, 0.0047, 0, 0.66, 0.3913, 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_99385:Import_L14_C0", "label": "os import os", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.066, 0.0047, 0, 0.66, 0.4348, 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_99385:Import_L16_C0", "label": "hrl_rfid.ros_M5e_client import rmc", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0755, 0.0047, 0, 0.66, 0.4783, 460, 0, 1, 0, 0, 460, 0, 0], "semantic": {"name": "hrl_rfid.ros_M5e_client", "arg_names": [], "import_names": ["rmc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_rfid.ros_M5e_client as rmc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Import_L17_C0", "label": "robotis.ros_robotis import rr", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0802, 0.0047, 0, 0.66, 0.5217, 570, 0, 1, 0, 0, 570, 0, 0], "semantic": {"name": "robotis.ros_robotis", "arg_names": [], "import_names": ["rr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import robotis.ros_robotis as rr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:ImportFrom_L19_C0", "label": "from threading import Thread", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0896, 0.0047, 0, 0.66, 0.5652, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["Thread"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import Thread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:ImportFrom_L20_C0", "label": "from collections import deque", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0943, 0.0047, 0, 0.66, 0.6087, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "collections", "arg_names": [], "import_names": ["deque"], "rhs_call_name": "", "annotation": ""}, "snippet": "from collections import deque"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L22_C0", "label": "SCORE_BUFFER_LEN =", "type": "assigned_variable", "loc": [22, 22], "level": 0, "parent": null, "vector": [14, 0, 0.1038, 0.0047, 0, 0.66, 0.6522, 775, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "SCORE_BUFFER_LEN", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SCORE_BUFFER_LEN = 5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L23_C0", "label": "SCORE_BUFFER_MOVE =", "type": "assigned_variable", "loc": [23, 23], "level": 0, "parent": null, "vector": [14, 0, 0.1085, 0.0047, 0, 0.66, 0.6957, 124, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "SCORE_BUFFER_MOVE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SCORE_BUFFER_MOVE = 3 # number of checked buffer elements that must not be -1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L24_C0", "label": "ANGLE_FILTER_LEN =", "type": "assigned_variable", "loc": [24, 24], "level": 0, "parent": null, "vector": [14, 0, 0.1132, 0.0047, 0, 0.66, 0.7391, 686, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "ANGLE_FILTER_LEN", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ANGLE_FILTER_LEN = 5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L25_C0", "label": "ANGLE_SLEW = radians()", "type": "assigned_variable", "loc": [25, 25], "level": 0, "parent": null, "vector": [14, 0, 0.1179, 0.0047, 0, 0.66, 0.7826, 981, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "ANGLE_SLEW", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": "ANGLE_SLEW = math.radians( 10 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L27_C0", "label": "ctime", "type": "function", "loc": [27, 28], "level": 0, "parent": null, "vector": [2, 0, 0.1297, 0.0094, 0, 0.66, 0.8261, 671, 0, 0, 1, 0, 0, 0, 2], "semantic": {"name": "ctime", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ctime():\n return rospy.Time.now().to_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Return_L28_C4", "label": "return", "type": "return", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L27_C0", "vector": [13, 1, 0.1321, 0.0047, 1, 0.98, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rospy.Time.now().to_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L30_C0", "label": "ServoNode", "type": "class", "loc": [30, 162], "level": 0, "parent": null, "vector": [3, 0, 0.4528, 0.6274, 0, 0.66, 0.8696, 654, 0, 6, 0, 0, 0, 0, 80], "semantic": {"name": "ServoNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ServoNode( ):\n def __init__( self ):\n rospy.logout('servo_node: Initializing')\n try:\n rospy.init_node('servo_node')\n except:\n pass\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "label": "__init__", "type": "function", "loc": [31, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L30_C0", "vector": [2, 1, 0.2123, 0.1368, 1, 0.64, 0.0, 555, 0, 1, 0, 0, 0, 0, 15], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self ):\n rospy.logout('servo_node: Initializing')\n try:\n rospy.init_node('servo_node')\n except:\n pass\n\n # Unfold \"ears\" to servo positions"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L32_C8", "label": "logout()", "type": "expression", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "vector": [8, 2, 0.1509, 0.0047, 2, 0.51, 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('servo_node: Initializing')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Try_L33_C8", "label": "try", "type": "try", "loc": [33, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "vector": [7, 2, 0.1627, 0.0189, 2, 0.51, 0.0588, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node('servo_node')\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L34_C12", "label": "init_node()", "type": "expression", "loc": [34, 34], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:Try_L33_C8", "vector": [8, 3, 0.1604, 0.0047, 3, 0.12, 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('servo_node')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L39_C8", "label": "self.p_left = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "vector": [14, 2, 0.184, 0.0047, 2, 0.51, 0.1176, 577, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "self.p_left", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " self.p_left = rr.ROS_Robotis_Client( 'left_pan' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L40_C8", "label": "self.t_left = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "vector": [14, 2, 0.1887, 0.0047, 2, 0.51, 0.1765, 624, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "self.t_left", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " self.t_left = rr.ROS_Robotis_Client( 'left_tilt' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L41_C8", "label": "self.p_right = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "vector": [14, 2, 0.1934, 0.0047, 2, 0.51, 0.2353, 972, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "self.p_right", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " self.p_right = rr.ROS_Robotis_Client( 'right_pan' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L42_C8", "label": "self.t_right = ROS_Robotis_Client()", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "vector": [14, 2, 0.1981, 0.0047, 2, 0.51, 0.2941, 359, 3, 1, 0, 0, 769, 10, 1], "semantic": {"name": "self.t_right", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_Robotis_Client", "annotation": ""}, "snippet": " self.t_right = rr.ROS_Robotis_Client( 'right_tilt' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L46_C8", "label": "self.scores = deque()", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "vector": [14, 2, 0.217, 0.0047, 2, 0.51, 0.3529, 516, 3, 0, 0, 0, 650, 10, 1], "semantic": {"name": "self.scores", "arg_names": [], "import_names": [], "rhs_call_name": "deque", "annotation": ""}, "snippet": " self.scores = deque()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L47_C8", "label": "self.og_pub = Publisher()", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "vector": [14, 2, 0.2217, 0.0047, 2, 0.51, 0.4118, 19, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.og_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.og_pub = rospy.Publisher( 'assisted_teleop_check', Twist )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L48_C8", "label": "self.og_sub = Subscriber()", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "vector": [14, 2, 0.2264, 0.0047, 2, 0.51, 0.4706, 117, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "self.og_sub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " self.og_sub = rospy.Subscriber( 'assisted_teleop_score', Float64, self.og_score_cb )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L49_C8", "label": "self.command_pub = Publisher()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "vector": [14, 2, 0.2311, 0.0047, 2, 0.51, 0.5294, 513, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.command_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.command_pub = rospy.Publisher( 'rfid_cmd_vel', Twist )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L50_C8", "label": "self._service_servo = Service()", "type": "assigned_variable", "loc": [50, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "vector": [14, 2, 0.2406, 0.0142, 2, 0.51, 0.5882, 917, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self._service_servo", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self._service_servo = rospy.Service('/rfid_servo/servo', \n StringInt32_Int32,\n self.run )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L53_C8", "label": "self._service_stop = Service()", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "vector": [14, 2, 0.25, 0.0047, 2, 0.51, 0.6471, 720, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self._service_stop", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self._service_stop = rospy.Service('/rfid_servo/stop', Empty, self.servo_stop )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L54_C8", "label": "self._service_stop = Service()", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "vector": [14, 2, 0.2547, 0.0047, 2, 0.51, 0.7059, 720, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self._service_stop", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self._service_stop = rospy.Service('/rfid_servo/abort', Empty, self.servo_abort )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L55_C8", "label": "self._service_stop_next_obs = Service()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "vector": [14, 2, 0.2594, 0.0047, 2, 0.51, 0.7647, 306, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self._service_stop_next_obs", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self._service_stop_next_obs = rospy.Service('/rfid_servo/stop_next_obs', Int32_Int32, self.stop_request )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L56_C8", "label": "self.stop_next_obs =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "vector": [14, 2, 0.2642, 0.0047, 2, 0.51, 0.8235, 577, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.stop_next_obs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.stop_next_obs = False # run forever"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L57_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "vector": [14, 2, 0.2689, 0.0047, 2, 0.51, 0.8824, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L58_C8", "label": "self.abort =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "vector": [14, 2, 0.2736, 0.0047, 2, 0.51, 0.9412, 665, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.abort", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.abort = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L59_C8", "label": "logout()", "type": "expression", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "vector": [8, 2, 0.2783, 0.0047, 2, 0.51, 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( 'servo_node: Service ready and waiting' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L61_C4", "label": "stop_request", "type": "function", "loc": [61, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L30_C0", "vector": [2, 1, 0.2972, 0.0236, 1, 0.64, 0.2, 720, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "stop_request", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop_request( self, msg = None ):\n #self.stop_next_obs = bool( msg.data )\n self.stop_next_obs = not self.stop_next_obs\n rospy.logout( 'servo_node: Stop after next obstacle flag set to %s' % str( self.stop_next_obs ))\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L63_C8", "label": "self.stop_next_obs =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L61_C4", "vector": [14, 2, 0.2972, 0.0047, 2, 0.72, 0.0, 577, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.stop_next_obs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.stop_next_obs = not self.stop_next_obs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L64_C8", "label": "logout()", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L61_C4", "vector": [8, 2, 0.3019, 0.0047, 2, 0.72, 0.5, 525, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'servo_node: Stop after next obstacle flag set to %s' % str( self.stop_next_obs ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Return_L65_C8", "label": "return", "type": "return", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L61_C4", "vector": [13, 2, 0.3066, 0.0047, 2, 0.72, 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_99385:FunctionDef_L67_C4", "label": "servo_stop", "type": "function", "loc": [67, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L30_C0", "vector": [2, 1, 0.3231, 0.0189, 1, 0.64, 0.4, 88, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "servo_stop", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def servo_stop( self, msg = None ):\n # Note... should now be called \"toggle\"\n self.should_run = not self.should_run\n rospy.logout( 'servo_node: Toggled should_run to %s' % str( self.should_run ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L69_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L67_C4", "vector": [14, 2, 0.3255, 0.0047, 2, 0.15, 0.0, 736, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = not self.should_run"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L70_C8", "label": "logout()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L67_C4", "vector": [8, 2, 0.3302, 0.0047, 2, 0.15, 1.0, 525, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'servo_node: Toggled should_run to %s' % str( self.should_run ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L72_C4", "label": "servo_abort", "type": "function", "loc": [72, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L30_C0", "vector": [2, 1, 0.3467, 0.0189, 1, 0.64, 0.6, 813, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "servo_abort", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def servo_abort( self, msg = None ):\n # Note... should now be called \"toggle\"\n self.abort = True\n rospy.logout( 'servo_node: Aborting!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L74_C8", "label": "self.abort =", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L72_C4", "vector": [14, 2, 0.3491, 0.0047, 2, 0.38, 0.0, 665, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.abort", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.abort = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L75_C8", "label": "logout()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L72_C4", "vector": [8, 2, 0.3538, 0.0047, 2, 0.38, 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( 'servo_node: Aborting!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L77_C4", "label": "og_score_cb", "type": "function", "loc": [77, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L30_C0", "vector": [2, 1, 0.3703, 0.0189, 1, 0.64, 0.8, 236, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "og_score_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def og_score_cb( self, msg ):\n self.scores.append( msg.data )\n if len( self.scores ) > SCORE_BUFFER_LEN:\n self.scores.popleft()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L78_C8", "label": "append()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L77_C4", "vector": [8, 2, 0.3679, 0.0047, 2, 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": " self.scores.append( msg.data )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L79_C8", "label": "if", "type": "if", "loc": [79, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L77_C4", "vector": [4, 2, 0.375, 0.0094, 2, 0.73, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len( self.scores ) > SCORE_BUFFER_LEN:\n self.scores.popleft()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L80_C12", "label": "popleft()", "type": "expression", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L79_C8", "vector": [8, 3, 0.3774, 0.0047, 3, 0.98, 0.0, 285, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "popleft", "arg_names": [], "import_names": [], "rhs_call_name": "popleft", "annotation": ""}, "snippet": " self.scores.popleft()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "label": "run", "type": "function", "loc": [82, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L30_C0", "vector": [2, 1, 0.5755, 0.3821, 1, 0.64, 1.0, 679, 0, 2, 1, 0, 0, 0, 57], "semantic": {"name": "run", "arg_names": ["self", "request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run( self, request ):\n rospy.logout( 'servo_node: Called for tagid: \\'%s\\', continous: %d' % (request.data, request.cont) )\n\n # Move Antennas into Servo mode\n self.t_left.move_angle( 0.0, math.radians(30), blocking = False )\n self.t_right.move_angle( 0.0, math.radians(30), blocking = False )\n self.p_left.move_angle( math.radians(-40), math.radians(30), blocking = False )\n self.p_right.move_angle( math.radians(40), math.radians(30), blocking = True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L83_C8", "label": "logout()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "vector": [8, 2, 0.3915, 0.0047, 2, 0.29, 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( 'servo_node: Called for tagid: \\'%s\\', continous: %d' % (request.data, request.cont) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L86_C8", "label": "move_angle()", "type": "expression", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "vector": [8, 2, 0.4057, 0.0047, 2, 0.29, 0.0435, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.t_left.move_angle( 0.0, math.radians(30), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L87_C8", "label": "move_angle()", "type": "expression", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "vector": [8, 2, 0.4104, 0.0047, 2, 0.29, 0.087, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.t_right.move_angle( 0.0, math.radians(30), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L88_C8", "label": "move_angle()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "vector": [8, 2, 0.4151, 0.0047, 2, 0.29, 0.1304, 293, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.p_left.move_angle( math.radians(-40), math.radians(30), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L89_C8", "label": "move_angle()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "vector": [8, 2, 0.4198, 0.0047, 2, 0.29, 0.1739, 293, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.p_right.move_angle( math.radians(40), math.radians(30), blocking = True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L91_C8", "label": "while", "type": "while", "loc": [91, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "vector": [5, 2, 0.434, 0.0142, 2, 0.29, 0.2174, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.p_left.is_moving() or self.p_right.is_moving():\n #time.sleep( 0.01 ) # Not such a good idea when doing simulation.\n rospy.sleep( 0.05 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L93_C12", "label": "sleep()", "type": "expression", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L91_C8", "vector": [8, 3, 0.4387, 0.0047, 3, 0.76, 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.05 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L95_C8", "label": "self.stop_next_obs = bool()", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "vector": [14, 2, 0.4481, 0.0047, 2, 0.29, 0.2609, 577, 3, 1, 0, 0, 337, 10, 1], "semantic": {"name": "self.stop_next_obs", "arg_names": [], "import_names": [], "rhs_call_name": "bool", "annotation": ""}, "snippet": " self.stop_next_obs = bool( request.cont )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L96_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "vector": [14, 2, 0.4528, 0.0047, 2, 0.29, 0.3043, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L97_C8", "label": "self.abort =", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "vector": [14, 2, 0.4575, 0.0047, 2, 0.29, 0.3478, 665, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.abort", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.abort = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L100_C8", "label": "self.rp = rfid_poller()", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "vector": [14, 2, 0.4717, 0.0047, 2, 0.29, 0.3913, 429, 3, 1, 0, 0, 763, 10, 1], "semantic": {"name": "self.rp", "arg_names": [], "import_names": [], "rhs_call_name": "rfid_poller", "annotation": ""}, "snippet": " self.rp = rfid_poller( request.data )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L102_C8", "label": "logout()", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "vector": [8, 2, 0.4811, 0.0047, 2, 0.29, 0.4348, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('servo_node: Running')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L103_C8", "label": "rate = Rate()", "type": "assigned_variable", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "vector": [14, 2, 0.4858, 0.0047, 2, 0.29, 0.4783, 477, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "rate", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " rate = rospy.Rate( 15.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L104_C8", "label": "zed = deque()", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "vector": [14, 2, 0.4906, 0.0047, 2, 0.29, 0.5217, 246, 3, 1, 0, 0, 650, 10, 1], "semantic": {"name": "zed", "arg_names": [], "import_names": [], "rhs_call_name": "deque", "annotation": ""}, "snippet": " zed = deque([ 0.0 ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L105_C8", "label": "last_zed =", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "vector": [14, 2, 0.4953, 0.0047, 2, 0.29, 0.5652, 104, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "last_zed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " last_zed = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L107_C8", "label": "last_print = ctime()", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "vector": [14, 2, 0.5047, 0.0047, 2, 0.29, 0.6087, 457, 3, 0, 0, 0, 671, 10, 1], "semantic": {"name": "last_print", "arg_names": [], "import_names": [], "rhs_call_name": "ctime", "annotation": ""}, "snippet": " last_print = ctime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "label": "while", "type": "while", "loc": [109, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "vector": [5, 2, 0.6014, 0.1792, 2, 0.29, 0.6522, 0, 0, 0, 0, 0, 0, 0, 20], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.should_run and not rospy.is_shutdown():\n rate.sleep()\n left, right = self.rp.values\n\n #zed.append( 0.07 * (left - right)/5.0 )\n zed.append( 0.10 * (left - right)/5.0 )\n if len( zed ) > ANGLE_FILTER_LEN:\n zed.popleft()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L110_C12", "label": "sleep()", "type": "expression", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "vector": [8, 3, 0.5189, 0.0047, 3, 0.8, 0.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L111_C12", "label": "left, right =", "type": "assigned_variable", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "vector": [14, 3, 0.5236, 0.0047, 3, 0.8, 0.0769, 628, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "left, right", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " left, right = self.rp.values"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L114_C12", "label": "append()", "type": "expression", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "vector": [8, 3, 0.5377, 0.0047, 3, 0.8, 0.1538, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " zed.append( 0.10 * (left - right)/5.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L115_C12", "label": "if", "type": "if", "loc": [115, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "vector": [4, 3, 0.5448, 0.0094, 3, 0.8, 0.2308, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len( zed ) > ANGLE_FILTER_LEN:\n zed.popleft()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L116_C16", "label": "popleft()", "type": "expression", "loc": [116, 116], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L115_C12", "vector": [8, 4, 0.5472, 0.0047, 4, 0.04, 0.0, 285, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "popleft", "arg_names": [], "import_names": [], "rhs_call_name": "popleft", "annotation": ""}, "snippet": " zed.popleft()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L118_C12", "label": "target_zed = mean()", "type": "assigned_variable", "loc": [118, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "vector": [14, 3, 0.5566, 0.0047, 3, 0.8, 0.3077, 922, 3, 1, 0, 0, 856, 10, 1], "semantic": {"name": "target_zed", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " target_zed = np.mean( zed )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L119_C12", "label": "new_zed =", "type": "assigned_variable", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "vector": [14, 3, 0.5613, 0.0047, 3, 0.8, 0.3846, 111, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "new_zed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_zed = last_zed + np.clip( target_zed - last_zed, -1.0 * ANGLE_SLEW, ANGLE_SLEW )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L120_C12", "label": "last_zed =", "type": "assigned_variable", "loc": [120, 120], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "vector": [14, 3, 0.566, 0.0047, 3, 0.8, 0.4615, 104, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "last_zed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " last_zed = new_zed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L122_C12", "label": "check = Twist()", "type": "assigned_variable", "loc": [122, 122], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "vector": [14, 3, 0.5755, 0.0047, 3, 0.8, 0.5385, 803, 3, 0, 0, 0, 9, 10, 1], "semantic": {"name": "check", "arg_names": [], "import_names": [], "rhs_call_name": "Twist", "annotation": ""}, "snippet": " check = Twist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L123_C12", "label": "check.linear.x =", "type": "assigned_variable", "loc": [123, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "vector": [14, 3, 0.5802, 0.0047, 3, 0.8, 0.6154, 860, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "check.linear.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " check.linear.x = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L124_C12", "label": "check.angular.z =", "type": "assigned_variable", "loc": [124, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "vector": [14, 3, 0.5849, 0.0047, 3, 0.8, 0.6923, 781, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "check.angular.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " check.angular.z = new_zed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L125_C12", "label": "publish()", "type": "expression", "loc": [125, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "vector": [8, 3, 0.5896, 0.0047, 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.og_pub.publish( check )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L127_C12", "label": "move_command = Twist()", "type": "assigned_variable", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "vector": [14, 3, 0.5991, 0.0047, 3, 0.8, 0.8462, 175, 3, 0, 0, 0, 9, 10, 1], "semantic": {"name": "move_command", "arg_names": [], "import_names": [], "rhs_call_name": "Twist", "annotation": ""}, "snippet": " move_command = Twist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L129_C12", "label": "if", "type": "if", "loc": [129, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "vector": [4, 3, 0.6439, 0.0755, 3, 0.8, 0.9231, 0, 7, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.abort:\n self.should_run = False\n elif len( self.scores ) < SCORE_BUFFER_LEN:\n rospy.logout( 'servo_node: Score buffer filling: %d of %d' % (len(self.scores), SCORE_BUFFER_LEN) )\n elif sum([ i != -1 for i in self.scores]) < SCORE_BUFFER_MOVE:\n # Check for tag detected!\n if ctime() - last_print > 1.0:\n rospy.logout( 'servo_node: Obstacle detected' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L130_C16", "label": "self.should_run =", "type": "assigned_variable", "loc": [130, 130], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L129_C12", "vector": [14, 4, 0.6132, 0.0047, 4, 0.98, 0.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L131_C12", "label": "if", "type": "if", "loc": [131, 144], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L129_C12", "vector": [4, 4, 0.6486, 0.066, 4, 0.98, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif len( self.scores ) < SCORE_BUFFER_LEN:\n rospy.logout( 'servo_node: Score buffer filling: %d of %d' % (len(self.scores), SCORE_BUFFER_LEN) )\n elif sum([ i != -1 for i in self.scores]) < SCORE_BUFFER_MOVE:\n # Check for tag detected!\n if ctime() - last_print > 1.0:\n rospy.logout( 'servo_node: Obstacle detected' )\n last_print = ctime()\n if self.stop_next_obs: # Stop after next obstacle detected"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L132_C16", "label": "logout()", "type": "expression", "loc": [132, 132], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L131_C12", "vector": [8, 5, 0.6226, 0.0047, 5, 0.47, 0.0, 525, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'servo_node: Score buffer filling: %d of %d' % (len(self.scores), SCORE_BUFFER_LEN) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L133_C12", "label": "if", "type": "if", "loc": [133, 144], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L131_C12", "vector": [4, 5, 0.6533, 0.0566, 5, 0.47, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif sum([ i != -1 for i in self.scores]) < SCORE_BUFFER_MOVE:\n # Check for tag detected!\n if ctime() - last_print > 1.0:\n rospy.logout( 'servo_node: Obstacle detected' )\n last_print = ctime()\n if self.stop_next_obs: # Stop after next obstacle detected\n self.should_run = False\n elif len( zed ) < ANGLE_FILTER_LEN:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L135_C16", "label": "if", "type": "if", "loc": [135, 137], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L133_C12", "vector": [4, 6, 0.6415, 0.0142, 6, 0.98, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ctime() - last_print > 1.0:\n rospy.logout( 'servo_node: Obstacle detected' )\n last_print = ctime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L136_C20", "label": "logout()", "type": "expression", "loc": [136, 136], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L135_C16", "vector": [8, 7, 0.6415, 0.0047, 7, 0.04, 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( 'servo_node: Obstacle detected' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L137_C20", "label": "last_print = ctime()", "type": "assigned_variable", "loc": [137, 137], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L135_C16", "vector": [14, 7, 0.6462, 0.0047, 7, 0.04, 1.0, 457, 3, 0, 0, 0, 671, 10, 1], "semantic": {"name": "last_print", "arg_names": [], "import_names": [], "rhs_call_name": "ctime", "annotation": ""}, "snippet": " last_print = ctime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L138_C16", "label": "if", "type": "if", "loc": [138, 139], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L133_C12", "vector": [4, 6, 0.6533, 0.0094, 6, 0.98, 0.5, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.stop_next_obs: # Stop after next obstacle detected\n self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L139_C20", "label": "self.should_run =", "type": "assigned_variable", "loc": [139, 139], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L138_C16", "vector": [14, 7, 0.6557, 0.0047, 7, 0.51, 0.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L140_C12", "label": "if", "type": "if", "loc": [140, 144], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L133_C12", "vector": [4, 6, 0.6698, 0.0236, 6, 0.98, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif len( zed ) < ANGLE_FILTER_LEN:\n rospy.logout( 'servo_node: Angle buffer filling' )\n else:\n move_command.linear.x = check.linear.x\n move_command.angular.z = check.angular.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L141_C16", "label": "logout()", "type": "expression", "loc": [141, 141], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L140_C12", "vector": [8, 7, 0.6651, 0.0047, 7, 0.29, 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( 'servo_node: Angle buffer filling' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L143_C16", "label": "move_command.linear.x =", "type": "assigned_variable", "loc": [143, 143], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L140_C12", "vector": [14, 7, 0.6745, 0.0047, 7, 0.29, 0.5, 56, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "move_command.linear.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " move_command.linear.x = check.linear.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L144_C16", "label": "move_command.angular.z =", "type": "assigned_variable", "loc": [144, 144], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L140_C12", "vector": [14, 7, 0.6792, 0.0047, 7, 0.29, 1.0, 153, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "move_command.angular.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " move_command.angular.z = check.angular.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L146_C12", "label": "publish()", "type": "expression", "loc": [146, 146], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "vector": [8, 3, 0.6887, 0.0047, 3, 0.8, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.command_pub.publish( move_command )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L149_C8", "label": "publish()", "type": "expression", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "vector": [8, 2, 0.7028, 0.0047, 2, 0.29, 0.6957, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.command_pub.publish( Twist() ) # Halt the base"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L150_C8", "label": "stop()", "type": "expression", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "vector": [8, 2, 0.7075, 0.0047, 2, 0.29, 0.7391, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " self.rp.stop() # Stop the reader"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L153_C8", "label": "move_angle()", "type": "expression", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "vector": [8, 2, 0.7217, 0.0047, 2, 0.29, 0.7826, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.t_left.move_angle( 0.0, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L154_C8", "label": "move_angle()", "type": "expression", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "vector": [8, 2, 0.7264, 0.0047, 2, 0.29, 0.8261, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.t_right.move_angle( 0.0, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L155_C8", "label": "move_angle()", "type": "expression", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "vector": [8, 2, 0.7311, 0.0047, 2, 0.29, 0.8696, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.p_left.move_angle( -1.350, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L156_C8", "label": "if", "type": "if", "loc": [156, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "vector": [4, 2, 0.7429, 0.0189, 2, 0.29, 0.913, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (os.environ.has_key('ROBOT') and os.environ['ROBOT'] == 'sim'):\n self.p_right.move_angle( 1.350, math.radians(10), blocking = False )\n else:\n self.p_right.move_angle( 1.350, math.radians(10), blocking = True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L157_C12", "label": "move_angle()", "type": "expression", "loc": [157, 157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L156_C8", "vector": [8, 3, 0.7406, 0.0047, 3, 0.32, 0.0, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.p_right.move_angle( 1.350, math.radians(10), blocking = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L159_C12", "label": "move_angle()", "type": "expression", "loc": [159, 159], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L156_C8", "vector": [8, 3, 0.75, 0.0047, 3, 0.32, 1.0, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.p_right.move_angle( 1.350, math.radians(10), blocking = True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L161_C8", "label": "logout()", "type": "expression", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "vector": [8, 2, 0.7594, 0.0047, 2, 0.29, 0.9565, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('servo_node: Returning')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Return_L162_C8", "label": "return", "type": "return", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "vector": [13, 2, 0.7642, 0.0047, 2, 0.29, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return StringInt32_Int32Response( int( True ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L165_C0", "label": "ServoNodeClient", "type": "class", "loc": [165, 174], "level": 0, "parent": null, "vector": [3, 0, 0.7995, 0.0472, 0, 0.66, 0.913, 563, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "ServoNodeClient", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ServoNodeClient():\n def __init__( self, service_name = '/rfid_servo/servo' ):\n rospy.logout( 'servo_node_client: Waiting for service: \\'%s\\'' % service_name )\n rospy.wait_for_service( service_name )\n rospy.logout( 'servo_node_client: Service ready.' )\n \n self._servo_service = rospy.ServiceProxy( service_name, StringInt32_Int32 )\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L166_C4", "label": "__init__", "type": "function", "loc": [166, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L165_C0", "vector": [2, 1, 0.7948, 0.0283, 1, 0.96, 0.0, 555, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "service_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, service_name = '/rfid_servo/servo' ):\n rospy.logout( 'servo_node_client: Waiting for service: \\'%s\\'' % service_name )\n rospy.wait_for_service( service_name )\n rospy.logout( 'servo_node_client: Service ready.' )\n \n self._servo_service = rospy.ServiceProxy( service_name, StringInt32_Int32 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L167_C8", "label": "logout()", "type": "expression", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L166_C4", "vector": [8, 2, 0.7877, 0.0047, 2, 0.41, 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( 'servo_node_client: Waiting for service: \\'%s\\'' % service_name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L168_C8", "label": "wait_for_service()", "type": "expression", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L166_C4", "vector": [8, 2, 0.7925, 0.0047, 2, 0.41, 0.3333, 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( service_name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L169_C8", "label": "logout()", "type": "expression", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L166_C4", "vector": [8, 2, 0.7972, 0.0047, 2, 0.41, 0.6667, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'servo_node_client: Service ready.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L171_C8", "label": "self._servo_service = ServiceProxy()", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L166_C4", "vector": [14, 2, 0.8066, 0.0047, 2, 0.41, 1.0, 1, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._servo_service", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._servo_service = rospy.ServiceProxy( service_name, StringInt32_Int32 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L173_C4", "label": "servo", "type": "function", "loc": [173, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L165_C0", "vector": [2, 1, 0.8184, 0.0094, 1, 0.96, 1.0, 604, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "servo", "arg_names": ["self", "tagid", "continuous_operation"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def servo( self, tagid, continuous_operation = True ):\n return self._servo_service( tagid, int( continuous_operation ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Return_L174_C8", "label": "return", "type": "return", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L173_C4", "vector": [13, 2, 0.8208, 0.0047, 2, 0.66, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._servo_service( tagid, int( continuous_operation ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L177_C0", "label": "rfid_poller", "type": "class", "loc": [177, 202], "level": 0, "parent": null, "vector": [3, 0, 0.8939, 0.1226, 0, 0.66, 0.9565, 763, 0, 3, 0, 0, 134, 0, 15], "semantic": {"name": "rfid_poller", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class rfid_poller( Thread ):\n def __init__( self, tagid ):\n Thread.__init__( self )\n self.reader = rmc.ROS_M5e_Client('ears')\n self.reader.track_mode( tagid )\n self.should_run = True\n self.values = [75.0, 75.0]\n self.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L178_C4", "label": "__init__", "type": "function", "loc": [178, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L177_C0", "vector": [2, 1, 0.8538, 0.033, 1, 0.38, 0.0, 555, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "tagid"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, tagid ):\n Thread.__init__( self )\n self.reader = rmc.ROS_M5e_Client('ears')\n self.reader.track_mode( tagid )\n self.should_run = True\n self.values = [75.0, 75.0]\n self.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L179_C8", "label": "__init__()", "type": "expression", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L178_C4", "vector": [8, 2, 0.8443, 0.0047, 2, 0.97, 0.0, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Thread.__init__( self )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L180_C8", "label": "self.reader = ROS_M5e_Client()", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L178_C4", "vector": [14, 2, 0.8491, 0.0047, 2, 0.97, 0.2, 536, 3, 1, 0, 0, 479, 10, 1], "semantic": {"name": "self.reader", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_M5e_Client", "annotation": ""}, "snippet": " self.reader = rmc.ROS_M5e_Client('ears')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L181_C8", "label": "track_mode()", "type": "expression", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L178_C4", "vector": [8, 2, 0.8538, 0.0047, 2, 0.97, 0.4, 884, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "track_mode", "arg_names": [], "import_names": [], "rhs_call_name": "track_mode", "annotation": ""}, "snippet": " self.reader.track_mode( tagid )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L182_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L178_C4", "vector": [14, 2, 0.8585, 0.0047, 2, 0.97, 0.6, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L183_C8", "label": "self.values =", "type": "assigned_variable", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L178_C4", "vector": [14, 2, 0.8632, 0.0047, 2, 0.97, 0.8, 397, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.values", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.values = [75.0, 75.0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L184_C8", "label": "start()", "type": "expression", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L178_C4", "vector": [8, 2, 0.8679, 0.0047, 2, 0.97, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L186_C4", "label": "stop", "type": "function", "loc": [186, 190], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L177_C0", "vector": [2, 1, 0.8868, 0.0236, 1, 0.38, 0.5, 343, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "stop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop( self ):\n self.should_run = False\n self.join(3)\n if (self.isAlive()):\n raise RuntimeError(\"rfid_poller: Unable to stop thread\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L187_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L186_C4", "vector": [14, 2, 0.8821, 0.0047, 2, 0.36, 0.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L188_C8", "label": "join()", "type": "expression", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L186_C4", "vector": [8, 2, 0.8868, 0.0047, 2, 0.36, 0.5, 933, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.join(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L189_C8", "label": "if", "type": "if", "loc": [189, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L186_C4", "vector": [4, 2, 0.8939, 0.0094, 2, 0.36, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.isAlive()):\n raise RuntimeError(\"rfid_poller: Unable to stop thread\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L192_C4", "label": "run", "type": "function", "loc": [192, 202], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L177_C0", "vector": [2, 1, 0.9292, 0.0519, 1, 0.38, 1.0, 679, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run( self ):\n rospy.logout( 'rfid_poller: Starting' )\n while self.should_run and not rospy.is_shutdown():\n left = np.clip( self.reader.read('EleLeftEar')[-1], 75.0, 110.0 )\n right = np.clip( self.reader.read('EleRightEar')[-1], 75.0, 110.0 )\n self.values = [left, right]\n try: # Shut it down to conserve power. Something of a race condition (exception)\n self.reader.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L193_C8", "label": "logout()", "type": "expression", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L192_C4", "vector": [8, 2, 0.9104, 0.0047, 2, 0.1, 0.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'rfid_poller: Starting' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L194_C8", "label": "while", "type": "while", "loc": [194, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L192_C4", "vector": [5, 2, 0.9222, 0.0189, 2, 0.1, 0.3333, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.should_run and not rospy.is_shutdown():\n left = np.clip( self.reader.read('EleLeftEar')[-1], 75.0, 110.0 )\n right = np.clip( self.reader.read('EleRightEar')[-1], 75.0, 110.0 )\n self.values = [left, right]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L195_C12", "label": "left = clip()", "type": "assigned_variable", "loc": [195, 195], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L194_C8", "vector": [14, 3, 0.9198, 0.0047, 3, 0.19, 0.0, 605, 3, 3, 0, 0, 689, 10, 2], "semantic": {"name": "left", "arg_names": [], "import_names": [], "rhs_call_name": "clip", "annotation": ""}, "snippet": " left = np.clip( self.reader.read('EleLeftEar')[-1], 75.0, 110.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L196_C12", "label": "right = clip()", "type": "assigned_variable", "loc": [196, 196], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L194_C8", "vector": [14, 3, 0.9245, 0.0047, 3, 0.19, 0.5, 724, 3, 3, 0, 0, 689, 10, 2], "semantic": {"name": "right", "arg_names": [], "import_names": [], "rhs_call_name": "clip", "annotation": ""}, "snippet": " right = np.clip( self.reader.read('EleRightEar')[-1], 75.0, 110.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L197_C12", "label": "self.values =", "type": "assigned_variable", "loc": [197, 197], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L194_C8", "vector": [14, 3, 0.9292, 0.0047, 3, 0.19, 1.0, 397, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.values", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.values = [left, right]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Try_L198_C8", "label": "try", "type": "try", "loc": [198, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L192_C4", "vector": [7, 2, 0.941, 0.0189, 2, 0.1, 0.6667, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try: # Shut it down to conserve power. Something of a race condition (exception)\n self.reader.stop()\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L199_C12", "label": "stop()", "type": "expression", "loc": [199, 199], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:Try_L198_C8", "vector": [8, 3, 0.9387, 0.0047, 3, 0.9, 0.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " self.reader.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L202_C8", "label": "logout()", "type": "expression", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L192_C4", "vector": [8, 2, 0.9528, 0.0047, 2, 0.1, 1.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'rfid_poller: Exiting' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L209_C0", "label": "if", "type": "if", "loc": [209, 211], "level": 0, "parent": null, "vector": [4, 0, 0.9906, 0.0142, 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 sn = ServoNode()\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L210_C4", "label": "sn = ServoNode()", "type": "assigned_variable", "loc": [210, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L209_C0", "vector": [14, 1, 0.9906, 0.0047, 1, 0.98, 0.0, 981, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "sn", "arg_names": [], "import_names": [], "rhs_call_name": "ServoNode", "annotation": ""}, "snippet": " sn = ServoNode()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L211_C4", "label": "spin()", "type": "expression", "loc": [211, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L209_C0", "vector": [8, 1, 0.9953, 0.0047, 1, 0.98, 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_99385:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Return_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Try_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:Try_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L34_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Return_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L115_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L115_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L116_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L118_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L119_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L120_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L123_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L124_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L129_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L129_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L130_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L129_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L131_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L132_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L133_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L133_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L135_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L135_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L136_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L135_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L137_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L133_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L138_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L138_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L139_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L133_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L140_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L141_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L140_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L143_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L140_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L144_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L146_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L156_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L157_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L156_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L159_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Return_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L165_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L166_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L166_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L166_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L166_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L165_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Return_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L177_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L177_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L186_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:ClassDef_L177_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L192_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L194_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L195_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L194_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L196_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:While_L194_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L197_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Try_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:Try_L198_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L199_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L209_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Assign_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99385:If_L209_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99385:Expr_L211_C4"}]
__all__ = [ 'servo' ]
ajibawa-2023/Python-Code-Large/train/row_99386
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_99386: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 'servo'\n ]"}]
[]
#! /usr/bin/python import roslib roslib.load_manifest('rfid_demos') roslib.load_manifest('rfid_behaviors') roslib.load_manifest('pr2_grasp_behaviors') roslib.load_manifest('hrl_trajectory_playback') roslib.load_manifest('pr2_controllers_msgs') roslib.load_manifest('robotis') import rospy import smach import actionlib from smach_ros import SimpleActionState, ServiceState, IntrospectionServer from geometry_msgs.msg import PoseStamped, PoseWithCovarianceStamped from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal from rfid_behaviors.srv import NextBestVantage from rfid_behaviors.srv import HandoffSrv, HandoffSrvRequest from rfid_behaviors.srv import FloatFloat_Int32Request as RotateBackupSrvRequest from rfid_behaviors.srv import FloatFloat_Int32 as RotateBackupSrv from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal from pr2_controllers_msgs.msg import SingleJointPositionAction, SingleJointPositionGoal from robotis.srv import MoveAng, MoveAngRequest from hrl_trajectory_playback.srv import TrajPlaybackSrv, TrajPlaybackSrvRequest import sm_rfid_delivery #from sm_next_best_vantage import BestVantage # import sm_fetch # import sm_rfid_explore class PrintStr(smach.State): def __init__(self, ins = 'Hand me an object [ENTER]'): smach.State.__init__(self, outcomes=['succeeded', 'aborted', 'preempted']) self.ins = ins def execute(self, userdata): rospy.logout( 'Executing PrintStr: %s' % self.ins ) raw_input() return 'succeeded' class InitLocalization(smach.State): def __init__(self, init_pose = None): smach.State.__init__(self, outcomes=['succeeded', 'aborted']) self.init_pose = init_pose def execute(self, userdata): rospy.logout( 'Initializing Localization' ) pub = rospy.Publisher( '/initialpose', PoseWithCovarianceStamped ) rospy.sleep( 0.5 ) if not self.init_pose: msg = PoseWithCovarianceStamped() msg.header.frame_id = '\map' msg.pose.pose.position.x = -1.565 msg.pose.pose.position.y = 0.807 msg.pose.pose.position.z = 0.000 msg.pose.pose.orientation.w = 1.000 msg.pose.covariance = [0.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.068, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] print 'RUNNING: ', msg raw_input( 'Drive the robot to the initial location (in kitchen by default). Hit [ENTER] when done.' ) msg.header.stamp = rospy.Time(0) pub.publish( msg ) # for i in xrange( 5 ): # msg.header.stamp = rospy.Time(0) # pub.publish( msg ) # rospy.sleep( 0.05 ) return 'succeeded' def init_local_test(): sm = smach.StateMachine( outcomes=['succeeded','aborted'] ) with sm: smach.StateMachine.add( 'INIT_LOCALIZATION', InitLocalization(), transitions = { 'succeeded':'succeeded' }) return sm def cousins_demo(): # Create a SMACH state machine sm = smach.StateMachine(outcomes=['succeeded','aborted','preempted'], input_keys = [ 'person_id' ]) with sm: smach.StateMachine.add( 'ROTATE_BEFORE_MOVE', ServiceState( '/rotate_backup', RotateBackupSrv, request = RotateBackupSrvRequest( 3.14, 0.0)), # Full 180-deg spin. transitions = { 'succeeded':'MOVE_SHOW_OFF_POSE' }) gd = MoveBaseGoal() gd.target_pose.header.frame_id = '/map' gd.target_pose.header.stamp = rospy.Time(0) gd.target_pose.pose.position.x = 2.956 gd.target_pose.pose.position.y = 3.047 gd.target_pose.pose.orientation.z = 0.349 gd.target_pose.pose.orientation.w = 0.937 smach.StateMachine.add( 'MOVE_SHOW_OFF_POSE', SimpleActionState( '/move_base', MoveBaseAction, goal = gd ), # transitions = {'succeeded':'READY_RETURN_HALLWAY'}) transitions = {'succeeded':'succeeded'}) # smach.StateMachine.add( # 'READY_RETURN_HALLWAY', # PrintStr('Ready to return to hallway [ENTER]'), # transitions = { 'succeeded':'MOVE_HALLWAY' }) # go = MoveBaseGoal() # go.target_pose.header.frame_id = '/map' # go.target_pose.header.stamp = rospy.Time(0) # go.target_pose.pose.position.x = -5.07 # go.target_pose.pose.position.y = 8.725 # go.target_pose.pose.orientation.z = 0.926 # go.target_pose.pose.orientation.w = 0.377 # smach.StateMachine.add( # 'MOVE_HALLWAY', # SimpleActionState( '/move_base', # MoveBaseAction, # goal = go ), # Back down the hallway # transitions = {'succeeded':'succeeded'}) return sm if False: rospy.init_node('localization_trial') sm = smach.StateMachine( outcomes=['succeeded','aborted','preempted'] ) with sm: # Just a precation tgoal = SingleJointPositionGoal() tgoal.position = 0.040 # all the way up is 0.200 tgoal.min_duration = rospy.Duration( 2.0 ) tgoal.max_velocity = 1.0 smach.StateMachine.add( 'TORSO_SETUP', SimpleActionState( 'torso_controller/position_joint_action', SingleJointPositionAction, goal = tgoal), transitions = { 'succeeded': 'succeeded' }) sm.execute() if __name__ == '__main__': # if False: rospy.init_node('smach_aware_home') sm = cousins_demo() sis = IntrospectionServer('sm_aware_home', sm, '/SM_AWARE_HOME') sis.start() rospy.logout( 'READY TO RUN AWARE_HOME DEMO' ) sm.userdata.person_id = 'person ' # sm.userdata.explore_radius = 1.5 # sm.userdata.explore_rfid_reads = [] outcome = sm.execute() # rospy.spin() sis.stop()
ajibawa-2023/Python-Code-Large/train/row_99387
85
192
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0104, 0.0052, 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_99387:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0156, 0.0052, 0, 0.66, 0.037, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('rfid_demos')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0208, 0.0052, 0, 0.66, 0.0741, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('rfid_behaviors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.026, 0.0052, 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": "roslib.load_manifest('pr2_grasp_behaviors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0312, 0.0052, 0, 0.66, 0.1481, 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_trajectory_playback')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0365, 0.0052, 0, 0.66, 0.1852, 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_controllers_msgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0417, 0.0052, 0, 0.66, 0.2222, 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('robotis')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Import_L9_C0", "label": "rospy import rospy", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0469, 0.0052, 0, 0.66, 0.2593, 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_99387:Import_L11_C0", "label": "smach import smach", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0573, 0.0052, 0, 0.66, 0.2963, 345, 0, 1, 0, 0, 345, 0, 0], "semantic": {"name": "smach", "arg_names": [], "import_names": ["smach"], "rhs_call_name": "", "annotation": ""}, "snippet": "import smach"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Import_L12_C0", "label": "actionlib import actionlib", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0052, 0, 0.66, 0.3333, 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_99387:ImportFrom_L14_C0", "label": "from smach_ros import SimpleActionState, ServiceState, IntrospectionServer", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0729, 0.0052, 0, 0.66, 0.3704, 716, 0, 3, 0, 0, 716, 0, 0], "semantic": {"name": "smach_ros", "arg_names": [], "import_names": ["SimpleActionState", "ServiceState", "IntrospectionServer"], "rhs_call_name": "", "annotation": ""}, "snippet": "from smach_ros import SimpleActionState, ServiceState, IntrospectionServer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:ImportFrom_L15_C0", "label": "from geometry_msgs.msg import PoseStamped, PoseWithCovarianceStamped", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0781, 0.0052, 0, 0.66, 0.4074, 951, 0, 2, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["PoseStamped", "PoseWithCovarianceStamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import PoseStamped, PoseWithCovarianceStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:ImportFrom_L16_C0", "label": "from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0052, 0, 0.66, 0.4444, 440, 0, 2, 0, 0, 440, 0, 0], "semantic": {"name": "move_base_msgs.msg", "arg_names": [], "import_names": ["MoveBaseAction", "MoveBaseGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:ImportFrom_L17_C0", "label": "from rfid_behaviors.srv import NextBestVantage", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0885, 0.0052, 0, 0.66, 0.4815, 647, 0, 1, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["NextBestVantage"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import NextBestVantage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:ImportFrom_L18_C0", "label": "from rfid_behaviors.srv import HandoffSrv, HandoffSrvRequest", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0938, 0.0052, 0, 0.66, 0.5185, 647, 0, 2, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["HandoffSrv", "HandoffSrvRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import HandoffSrv, HandoffSrvRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:ImportFrom_L19_C0", "label": "from rfid_behaviors.srv import RotateBackupSrvRequest", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.099, 0.0052, 0, 0.66, 0.5556, 647, 0, 1, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["RotateBackupSrvRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import FloatFloat_Int32Request as RotateBackupSrvRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:ImportFrom_L20_C0", "label": "from rfid_behaviors.srv import RotateBackupSrv", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.1042, 0.0052, 0, 0.66, 0.5926, 647, 0, 1, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["RotateBackupSrv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import FloatFloat_Int32 as RotateBackupSrv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:ImportFrom_L21_C0", "label": "from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.1094, 0.0052, 0, 0.66, 0.6296, 457, 0, 2, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["PointHeadAction", "PointHeadGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:ImportFrom_L22_C0", "label": "from pr2_controllers_msgs.msg import SingleJointPositionAction, SingleJointPositionGoal", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.1146, 0.0052, 0, 0.66, 0.6667, 457, 0, 2, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["SingleJointPositionAction", "SingleJointPositionGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import SingleJointPositionAction, SingleJointPositionGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:ImportFrom_L23_C0", "label": "from robotis.srv import MoveAng, MoveAngRequest", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.1198, 0.0052, 0, 0.66, 0.7037, 727, 0, 2, 0, 0, 727, 0, 0], "semantic": {"name": "robotis.srv", "arg_names": [], "import_names": ["MoveAng", "MoveAngRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robotis.srv import MoveAng, MoveAngRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:ImportFrom_L24_C0", "label": "from hrl_trajectory_playback.srv import TrajPlaybackSrv, TrajPlaybackSrvRequest", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.0052, 0, 0.66, 0.7407, 12, 0, 2, 0, 0, 12, 0, 0], "semantic": {"name": "hrl_trajectory_playback.srv", "arg_names": [], "import_names": ["TrajPlaybackSrv", "TrajPlaybackSrvRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_trajectory_playback.srv import TrajPlaybackSrv, TrajPlaybackSrvRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Import_L26_C0", "label": "sm_rfid_delivery import sm_rfid_delivery", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.1354, 0.0052, 0, 0.66, 0.7778, 55, 0, 1, 0, 0, 55, 0, 0], "semantic": {"name": "sm_rfid_delivery", "arg_names": [], "import_names": ["sm_rfid_delivery"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sm_rfid_delivery"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:ClassDef_L31_C0", "label": "PrintStr", "type": "class", "loc": [31, 39], "level": 0, "parent": null, "vector": [3, 0, 0.1823, 0.0469, 0, 0.66, 0.8148, 476, 0, 2, 0, 0, 892, 0, 3], "semantic": {"name": "PrintStr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PrintStr(smach.State):\n def __init__(self, ins = 'Hand me an object [ENTER]'):\n smach.State.__init__(self, outcomes=['succeeded', 'aborted', 'preempted'])\n self.ins = ins\n\n def execute(self, userdata):\n rospy.logout( 'Executing PrintStr: %s' % self.ins )\n raw_input()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L32_C4", "label": "__init__", "type": "function", "loc": [32, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:ClassDef_L31_C0", "vector": [2, 1, 0.1719, 0.0156, 1, 0.26, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "ins"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, ins = 'Hand me an object [ENTER]'):\n smach.State.__init__(self, outcomes=['succeeded', 'aborted', 'preempted'])\n self.ins = ins"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L33_C8", "label": "__init__()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L32_C4", "vector": [8, 2, 0.1719, 0.0052, 2, 0.79, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " smach.State.__init__(self, outcomes=['succeeded', 'aborted', 'preempted'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L34_C8", "label": "self.ins =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L32_C4", "vector": [14, 2, 0.1771, 0.0052, 2, 0.79, 1.0, 485, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.ins", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ins = ins"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L36_C4", "label": "execute", "type": "function", "loc": [36, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:ClassDef_L31_C0", "vector": [2, 1, 0.1953, 0.0208, 1, 0.26, 1.0, 569, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "execute", "arg_names": ["self", "userdata"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute(self, userdata):\n rospy.logout( 'Executing PrintStr: %s' % self.ins )\n raw_input()\n return 'succeeded'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L37_C8", "label": "logout()", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L36_C4", "vector": [8, 2, 0.1927, 0.0052, 2, 0.19, 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( 'Executing PrintStr: %s' % self.ins )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L38_C8", "label": "raw_input()", "type": "expression", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L36_C4", "vector": [8, 2, 0.1979, 0.0052, 2, 0.19, 0.5, 821, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Return_L39_C8", "label": "return", "type": "return", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L36_C4", "vector": [13, 2, 0.2031, 0.0052, 2, 0.19, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'succeeded'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:ClassDef_L41_C0", "label": "InitLocalization", "type": "class", "loc": [41, 83], "level": 0, "parent": null, "vector": [3, 0, 0.3229, 0.224, 0, 0.66, 0.8519, 665, 0, 2, 0, 0, 892, 0, 9], "semantic": {"name": "InitLocalization", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class InitLocalization(smach.State):\n def __init__(self, init_pose = None):\n smach.State.__init__(self, outcomes=['succeeded', 'aborted'])\n self.init_pose = init_pose\n \n def execute(self, userdata):\n rospy.logout( 'Initializing Localization' )\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L42_C4", "label": "__init__", "type": "function", "loc": [42, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:ClassDef_L41_C0", "vector": [2, 1, 0.224, 0.0156, 1, 0.71, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "init_pose"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, init_pose = None):\n smach.State.__init__(self, outcomes=['succeeded', 'aborted'])\n self.init_pose = init_pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L43_C8", "label": "__init__()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L42_C4", "vector": [8, 2, 0.224, 0.0052, 2, 0.86, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " smach.State.__init__(self, outcomes=['succeeded', 'aborted'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L44_C8", "label": "self.init_pose =", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L42_C4", "vector": [14, 2, 0.2292, 0.0052, 2, 0.86, 1.0, 255, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.init_pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.init_pose = init_pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L46_C4", "label": "execute", "type": "function", "loc": [46, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:ClassDef_L41_C0", "vector": [2, 1, 0.3359, 0.1979, 1, 0.71, 1.0, 569, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "execute", "arg_names": ["self", "userdata"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute(self, userdata):\n rospy.logout( 'Initializing Localization' )\n\n pub = rospy.Publisher( '/initialpose', PoseWithCovarianceStamped )\n rospy.sleep( 0.5 )\n\n if not self.init_pose:\n msg = PoseWithCovarianceStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L47_C8", "label": "logout()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L46_C4", "vector": [8, 2, 0.2448, 0.0052, 2, 0.13, 0.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'Initializing Localization' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L49_C8", "label": "pub = Publisher()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L46_C4", "vector": [14, 2, 0.2552, 0.0052, 2, 0.13, 0.1429, 41, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " pub = rospy.Publisher( '/initialpose', PoseWithCovarianceStamped )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L50_C8", "label": "sleep()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L46_C4", "vector": [8, 2, 0.2604, 0.0052, 2, 0.13, 0.2857, 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_99387:If_L52_C8", "label": "if", "type": "if", "loc": [52, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L46_C4", "vector": [4, 2, 0.3229, 0.1094, 2, 0.13, 0.4286, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.init_pose:\n msg = PoseWithCovarianceStamped()\n msg.header.frame_id = '\\map'\n\n msg.pose.pose.position.x = -1.565\n msg.pose.pose.position.y = 0.807\n msg.pose.pose.position.z = 0.000\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L53_C12", "label": "msg = PoseWithCovarianceStamped()", "type": "assigned_variable", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L52_C8", "vector": [14, 3, 0.276, 0.0052, 3, 0.98, 0.0, 712, 3, 0, 0, 0, 146, 10, 1], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "PoseWithCovarianceStamped", "annotation": ""}, "snippet": " msg = PoseWithCovarianceStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L54_C12", "label": "msg.header.frame_id =", "type": "assigned_variable", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L52_C8", "vector": [14, 3, 0.2812, 0.0052, 3, 0.98, 0.1429, 11, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "msg.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg.header.frame_id = '\\map'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L56_C12", "label": "msg.pose.pose.position.x =", "type": "assigned_variable", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L52_C8", "vector": [14, 3, 0.2917, 0.0052, 3, 0.98, 0.2857, 19, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "msg.pose.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg.pose.pose.position.x = -1.565"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L57_C12", "label": "msg.pose.pose.position.y =", "type": "assigned_variable", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L52_C8", "vector": [14, 3, 0.2969, 0.0052, 3, 0.98, 0.4286, 775, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "msg.pose.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg.pose.pose.position.y = 0.807"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L58_C12", "label": "msg.pose.pose.position.z =", "type": "assigned_variable", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L52_C8", "vector": [14, 3, 0.3021, 0.0052, 3, 0.98, 0.5714, 104, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "msg.pose.pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg.pose.pose.position.z = 0.000"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L60_C12", "label": "msg.pose.pose.orientation.w =", "type": "assigned_variable", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L52_C8", "vector": [14, 3, 0.3125, 0.0052, 3, 0.98, 0.7143, 444, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "msg.pose.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg.pose.pose.orientation.w = 1.000"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L62_C12", "label": "msg.pose.covariance =", "type": "assigned_variable", "loc": [62, 70], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L52_C8", "vector": [14, 3, 0.3438, 0.0469, 3, 0.98, 0.8571, 411, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "msg.pose.covariance", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg.pose.covariance = [0.25, 0.0, 0.0, 0.0,\n 0.0, 0.0, 0.0, 0.25,\n 0.0, 0.0, 0.0, 0.0,\n 0.0, 0.0, 0.0, 0.0,\n 0.0, 0.0, 0.0, 0.0,\n 0.0, 0.068, 0.0, 0.0,\n 0.0, 0.0, 0.0, 0.0,\n 0.0, 0.0, 0.0, 0.0,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L72_C12", "label": "print()", "type": "expression", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L52_C8", "vector": [8, 3, 0.375, 0.0052, 3, 0.98, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('RUNNING: ', msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L74_C8", "label": "raw_input()", "type": "expression", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L46_C4", "vector": [8, 2, 0.3854, 0.0052, 2, 0.13, 0.5714, 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( 'Drive the robot to the initial location (in kitchen by default). Hit [ENTER] when done.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L75_C8", "label": "msg.header.stamp = Time()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L46_C4", "vector": [14, 2, 0.3906, 0.0052, 2, 0.13, 0.7143, 90, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "msg.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " msg.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L76_C8", "label": "publish()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L46_C4", "vector": [8, 2, 0.3958, 0.0052, 2, 0.13, 0.8571, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " pub.publish( msg )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Return_L83_C8", "label": "return", "type": "return", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L46_C4", "vector": [13, 2, 0.4323, 0.0052, 2, 0.13, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'succeeded'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L86_C0", "label": "init_local_test", "type": "function", "loc": [86, 93], "level": 0, "parent": null, "vector": [2, 0, 0.4661, 0.0417, 0, 0.66, 0.8889, 817, 0, 0, 1, 0, 0, 0, 3], "semantic": {"name": "init_local_test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def init_local_test():\n sm = smach.StateMachine( outcomes=['succeeded','aborted'] )\n with sm:\n smach.StateMachine.add(\n 'INIT_LOCALIZATION',\n InitLocalization(),\n transitions = { 'succeeded':'succeeded' })\n return sm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L87_C4", "label": "sm = StateMachine()", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L86_C0", "vector": [14, 1, 0.4531, 0.0052, 1, 0.18, 0.0, 21, 3, 1, 0, 0, 174, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "StateMachine", "annotation": ""}, "snippet": " sm = smach.StateMachine( outcomes=['succeeded','aborted'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L89_C8", "label": "add()", "type": "expression", "loc": [89, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L86_C0", "vector": [8, 1, 0.4714, 0.0208, 1, 0.18, 0.0, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'INIT_LOCALIZATION',\n InitLocalization(),\n transitions = { 'succeeded':'succeeded' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Return_L93_C4", "label": "return", "type": "return", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L86_C0", "vector": [13, 1, 0.4844, 0.0052, 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 sm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L96_C0", "label": "cousins_demo", "type": "function", "loc": [96, 150], "level": 0, "parent": null, "vector": [2, 0, 0.6406, 0.2865, 0, 0.66, 0.9259, 546, 0, 0, 1, 0, 0, 0, 8], "semantic": {"name": "cousins_demo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def cousins_demo():\n # Create a SMACH state machine\n sm = smach.StateMachine(outcomes=['succeeded','aborted','preempted'],\n input_keys = [ 'person_id' ])\n\n with sm:\n\n smach.StateMachine.add("}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L98_C4", "label": "sm = StateMachine()", "type": "assigned_variable", "loc": [98, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L96_C0", "vector": [14, 1, 0.513, 0.0104, 1, 0.87, 0.0, 21, 3, 2, 0, 0, 174, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "StateMachine", "annotation": ""}, "snippet": " sm = smach.StateMachine(outcomes=['succeeded','aborted','preempted'],\n input_keys = [ 'person_id' ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L103_C8", "label": "add()", "type": "expression", "loc": [103, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L96_C0", "vector": [8, 1, 0.5495, 0.0312, 1, 0.87, 0.0, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'ROTATE_BEFORE_MOVE',\n ServiceState( '/rotate_backup',\n RotateBackupSrv,\n request = RotateBackupSrvRequest( 3.14, 0.0)), # Full 180-deg spin.\n transitions = { 'succeeded':'MOVE_SHOW_OFF_POSE' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L110_C8", "label": "gd = MoveBaseGoal()", "type": "assigned_variable", "loc": [110, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L96_C0", "vector": [14, 1, 0.5729, 0.0052, 1, 0.87, 0.125, 558, 3, 0, 0, 0, 968, 10, 1], "semantic": {"name": "gd", "arg_names": [], "import_names": [], "rhs_call_name": "MoveBaseGoal", "annotation": ""}, "snippet": " gd = MoveBaseGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L111_C8", "label": "gd.target_pose.header.frame_id =", "type": "assigned_variable", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L96_C0", "vector": [14, 1, 0.5781, 0.0052, 1, 0.87, 0.25, 81, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "gd.target_pose.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " gd.target_pose.header.frame_id = '/map'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L112_C8", "label": "gd.target_pose.header.stamp = Time()", "type": "assigned_variable", "loc": [112, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L96_C0", "vector": [14, 1, 0.5833, 0.0052, 1, 0.87, 0.375, 476, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "gd.target_pose.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " gd.target_pose.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L113_C8", "label": "gd.target_pose.pose.position.x =", "type": "assigned_variable", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L96_C0", "vector": [14, 1, 0.5885, 0.0052, 1, 0.87, 0.5, 962, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "gd.target_pose.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " gd.target_pose.pose.position.x = 2.956"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L114_C8", "label": "gd.target_pose.pose.position.y =", "type": "assigned_variable", "loc": [114, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L96_C0", "vector": [14, 1, 0.5938, 0.0052, 1, 0.87, 0.625, 610, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "gd.target_pose.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " gd.target_pose.pose.position.y = 3.047"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L115_C8", "label": "gd.target_pose.pose.orientation.z =", "type": "assigned_variable", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L96_C0", "vector": [14, 1, 0.599, 0.0052, 1, 0.87, 0.75, 345, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "gd.target_pose.pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " gd.target_pose.pose.orientation.z = 0.349"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L116_C8", "label": "gd.target_pose.pose.orientation.w =", "type": "assigned_variable", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L96_C0", "vector": [14, 1, 0.6042, 0.0052, 1, 0.87, 0.875, 287, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "gd.target_pose.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " gd.target_pose.pose.orientation.w = 0.937"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L118_C8", "label": "add()", "type": "expression", "loc": [118, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L96_C0", "vector": [8, 1, 0.6302, 0.0365, 1, 0.87, 1.0, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'MOVE_SHOW_OFF_POSE',\n SimpleActionState( '/move_base',\n MoveBaseAction,\n goal = gd ),\n # transitions = {'succeeded':'READY_RETURN_HALLWAY'})\n transitions = {'succeeded':'succeeded'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Return_L150_C4", "label": "return", "type": "return", "loc": [150, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L96_C0", "vector": [13, 1, 0.7812, 0.0052, 1, 0.87, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L152_C0", "label": "if", "type": "if", "loc": [152, 169], "level": 0, "parent": null, "vector": [4, 0, 0.8359, 0.0938, 0, 0.66, 0.963, 0, 1, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if False:\n rospy.init_node('localization_trial')\n\n sm = smach.StateMachine( outcomes=['succeeded','aborted','preempted'] )\n with sm:\n # Just a precation\n tgoal = SingleJointPositionGoal()\n tgoal.position = 0.040 # all the way up is 0.200"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L153_C4", "label": "init_node()", "type": "expression", "loc": [153, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L152_C0", "vector": [8, 1, 0.7969, 0.0052, 1, 0.75, 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('localization_trial')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L155_C4", "label": "sm = StateMachine()", "type": "assigned_variable", "loc": [155, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L152_C0", "vector": [14, 1, 0.8073, 0.0052, 1, 0.75, 0.5, 21, 3, 1, 0, 0, 174, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "StateMachine", "annotation": ""}, "snippet": " sm = smach.StateMachine( outcomes=['succeeded','aborted','preempted'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L158_C8", "label": "tgoal = SingleJointPositionGoal()", "type": "assigned_variable", "loc": [158, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L152_C0", "vector": [14, 1, 0.8229, 0.0052, 1, 0.75, 0.0, 454, 3, 0, 0, 0, 974, 10, 1], "semantic": {"name": "tgoal", "arg_names": [], "import_names": [], "rhs_call_name": "SingleJointPositionGoal", "annotation": ""}, "snippet": " tgoal = SingleJointPositionGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L159_C8", "label": "tgoal.position =", "type": "assigned_variable", "loc": [159, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L152_C0", "vector": [14, 1, 0.8281, 0.0052, 1, 0.75, 0.25, 731, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "tgoal.position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tgoal.position = 0.040 # all the way up is 0.200"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L160_C8", "label": "tgoal.min_duration = Duration()", "type": "assigned_variable", "loc": [160, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L152_C0", "vector": [14, 1, 0.8333, 0.0052, 1, 0.75, 0.5, 779, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "tgoal.min_duration", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " tgoal.min_duration = rospy.Duration( 2.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L161_C8", "label": "tgoal.max_velocity =", "type": "assigned_variable", "loc": [161, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L152_C0", "vector": [14, 1, 0.8385, 0.0052, 1, 0.75, 0.75, 590, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "tgoal.max_velocity", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tgoal.max_velocity = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L162_C8", "label": "add()", "type": "expression", "loc": [162, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L152_C0", "vector": [8, 1, 0.8568, 0.0312, 1, 0.75, 1.0, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'TORSO_SETUP',\n SimpleActionState( 'torso_controller/position_joint_action',\n SingleJointPositionAction,\n goal = tgoal),\n transitions = { 'succeeded': 'succeeded' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L169_C4", "label": "execute()", "type": "expression", "loc": [169, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L152_C0", "vector": [8, 1, 0.8802, 0.0052, 1, 0.75, 1.0, 569, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " sm.execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L172_C0", "label": "if", "type": "if", "loc": [172, 189], "level": 0, "parent": null, "vector": [4, 0, 0.9401, 0.0938, 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# if False:\n rospy.init_node('smach_aware_home')\n\n sm = cousins_demo()\n\n sis = IntrospectionServer('sm_aware_home', sm, '/SM_AWARE_HOME')\n sis.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L174_C4", "label": "init_node()", "type": "expression", "loc": [174, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L172_C0", "vector": [8, 1, 0.9062, 0.0052, 1, 0.12, 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('smach_aware_home')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L176_C4", "label": "sm = cousins_demo()", "type": "assigned_variable", "loc": [176, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L172_C0", "vector": [14, 1, 0.9167, 0.0052, 1, 0.12, 0.1429, 21, 3, 0, 0, 0, 546, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "cousins_demo", "annotation": ""}, "snippet": " sm = cousins_demo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L178_C4", "label": "sis = IntrospectionServer()", "type": "assigned_variable", "loc": [178, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L172_C0", "vector": [14, 1, 0.9271, 0.0052, 1, 0.12, 0.2857, 608, 3, 3, 0, 0, 702, 10, 1], "semantic": {"name": "sis", "arg_names": [], "import_names": [], "rhs_call_name": "IntrospectionServer", "annotation": ""}, "snippet": " sis = IntrospectionServer('sm_aware_home', sm, '/SM_AWARE_HOME')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L179_C4", "label": "start()", "type": "expression", "loc": [179, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L172_C0", "vector": [8, 1, 0.9323, 0.0052, 1, 0.12, 0.4286, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " sis.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L181_C4", "label": "logout()", "type": "expression", "loc": [181, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L172_C0", "vector": [8, 1, 0.9427, 0.0052, 1, 0.12, 0.5714, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'READY TO RUN AWARE_HOME DEMO' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L183_C4", "label": "sm.userdata.person_id =", "type": "assigned_variable", "loc": [183, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L172_C0", "vector": [14, 1, 0.9531, 0.0052, 1, 0.12, 0.7143, 760, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "sm.userdata.person_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sm.userdata.person_id = 'person '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L186_C4", "label": "outcome = execute()", "type": "assigned_variable", "loc": [186, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L172_C0", "vector": [14, 1, 0.9688, 0.0052, 1, 0.12, 0.8571, 805, 3, 0, 0, 0, 569, 10, 1], "semantic": {"name": "outcome", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " outcome = sm.execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L189_C4", "label": "stop()", "type": "expression", "loc": [189, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L172_C0", "vector": [8, 1, 0.9844, 0.0052, 1, 0.12, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " sis.stop()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99387:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Return_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Return_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Return_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Return_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L152_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L152_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L152_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L152_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L152_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L152_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L152_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L152_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Assign_L186_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99387:If_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99387:Expr_L189_C4"}]
#! /usr/bin/python import roslib; roslib.load_manifest('rfid_demos') roslib.load_manifest('hrl_pr2_kinematics_tutorials') # roslib.load_manifest('rfid_people_following') roslib.load_manifest('std_srvs') roslib.load_manifest('joy') import rospy from smach_ros import IntrospectionServer from rfid_servoing.srv import ServoSrv from rfid_behaviors.srv import HandoffSrv from rfid_behaviors.srv import String_Int32 from rfid_behaviors.srv import FlapEarsSrv # from rfid_people_following.srv import rfid_gui as gui_srv from rfid_demos import sm_rfid_delivery from std_srvs.srv import Empty from joy.msg import Joy from cmd_process import CmdProcess import numpy as np, math import time class DemoNode(): def __init__( self ): rospy.init_node( 'rfid_demo', anonymous = True ) rospy.logout( 'demo_node: Initializing' ) rospy.logout( 'demo_node: Waiting for services' ) rospy.wait_for_service( '/rfid_servo/servo' ) rospy.wait_for_service( '/rfid_orient/orient' ) rospy.wait_for_service( '/rfid_orient/flap' ) rospy.wait_for_service( '/rfid_handoff/initialize' ) rospy.wait_for_service( '/rfid_handoff/handoff' ) rospy.wait_for_service( '/rfid_handoff/wave' ) #rospy.wait_for_service( '/rfid_gui/select' ) rospy.logout( 'demo_node: All services ready.' ) rospy.logout( 'demo_node: Setting up state machine.' ) self.sm = sm_rfid_delivery.sm_delivery() sis = IntrospectionServer('RFID_delivery', self.sm, '/SM_ROOT') sis.start() rospy.logout( 'demo_node: Done setting up state machine.' ) self.last_button = time.time() self.run_demo = False self.run_hoinit = False self.run_handoff = False self._joy_sub = rospy.Subscriber( 'joy', Joy, self.joy_process ) self._servo = rospy.ServiceProxy( '/rfid_servo/servo', ServoSrv ) self.follow1 = lambda : self._servo( 'person ', 1 ) # Stops at first obs self.follow = lambda : self._servo( 'person ', 0 ) # Runs forever self._handoff = rospy.ServiceProxy( '/rfid_handoff/handoff', HandoffSrv ) self.handoff = lambda : self._handoff() self._hoinit = rospy.ServiceProxy( '/rfid_handoff/initialize', HandoffSrv ) self.hoinit = lambda : self._hoinit() self._howave = rospy.ServiceProxy( '/rfid_handoff/wave', HandoffSrv ) self.howave = lambda : self._howave() self._flap = rospy.ServiceProxy( '/rfid_orient/flap', FlapEarsSrv ) self.flap = lambda : self._flap( '' ) self._orient = rospy.ServiceProxy( '/rfid_orient/orient', String_Int32 ) self.orient = lambda tagid: self._orient( tagid ) #self._gui = rospy.ServiceProxy( '/rfid_gui/select', gui_srv ) #self.gui = lambda tags: self._gui( tags ) self._service = rospy.Service( '/rfid_demo/demo', Empty, self.demo ) # self._service = rospy.Service( '/rfid_demo/gui', Empty, self.gui_test ) rospy.logout( 'demo_node: Demo service ready!' ) def joy_process( self, msg ): if msg.buttons[11] == 1 and time.time() - self.last_button > 1.0: if msg.buttons[12] == 1: # tri + R1 rospy.logout( 'demo_node: joy_process: Calling demo service' ) p = CmdProcess( ['rosservice', 'call', '/rfid_demo/demo'] ) p.run() self.last_button = time.time() elif msg.buttons[13] == 1: # circle + R1 rospy.logout( 'demo_node: joy_process: Calling handoff service' ) p = CmdProcess( ['rosservice', 'call', '/rfid_handoff/handoff'] ) p.run() self.last_button = time.time() # SERVO_TOGGLE NO LONGER DEFINED! # elif msg.buttons[14] == 1: # X + R1 # rospy.logout( 'demo_node: joy_process: Calling servo toggle service' ) # p = CmdProcess( ['rosservice', 'call', '/rfid_servo/stop_next_obs', '1'] ) # p.run() # self.last_button = time.time() elif msg.buttons[15] == 1: # square + R1 rospy.logout( 'demo_node: joy_process: Calling handoff initialization service' ) p = CmdProcess( ['rosservice', 'call', '/rfid_handoff/initialize'] ) p.run() self.last_button = time.time() elif msg.buttons[9] == 1: # R2 + R1 rospy.logout( 'demo_node: joy_process: Calling handoff wave service' ) p = CmdProcess( ['rosservice', 'call', '/rfid_handoff/wave'] ) p.run() self.last_button = time.time() # def gui_test( self, msg = None ): # tags = self.flap().value # gui_resp = self.gui( tags ) def demo( self, msg = None ): rospy.logout( 'demo_node: Calling.' ) self.sm.userdata.tagid = 'person ' outcome = self.sm.execute() print outcome if __name__ == '__main__': dn = DemoNode() rospy.spin()
ajibawa-2023/Python-Code-Large/train/row_99388
84
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_99388:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0244, 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;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0325, 0.0081, 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('rfid_demos')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0407, 0.0081, 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": "roslib.load_manifest('hrl_pr2_kinematics_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0569, 0.0081, 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('std_srvs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.065, 0.0081, 0, 0.66, 0.2222, 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('joy')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Import_L9_C0", "label": "rospy import rospy", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0732, 0.0081, 0, 0.66, 0.2778, 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_99388:ImportFrom_L11_C0", "label": "from smach_ros import IntrospectionServer", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0894, 0.0081, 0, 0.66, 0.3333, 716, 0, 1, 0, 0, 716, 0, 0], "semantic": {"name": "smach_ros", "arg_names": [], "import_names": ["IntrospectionServer"], "rhs_call_name": "", "annotation": ""}, "snippet": "from smach_ros import IntrospectionServer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:ImportFrom_L12_C0", "label": "from rfid_servoing.srv import ServoSrv", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0976, 0.0081, 0, 0.66, 0.3889, 46, 0, 1, 0, 0, 46, 0, 0], "semantic": {"name": "rfid_servoing.srv", "arg_names": [], "import_names": ["ServoSrv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_servoing.srv import ServoSrv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:ImportFrom_L13_C0", "label": "from rfid_behaviors.srv import HandoffSrv", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.1057, 0.0081, 0, 0.66, 0.4444, 647, 0, 1, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["HandoffSrv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import HandoffSrv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:ImportFrom_L14_C0", "label": "from rfid_behaviors.srv import String_Int32", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.1138, 0.0081, 0, 0.66, 0.5, 647, 0, 1, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["String_Int32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import String_Int32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:ImportFrom_L15_C0", "label": "from rfid_behaviors.srv import FlapEarsSrv", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.122, 0.0081, 0, 0.66, 0.5556, 647, 0, 1, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["FlapEarsSrv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import FlapEarsSrv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:ImportFrom_L17_C0", "label": "from rfid_demos import sm_rfid_delivery", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.1382, 0.0081, 0, 0.66, 0.6111, 964, 0, 1, 0, 0, 964, 0, 0], "semantic": {"name": "rfid_demos", "arg_names": [], "import_names": ["sm_rfid_delivery"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_demos import sm_rfid_delivery"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:ImportFrom_L18_C0", "label": "from std_srvs.srv import Empty", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1463, 0.0081, 0, 0.66, 0.6667, 261, 0, 1, 0, 0, 261, 0, 0], "semantic": {"name": "std_srvs.srv", "arg_names": [], "import_names": ["Empty"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_srvs.srv import Empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:ImportFrom_L19_C0", "label": "from joy.msg import Joy", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.1545, 0.0081, 0, 0.66, 0.7222, 242, 0, 1, 0, 0, 242, 0, 0], "semantic": {"name": "joy.msg", "arg_names": [], "import_names": ["Joy"], "rhs_call_name": "", "annotation": ""}, "snippet": "from joy.msg import Joy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:ImportFrom_L20_C0", "label": "from cmd_process import CmdProcess", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.1626, 0.0081, 0, 0.66, 0.7778, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "cmd_process", "arg_names": [], "import_names": ["CmdProcess"], "rhs_call_name": "", "annotation": ""}, "snippet": "from cmd_process import CmdProcess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Import_L22_C0", "label": "numpy import np, math", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.1789, 0.0081, 0, 0.66, 0.8333, 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_99388:Import_L23_C0", "label": "time import time", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.187, 0.0081, 0, 0.66, 0.8889, 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_99388:ClassDef_L25_C0", "label": "DemoNode", "type": "class", "loc": [25, 119], "level": 0, "parent": null, "vector": [3, 0, 0.5854, 0.7724, 0, 0.66, 0.9444, 960, 0, 3, 0, 0, 0, 0, 52], "semantic": {"name": "DemoNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DemoNode():\n def __init__( self ):\n rospy.init_node( 'rfid_demo', anonymous = True )\n rospy.logout( 'demo_node: Initializing' )\n rospy.logout( 'demo_node: Waiting for services' )\n rospy.wait_for_service( '/rfid_servo/servo' )\n rospy.wait_for_service( '/rfid_orient/orient' )\n rospy.wait_for_service( '/rfid_orient/flap' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "label": "__init__", "type": "function", "loc": [26, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:ClassDef_L25_C0", "vector": [2, 1, 0.4309, 0.4472, 1, 0.9, 0.0, 555, 0, 1, 0, 0, 0, 0, 32], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self ):\n rospy.init_node( 'rfid_demo', anonymous = True )\n rospy.logout( 'demo_node: Initializing' )\n rospy.logout( 'demo_node: Waiting for services' )\n rospy.wait_for_service( '/rfid_servo/servo' )\n rospy.wait_for_service( '/rfid_orient/orient' )\n rospy.wait_for_service( '/rfid_orient/flap' )\n rospy.wait_for_service( '/rfid_handoff/initialize' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L27_C8", "label": "init_node()", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [8, 2, 0.2195, 0.0081, 2, 0.82, 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( 'rfid_demo', anonymous = True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L28_C8", "label": "logout()", "type": "expression", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [8, 2, 0.2276, 0.0081, 2, 0.82, 0.0294, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'demo_node: Initializing' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L29_C8", "label": "logout()", "type": "expression", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [8, 2, 0.2358, 0.0081, 2, 0.82, 0.0588, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'demo_node: Waiting for services' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L30_C8", "label": "wait_for_service()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [8, 2, 0.2439, 0.0081, 2, 0.82, 0.0882, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service( '/rfid_servo/servo' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L31_C8", "label": "wait_for_service()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [8, 2, 0.252, 0.0081, 2, 0.82, 0.1176, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service( '/rfid_orient/orient' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L32_C8", "label": "wait_for_service()", "type": "expression", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [8, 2, 0.2602, 0.0081, 2, 0.82, 0.1471, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service( '/rfid_orient/flap' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L33_C8", "label": "wait_for_service()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [8, 2, 0.2683, 0.0081, 2, 0.82, 0.1765, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service( '/rfid_handoff/initialize' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L34_C8", "label": "wait_for_service()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [8, 2, 0.2764, 0.0081, 2, 0.82, 0.2059, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service( '/rfid_handoff/handoff' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L35_C8", "label": "wait_for_service()", "type": "expression", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [8, 2, 0.2846, 0.0081, 2, 0.82, 0.2353, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service( '/rfid_handoff/wave' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L37_C8", "label": "logout()", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [8, 2, 0.3008, 0.0081, 2, 0.82, 0.2647, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'demo_node: All services ready.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L39_C8", "label": "logout()", "type": "expression", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [8, 2, 0.3171, 0.0081, 2, 0.82, 0.2941, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'demo_node: Setting up state machine.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L40_C8", "label": "self.sm = sm_delivery()", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [14, 2, 0.3252, 0.0081, 2, 0.82, 0.3235, 797, 3, 0, 0, 0, 298, 10, 1], "semantic": {"name": "self.sm", "arg_names": [], "import_names": [], "rhs_call_name": "sm_delivery", "annotation": ""}, "snippet": " self.sm = sm_rfid_delivery.sm_delivery()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L42_C8", "label": "sis = IntrospectionServer()", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [14, 2, 0.3415, 0.0081, 2, 0.82, 0.3529, 608, 3, 3, 0, 0, 702, 10, 1], "semantic": {"name": "sis", "arg_names": [], "import_names": [], "rhs_call_name": "IntrospectionServer", "annotation": ""}, "snippet": " sis = IntrospectionServer('RFID_delivery', self.sm, '/SM_ROOT')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L43_C8", "label": "start()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [8, 2, 0.3496, 0.0081, 2, 0.82, 0.3824, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " sis.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L45_C8", "label": "logout()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [8, 2, 0.3659, 0.0081, 2, 0.82, 0.4118, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'demo_node: Done setting up state machine.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L47_C8", "label": "self.last_button = time()", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [14, 2, 0.3821, 0.0081, 2, 0.82, 0.4412, 456, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "self.last_button", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " self.last_button = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L48_C8", "label": "self.run_demo =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [14, 2, 0.3902, 0.0081, 2, 0.82, 0.4706, 464, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.run_demo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.run_demo = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L49_C8", "label": "self.run_hoinit =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [14, 2, 0.3984, 0.0081, 2, 0.82, 0.5, 338, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.run_hoinit", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.run_hoinit = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L50_C8", "label": "self.run_handoff =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [14, 2, 0.4065, 0.0081, 2, 0.82, 0.5294, 979, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.run_handoff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.run_handoff = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L52_C8", "label": "self._joy_sub = Subscriber()", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [14, 2, 0.4228, 0.0081, 2, 0.82, 0.5588, 562, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "self._joy_sub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " self._joy_sub = rospy.Subscriber( 'joy', Joy, self.joy_process )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L54_C8", "label": "self._servo = ServiceProxy()", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [14, 2, 0.439, 0.0081, 2, 0.82, 0.5882, 631, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._servo", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._servo = rospy.ServiceProxy( '/rfid_servo/servo', ServoSrv )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L55_C8", "label": "self.follow1 =", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [14, 2, 0.4472, 0.0081, 2, 0.82, 0.6176, 595, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.follow1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.follow1 = lambda : self._servo( 'person ', 1 ) # Stops at first obs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L56_C8", "label": "self.follow =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [14, 2, 0.4553, 0.0081, 2, 0.82, 0.6471, 949, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.follow", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.follow = lambda : self._servo( 'person ', 0 ) # Runs forever"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L58_C8", "label": "self._handoff = ServiceProxy()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [14, 2, 0.4715, 0.0081, 2, 0.82, 0.6765, 138, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._handoff", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._handoff = rospy.ServiceProxy( '/rfid_handoff/handoff', HandoffSrv )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L59_C8", "label": "self.handoff =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [14, 2, 0.4797, 0.0081, 2, 0.82, 0.7059, 434, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.handoff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.handoff = lambda : self._handoff()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L61_C8", "label": "self._hoinit = ServiceProxy()", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [14, 2, 0.4959, 0.0081, 2, 0.82, 0.7353, 326, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._hoinit", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._hoinit = rospy.ServiceProxy( '/rfid_handoff/initialize', HandoffSrv )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L62_C8", "label": "self.hoinit =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [14, 2, 0.5041, 0.0081, 2, 0.82, 0.7647, 941, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.hoinit", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.hoinit = lambda : self._hoinit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L64_C8", "label": "self._howave = ServiceProxy()", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [14, 2, 0.5203, 0.0081, 2, 0.82, 0.7941, 667, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._howave", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._howave = rospy.ServiceProxy( '/rfid_handoff/wave', HandoffSrv )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L65_C8", "label": "self.howave =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [14, 2, 0.5285, 0.0081, 2, 0.82, 0.8235, 631, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.howave", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.howave = lambda : self._howave()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L67_C8", "label": "self._flap = ServiceProxy()", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [14, 2, 0.5447, 0.0081, 2, 0.82, 0.8529, 835, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._flap", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._flap = rospy.ServiceProxy( '/rfid_orient/flap', FlapEarsSrv )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L68_C8", "label": "self.flap =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [14, 2, 0.5528, 0.0081, 2, 0.82, 0.8824, 124, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.flap", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.flap = lambda : self._flap( '' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L70_C8", "label": "self._orient = ServiceProxy()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [14, 2, 0.5691, 0.0081, 2, 0.82, 0.9118, 142, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._orient", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._orient = rospy.ServiceProxy( '/rfid_orient/orient', String_Int32 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L71_C8", "label": "self.orient =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [14, 2, 0.5772, 0.0081, 2, 0.82, 0.9412, 883, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.orient", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.orient = lambda tagid: self._orient( tagid )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L76_C8", "label": "self._service = Service()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [14, 2, 0.6179, 0.0081, 2, 0.82, 0.9706, 143, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self._service", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self._service = rospy.Service( '/rfid_demo/demo', Empty, self.demo )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L80_C8", "label": "logout()", "type": "expression", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "vector": [8, 2, 0.6504, 0.0081, 2, 0.82, 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( 'demo_node: Demo service ready!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L82_C4", "label": "joy_process", "type": "function", "loc": [82, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:ClassDef_L25_C0", "vector": [2, 1, 0.7764, 0.2276, 1, 0.9, 0.5, 715, 0, 2, 0, 0, 0, 0, 17], "semantic": {"name": "joy_process", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def joy_process( self, msg ):\n if msg.buttons[11] == 1 and time.time() - self.last_button > 1.0:\n if msg.buttons[12] == 1: # tri + R1\n rospy.logout( 'demo_node: joy_process: Calling demo service' )\n p = CmdProcess( ['rosservice', 'call', '/rfid_demo/demo'] )\n p.run()\n self.last_button = time.time()\n elif msg.buttons[13] == 1: # circle + R1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L83_C8", "label": "if", "type": "if", "loc": [83, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L82_C4", "vector": [4, 2, 0.7805, 0.2195, 2, 0.21, 0.0, 0, 0, 0, 0, 0, 0, 0, 17], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg.buttons[11] == 1 and time.time() - self.last_button > 1.0:\n if msg.buttons[12] == 1: # tri + R1\n rospy.logout( 'demo_node: joy_process: Calling demo service' )\n p = CmdProcess( ['rosservice', 'call', '/rfid_demo/demo'] )\n p.run()\n self.last_button = time.time()\n elif msg.buttons[13] == 1: # circle + R1\n rospy.logout( 'demo_node: joy_process: Calling handoff service' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L84_C12", "label": "if", "type": "if", "loc": [84, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L83_C8", "vector": [4, 3, 0.7846, 0.2114, 3, 0.55, 0.0, 0, 0, 0, 0, 0, 0, 0, 16], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg.buttons[12] == 1: # tri + R1\n rospy.logout( 'demo_node: joy_process: Calling demo service' )\n p = CmdProcess( ['rosservice', 'call', '/rfid_demo/demo'] )\n p.run()\n self.last_button = time.time()\n elif msg.buttons[13] == 1: # circle + R1\n rospy.logout( 'demo_node: joy_process: Calling handoff service' )\n p = CmdProcess( ['rosservice', 'call', '/rfid_handoff/handoff'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L85_C16", "label": "logout()", "type": "expression", "loc": [85, 85], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L84_C12", "vector": [8, 4, 0.6911, 0.0081, 4, 0.96, 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( 'demo_node: joy_process: Calling demo service' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L86_C16", "label": "p = CmdProcess()", "type": "assigned_variable", "loc": [86, 86], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L84_C12", "vector": [14, 4, 0.6992, 0.0081, 4, 0.96, 0.25, 491, 3, 1, 0, 0, 248, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "CmdProcess", "annotation": ""}, "snippet": " p = CmdProcess( ['rosservice', 'call', '/rfid_demo/demo'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L87_C16", "label": "run()", "type": "expression", "loc": [87, 87], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L84_C12", "vector": [8, 4, 0.7073, 0.0081, 4, 0.96, 0.5, 679, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " p.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L88_C16", "label": "self.last_button = time()", "type": "assigned_variable", "loc": [88, 88], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L84_C12", "vector": [14, 4, 0.7154, 0.0081, 4, 0.96, 0.75, 456, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "self.last_button", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " self.last_button = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L89_C12", "label": "if", "type": "if", "loc": [89, 109], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L84_C12", "vector": [4, 4, 0.8049, 0.1707, 4, 0.96, 1.0, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif msg.buttons[13] == 1: # circle + R1\n rospy.logout( 'demo_node: joy_process: Calling handoff service' )\n p = CmdProcess( ['rosservice', 'call', '/rfid_handoff/handoff'] )\n p.run()\n self.last_button = time.time()\n # SERVO_TOGGLE NO LONGER DEFINED!\n # elif msg.buttons[14] == 1: # X + R1 \n # rospy.logout( 'demo_node: joy_process: Calling servo toggle service' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L90_C16", "label": "logout()", "type": "expression", "loc": [90, 90], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L89_C12", "vector": [8, 5, 0.7317, 0.0081, 5, 0.71, 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( 'demo_node: joy_process: Calling handoff service' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L91_C16", "label": "p = CmdProcess()", "type": "assigned_variable", "loc": [91, 91], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L89_C12", "vector": [14, 5, 0.7398, 0.0081, 5, 0.71, 0.25, 491, 3, 1, 0, 0, 248, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "CmdProcess", "annotation": ""}, "snippet": " p = CmdProcess( ['rosservice', 'call', '/rfid_handoff/handoff'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L92_C16", "label": "run()", "type": "expression", "loc": [92, 92], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L89_C12", "vector": [8, 5, 0.748, 0.0081, 5, 0.71, 0.5, 679, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " p.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L93_C16", "label": "self.last_button = time()", "type": "assigned_variable", "loc": [93, 93], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L89_C12", "vector": [14, 5, 0.7561, 0.0081, 5, 0.71, 0.75, 456, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "self.last_button", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " self.last_button = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L100_C12", "label": "if", "type": "if", "loc": [100, 109], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L89_C12", "vector": [4, 5, 0.8496, 0.0813, 5, 0.71, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif msg.buttons[15] == 1: # square + R1\n rospy.logout( 'demo_node: joy_process: Calling handoff initialization service' )\n p = CmdProcess( ['rosservice', 'call', '/rfid_handoff/initialize'] )\n p.run()\n self.last_button = time.time()\n elif msg.buttons[9] == 1: # R2 + R1\n rospy.logout( 'demo_node: joy_process: Calling handoff wave service' )\n p = CmdProcess( ['rosservice', 'call', '/rfid_handoff/wave'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L101_C16", "label": "logout()", "type": "expression", "loc": [101, 101], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L100_C12", "vector": [8, 6, 0.8211, 0.0081, 6, 0.94, 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( 'demo_node: joy_process: Calling handoff initialization service' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L102_C16", "label": "p = CmdProcess()", "type": "assigned_variable", "loc": [102, 102], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L100_C12", "vector": [14, 6, 0.8293, 0.0081, 6, 0.94, 0.25, 491, 3, 1, 0, 0, 248, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "CmdProcess", "annotation": ""}, "snippet": " p = CmdProcess( ['rosservice', 'call', '/rfid_handoff/initialize'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L103_C16", "label": "run()", "type": "expression", "loc": [103, 103], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L100_C12", "vector": [8, 6, 0.8374, 0.0081, 6, 0.94, 0.5, 679, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " p.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L104_C16", "label": "self.last_button = time()", "type": "assigned_variable", "loc": [104, 104], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L100_C12", "vector": [14, 6, 0.8455, 0.0081, 6, 0.94, 0.75, 456, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "self.last_button", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " self.last_button = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L105_C12", "label": "if", "type": "if", "loc": [105, 109], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L100_C12", "vector": [4, 6, 0.8699, 0.0407, 6, 0.94, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif msg.buttons[9] == 1: # R2 + R1\n rospy.logout( 'demo_node: joy_process: Calling handoff wave service' )\n p = CmdProcess( ['rosservice', 'call', '/rfid_handoff/wave'] )\n p.run()\n self.last_button = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L106_C16", "label": "logout()", "type": "expression", "loc": [106, 106], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L105_C12", "vector": [8, 7, 0.8618, 0.0081, 7, 0.63, 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( 'demo_node: joy_process: Calling handoff wave service' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L107_C16", "label": "p = CmdProcess()", "type": "assigned_variable", "loc": [107, 107], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L105_C12", "vector": [14, 7, 0.8699, 0.0081, 7, 0.63, 0.3333, 491, 3, 1, 0, 0, 248, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "CmdProcess", "annotation": ""}, "snippet": " p = CmdProcess( ['rosservice', 'call', '/rfid_handoff/wave'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L108_C16", "label": "run()", "type": "expression", "loc": [108, 108], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L105_C12", "vector": [8, 7, 0.878, 0.0081, 7, 0.63, 0.6667, 679, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " p.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L109_C16", "label": "self.last_button = time()", "type": "assigned_variable", "loc": [109, 109], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L105_C12", "vector": [14, 7, 0.8862, 0.0081, 7, 0.63, 1.0, 456, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "self.last_button", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " self.last_button = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L115_C4", "label": "demo", "type": "function", "loc": [115, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:ClassDef_L25_C0", "vector": [2, 1, 0.9512, 0.0407, 1, 0.9, 1.0, 886, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "demo", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def demo( self, msg = None ):\n rospy.logout( 'demo_node: Calling.' )\n self.sm.userdata.tagid = 'person '\n outcome = self.sm.execute()\n print(outcome)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L116_C8", "label": "logout()", "type": "expression", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L115_C4", "vector": [8, 2, 0.9431, 0.0081, 2, 0.88, 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( 'demo_node: Calling.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L117_C8", "label": "self.sm.userdata.tagid =", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L115_C4", "vector": [14, 2, 0.9512, 0.0081, 2, 0.88, 0.3333, 922, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.sm.userdata.tagid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.sm.userdata.tagid = 'person '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L118_C8", "label": "outcome = execute()", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L115_C4", "vector": [14, 2, 0.9593, 0.0081, 2, 0.88, 0.6667, 805, 3, 0, 0, 0, 569, 10, 1], "semantic": {"name": "outcome", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " outcome = self.sm.execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L119_C8", "label": "print()", "type": "expression", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L115_C4", "vector": [8, 2, 0.9675, 0.0081, 2, 0.88, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(outcome)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L121_C0", "label": "if", "type": "if", "loc": [121, 123], "level": 0, "parent": null, "vector": [4, 0, 0.9919, 0.0244, 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 dn = DemoNode()\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L122_C4", "label": "dn = DemoNode()", "type": "assigned_variable", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L121_C0", "vector": [14, 1, 0.9919, 0.0081, 1, 0.35, 0.0, 105, 3, 0, 0, 0, 960, 10, 1], "semantic": {"name": "dn", "arg_names": [], "import_names": [], "rhs_call_name": "DemoNode", "annotation": ""}, "snippet": " dn = DemoNode()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L123_C4", "label": "spin()", "type": "expression", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L121_C0", "vector": [8, 1, 1.0, 0.0081, 1, 0.35, 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_99388:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L84_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L85_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L84_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L86_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L84_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L87_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L84_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L88_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L84_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L89_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L90_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L89_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L91_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L89_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L92_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L89_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L93_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L89_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L100_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L101_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L100_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L102_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L100_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L103_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L100_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L104_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L100_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L105_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L105_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L106_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L105_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L107_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L105_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L108_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L105_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L109_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:FunctionDef_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L121_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99388:If_L121_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99388:Expr_L123_C4"}]
#! /usr/bin/python import roslib roslib.load_manifest('rfid_demos') roslib.load_manifest('rfid_explore_room') import rospy import smach import tf from smach_ros import SimpleActionState, ServiceState, IntrospectionServer import actionlib from rfid_behaviors.srv import FlapperSrv, FlapperSrvRequest from rfid_behaviors.srv import RecorderSrv, RecorderSrvRequest, NextBestVantage from rfid_behaviors.msg import RecorderReads from rfid_explore_room.srv import ExploreRoomSrv, ExploreRoomSrvResponse from explore_hrl.msg import ExploreAction, ExploreGoal from geometry_msgs.msg import PoseStamped class Sleeper( smach.State ): def __init__( self, time ): smach.State.__init__( self, outcomes = ['succeeded'] ) self.time = time def execute( self, userdata ): rospy.sleep( self.time ) return 'succeeded' def sm_search(): # Create a SMACH state machine sm_search = smach.StateMachine( outcomes=['succeeded', 'aborted', 'preempted'], input_keys = ['tagid', 'explore_radius']) # Open the container with sm_search: # Start the RFID recorder smach.StateMachine.add( 'RECORDER_START', ServiceState( '/rfid_recorder/record', RecorderSrv), transitions = {'succeeded':'FLAPPER_START'}) # Start the ears flapping. smach.StateMachine.add( 'FLAPPER_START', ServiceState( '/flapper/flap', FlapperSrv, request_slots = ['tagid']), transitions = {'succeeded':'EXPLORE_ROOM'}, # transitions = {'succeeded':'SLEEPER'}, remapping = {'tagid':'tagid'}) # smach.StateMachine.add('SLEEPER', Sleeper( 5.0 ), transitions = {'succeeded':'FLAPPER_STOP'}) # EXPLORE def explore_response_cb( userdata, response ): # result is of ExploreRoomSrvResponse return response.result smach.StateMachine.add( 'EXPLORE_ROOM', ServiceState( '/explore/explore', # Default outcomes ExploreRoomSrv, request_slots = [ 'radius' ], response_cb = explore_response_cb), remapping = { 'radius':'explore_radius' }, transitions = {'succeeded':'FLAPPER_STOP'}) # input # Stop the ears flapping. smach.StateMachine.add( 'FLAPPER_STOP', ServiceState( '/flapper/flap', FlapperSrv, request_slots = ['tagid']), transitions = {'succeeded':'RECORDER_STOP'}, remapping = {'tagid':'tagid'}) # Start the RFID recorder smach.StateMachine.add( 'RECORDER_STOP', ServiceState( '/rfid_recorder/record', RecorderSrv), transitions = {'succeeded':'succeeded'}) return sm_search if __name__ == '__main__': rospy.init_node('smach_rfid_explore') sm = sm_search() sis = IntrospectionServer('sm_rfid_explore', sm, '/SM_ROOT_RFID_EXPLORE') sis.start() rospy.sleep(3.0) sm.userdata.tagid = '' #sm.userdata.tagid = 'person ' sm.userdata.explore_radius = 2.7 outcome = sm.execute() sis.stop() # This old concurrency one didn't work. # def sm_search(): # # Create a SMACH state machine # sm_search = smach.Concurrence( outcomes=['succeeded', 'aborted', 'preempted'], # default_outcome = 'aborted', # outcome_map = {'succeeded': {'EXPLORE_ROOM':'succeeded'}, # 'aborted': {'EXPLORE_ROOM':'aborted'}, # 'preempted': {'EXPLORE_ROOM':'preempted'}}, # output_keys = ['explore_rfid_reads'], # input_keys = ['tagid', 'explore_radius'], # child_termination_cb = lambda arg: True ) # # Note: child_termination_cb: Terminate all other states' execution upon first child complete (Always EXPLORE_ROOM). # # Open the container # with sm_search: # smach.Concurrence.add( # 'EXPLORE_ROOM', # SimpleActionState( '/explore', # Default outcomes # ExploreAction, # goal_slots = [ 'radius' ]), # remapping = { 'radius':'explore_radius' }) # input # smach.Concurrence.add( # 'RFID_FLAPPER', # Flapper(), # outcomes: preempted # remapping = { 'tagid' : 'tagid' }) # input # smach.Concurrence.add( # 'RFID_RECORDER', # Recorder(), # outcomes: preempted # remapping = { 'rfid_reads' : 'explore_rfid_reads' }) # output # return sm_search # import hrl_rfid.ros_M5e_client as rmc # class Recorder(smach.State): # def __init__(self): # smach.State.__init__(self, # outcomes = ['preempted'], # output_keys = ['rfid_reads']) # [(RFIDread, ps_ant_map, ps_base_map ), ...] # self.data = [] # def execute(self, userdata): # rospy.logout( 'RFID Recorder: Initiated.' ) # self.data = [] # listener = tf.TransformListener() # rospy.logout( 'RFID Recorder: Waiting on transforms' ) # listener.waitForTransform('/ear_antenna_left', '/map', # rospy.Time(0), timeout = rospy.Duration(100) ) # listener.waitForTransform('/ear_antenna_right', '/map', # rospy.Time(0), timeout = rospy.Duration(100) ) # rospy.logout( 'RFID Recorder: Ready' ) # def process_datum( datum ): # # Hooray for lexical scope (listener)! # ant_lookup = { 'EleLeftEar': '/ear_antenna_left', # 'EleRightEar': '/ear_antenna_right' } # ps_ant = PoseStamped() # ps_ant.header.stamp = rospy.Time( 0 ) # ps_ant.header.frame_id = ant_lookup[ datum.antenna_name ] # ps_base = PoseStamped() # ps_base.header.stamp = rospy.Time( 0 ) # ps_base.header.frame_id = '/base_link' # try: # ps_ant_map = listener.transformPose( '/map', ps_ant ) # ps_base_map = listener.transformPose( '/map', ps_base ) # rv = ( datum, ps_ant_map, ps_base_map ) # except: # rospy.logout( 'RFID Recorder: TF failed. Ignoring read.' ) # rv = None # return rv # def add_datum( datum ): # # Hooray for lexical scope (data)! # self.data.append( process_datum( datum )) # # Notes: In this case, the flapper will initiate RFID reads # # for the proper tagid. Not ideal, but how it is for now. # rec = rmc.ROS_M5e_Client('ears', callbacks = [add_datum]) # rospy.logout( 'RFID Recorder: Logging Reads.' ) # while not smach.State.preempt_requested( self ): # rospy.sleep( 0.1 ) # rospy.logout( 'RFID Recorder: Preempt requested. Saving reads.' ) # rec.unregister() # Stop processing new reads # rospy.sleep( 0.5 ) # Give it some time to settle # userdata.rfid_reads = list(self.data) # Save the data. # self.data = [] # return 'preempted'
ajibawa-2023/Python-Code-Large/train/row_99389
41
214
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0093, 0.0047, 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_99389:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.014, 0.0047, 0, 0.66, 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": "roslib.load_manifest('rfid_demos')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0187, 0.0047, 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('rfid_explore_room')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0234, 0.0047, 0, 0.66, 0.1875, 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_99389:Import_L7_C0", "label": "smach import smach", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0327, 0.0047, 0, 0.66, 0.25, 345, 0, 1, 0, 0, 345, 0, 0], "semantic": {"name": "smach", "arg_names": [], "import_names": ["smach"], "rhs_call_name": "", "annotation": ""}, "snippet": "import smach"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Import_L8_C0", "label": "tf import tf", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0374, 0.0047, 0, 0.66, 0.3125, 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_99389:ImportFrom_L9_C0", "label": "from smach_ros import SimpleActionState, ServiceState, IntrospectionServer", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0421, 0.0047, 0, 0.66, 0.375, 716, 0, 3, 0, 0, 716, 0, 0], "semantic": {"name": "smach_ros", "arg_names": [], "import_names": ["SimpleActionState", "ServiceState", "IntrospectionServer"], "rhs_call_name": "", "annotation": ""}, "snippet": "from smach_ros import SimpleActionState, ServiceState, IntrospectionServer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Import_L10_C0", "label": "actionlib import actionlib", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0467, 0.0047, 0, 0.66, 0.4375, 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_99389:ImportFrom_L12_C0", "label": "from rfid_behaviors.srv import FlapperSrv, FlapperSrvRequest", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0561, 0.0047, 0, 0.66, 0.5, 647, 0, 2, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["FlapperSrv", "FlapperSrvRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import FlapperSrv, FlapperSrvRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:ImportFrom_L13_C0", "label": "from rfid_behaviors.srv import RecorderSrv, RecorderSrvRequest, NextBestVantage", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0607, 0.0047, 0, 0.66, 0.5625, 647, 0, 3, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["RecorderSrv", "RecorderSrvRequest", "NextBestVantage"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import RecorderSrv, RecorderSrvRequest, NextBestVantage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:ImportFrom_L14_C0", "label": "from rfid_behaviors.msg import RecorderReads", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0654, 0.0047, 0, 0.66, 0.625, 903, 0, 1, 0, 0, 903, 0, 0], "semantic": {"name": "rfid_behaviors.msg", "arg_names": [], "import_names": ["RecorderReads"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.msg import RecorderReads"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:ImportFrom_L15_C0", "label": "from rfid_explore_room.srv import ExploreRoomSrv, ExploreRoomSrvResponse", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0701, 0.0047, 0, 0.66, 0.6875, 334, 0, 2, 0, 0, 334, 0, 0], "semantic": {"name": "rfid_explore_room.srv", "arg_names": [], "import_names": ["ExploreRoomSrv", "ExploreRoomSrvResponse"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_explore_room.srv import ExploreRoomSrv, ExploreRoomSrvResponse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:ImportFrom_L16_C0", "label": "from explore_hrl.msg import ExploreAction, ExploreGoal", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0748, 0.0047, 0, 0.66, 0.75, 232, 0, 2, 0, 0, 232, 0, 0], "semantic": {"name": "explore_hrl.msg", "arg_names": [], "import_names": ["ExploreAction", "ExploreGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from explore_hrl.msg import ExploreAction, ExploreGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:ImportFrom_L17_C0", "label": "from geometry_msgs.msg import PoseStamped", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0794, 0.0047, 0, 0.66, 0.8125, 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_99389:ClassDef_L20_C0", "label": "Sleeper", "type": "class", "loc": [20, 27], "level": 0, "parent": null, "vector": [3, 0, 0.1098, 0.0374, 0, 0.66, 0.875, 802, 0, 2, 0, 0, 892, 0, 2], "semantic": {"name": "Sleeper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Sleeper( smach.State ):\n def __init__( self, time ):\n smach.State.__init__( self, outcomes = ['succeeded'] )\n self.time = time\n \n def execute( self, userdata ):\n rospy.sleep( self.time )\n return 'succeeded'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L21_C4", "label": "__init__", "type": "function", "loc": [21, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99389:ClassDef_L20_C0", "vector": [2, 1, 0.1028, 0.014, 1, 0.58, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "time"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, time ):\n smach.State.__init__( self, outcomes = ['succeeded'] )\n self.time = time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Expr_L22_C8", "label": "__init__()", "type": "expression", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L21_C4", "vector": [8, 2, 0.1028, 0.0047, 2, 0.46, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " smach.State.__init__( self, outcomes = ['succeeded'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Assign_L23_C8", "label": "self.time =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L21_C4", "vector": [14, 2, 0.1075, 0.0047, 2, 0.46, 1.0, 960, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.time = time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L25_C4", "label": "execute", "type": "function", "loc": [25, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99389:ClassDef_L20_C0", "vector": [2, 1, 0.1215, 0.014, 1, 0.58, 1.0, 569, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "execute", "arg_names": ["self", "userdata"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute( self, userdata ):\n rospy.sleep( self.time )\n return 'succeeded'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Expr_L26_C8", "label": "sleep()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L25_C4", "vector": [8, 2, 0.1215, 0.0047, 2, 0.02, 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( self.time )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Return_L27_C8", "label": "return", "type": "return", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L25_C4", "vector": [13, 2, 0.1262, 0.0047, 2, 0.02, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'succeeded'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L29_C0", "label": "sm_search", "type": "function", "loc": [29, 90], "level": 0, "parent": null, "vector": [2, 0, 0.278, 0.2897, 0, 0.66, 0.9375, 542, 0, 0, 1, 0, 0, 0, 11], "semantic": {"name": "sm_search", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def sm_search():\n # Create a SMACH state machine\n sm_search = smach.StateMachine( outcomes=['succeeded', 'aborted', 'preempted'],\n input_keys = ['tagid', 'explore_radius'])\n\n # Open the container\n with sm_search:\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Assign_L31_C4", "label": "sm_search = StateMachine()", "type": "assigned_variable", "loc": [31, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L29_C0", "vector": [14, 1, 0.1472, 0.0093, 1, 0.65, 0.0, 542, 3, 2, 0, 0, 174, 10, 1], "semantic": {"name": "sm_search", "arg_names": [], "import_names": [], "rhs_call_name": "StateMachine", "annotation": ""}, "snippet": " sm_search = smach.StateMachine( outcomes=['succeeded', 'aborted', 'preempted'],\n input_keys = ['tagid', 'explore_radius'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Expr_L38_C8", "label": "add()", "type": "expression", "loc": [38, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L29_C0", "vector": [8, 1, 0.1869, 0.0234, 1, 0.65, 0.0, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'RECORDER_START',\n ServiceState( '/rfid_recorder/record',\n RecorderSrv),\n transitions = {'succeeded':'FLAPPER_START'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Expr_L46_C8", "label": "add()", "type": "expression", "loc": [46, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L29_C0", "vector": [8, 1, 0.2313, 0.0374, 1, 0.65, 0.2, 241, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'FLAPPER_START',\n ServiceState( '/flapper/flap',\n FlapperSrv,\n request_slots = ['tagid']),\n transitions = {'succeeded':'EXPLORE_ROOM'},\n # transitions = {'succeeded':'SLEEPER'},\n remapping = {'tagid':'tagid'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L59_C8", "label": "explore_response_cb", "type": "function", "loc": [59, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L29_C0", "vector": [2, 1, 0.2804, 0.014, 1, 0.65, 0.4, 500, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "explore_response_cb", "arg_names": ["userdata", "response"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def explore_response_cb( userdata, response ):\n # result is of ExploreRoomSrvResponse\n return response.result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Return_L61_C12", "label": "return", "type": "return", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L59_C8", "vector": [13, 2, 0.285, 0.0047, 2, 0.32, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return response.result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Expr_L63_C8", "label": "add()", "type": "expression", "loc": [63, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L29_C0", "vector": [8, 1, 0.3107, 0.0374, 1, 0.65, 0.6, 241, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'EXPLORE_ROOM',\n ServiceState( '/explore/explore', # Default outcomes\n ExploreRoomSrv,\n request_slots = [ 'radius' ],\n response_cb = explore_response_cb),\n remapping = { 'radius':'explore_radius' },\n transitions = {'succeeded':'FLAPPER_STOP'}) # input"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Expr_L74_C8", "label": "add()", "type": "expression", "loc": [74, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L29_C0", "vector": [8, 1, 0.3598, 0.0327, 1, 0.65, 0.8, 241, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'FLAPPER_STOP',\n ServiceState( '/flapper/flap',\n FlapperSrv,\n request_slots = ['tagid']),\n transitions = {'succeeded':'RECORDER_STOP'},\n remapping = {'tagid':'tagid'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Expr_L83_C8", "label": "add()", "type": "expression", "loc": [83, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L29_C0", "vector": [8, 1, 0.3972, 0.0234, 1, 0.65, 1.0, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'RECORDER_STOP',\n ServiceState( '/rfid_recorder/record',\n RecorderSrv),\n transitions = {'succeeded':'succeeded'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Return_L90_C4", "label": "return", "type": "return", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L29_C0", "vector": [13, 1, 0.4206, 0.0047, 1, 0.65, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sm_search"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:If_L95_C0", "label": "if", "type": "if", "loc": [95, 109], "level": 0, "parent": null, "vector": [4, 0, 0.4766, 0.0701, 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 rospy.init_node('smach_rfid_explore')\n\n sm = sm_search()\n\n sis = IntrospectionServer('sm_rfid_explore', sm, '/SM_ROOT_RFID_EXPLORE')\n sis.start()\n rospy.sleep(3.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Expr_L96_C4", "label": "init_node()", "type": "expression", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99389:If_L95_C0", "vector": [8, 1, 0.4486, 0.0047, 1, 0.97, 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('smach_rfid_explore')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Assign_L98_C4", "label": "sm = sm_search()", "type": "assigned_variable", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99389:If_L95_C0", "vector": [14, 1, 0.4579, 0.0047, 1, 0.97, 0.125, 21, 3, 0, 0, 0, 542, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "sm_search", "annotation": ""}, "snippet": " sm = sm_search()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Assign_L100_C4", "label": "sis = IntrospectionServer()", "type": "assigned_variable", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99389:If_L95_C0", "vector": [14, 1, 0.4673, 0.0047, 1, 0.97, 0.25, 608, 3, 3, 0, 0, 702, 10, 1], "semantic": {"name": "sis", "arg_names": [], "import_names": [], "rhs_call_name": "IntrospectionServer", "annotation": ""}, "snippet": " sis = IntrospectionServer('sm_rfid_explore', sm, '/SM_ROOT_RFID_EXPLORE')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Expr_L101_C4", "label": "start()", "type": "expression", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99389:If_L95_C0", "vector": [8, 1, 0.472, 0.0047, 1, 0.97, 0.375, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " sis.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Expr_L102_C4", "label": "sleep()", "type": "expression", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99389:If_L95_C0", "vector": [8, 1, 0.4766, 0.0047, 1, 0.97, 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(3.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Assign_L104_C4", "label": "sm.userdata.tagid =", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99389:If_L95_C0", "vector": [14, 1, 0.486, 0.0047, 1, 0.97, 0.625, 452, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "sm.userdata.tagid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sm.userdata.tagid = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Assign_L106_C4", "label": "sm.userdata.explore_radius =", "type": "assigned_variable", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99389:If_L95_C0", "vector": [14, 1, 0.4953, 0.0047, 1, 0.97, 0.75, 383, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "sm.userdata.explore_radius", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sm.userdata.explore_radius = 2.7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Assign_L107_C4", "label": "outcome = execute()", "type": "assigned_variable", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99389:If_L95_C0", "vector": [14, 1, 0.5, 0.0047, 1, 0.97, 0.875, 805, 3, 0, 0, 0, 569, 10, 1], "semantic": {"name": "outcome", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " outcome = sm.execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99389:Expr_L109_C4", "label": "stop()", "type": "expression", "loc": [109, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99389:If_L95_C0", "vector": [8, 1, 0.5093, 0.0047, 1, 0.97, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " sis.stop()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99389:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99389:Expr_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99389:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99389:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99389:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99389:Return_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99389:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99389:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99389:Expr_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99389:Return_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99389:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99389:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99389:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99389:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99389:Return_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99389:If_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99389:Expr_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99389:If_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99389:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99389:If_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99389:Assign_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99389:If_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99389:Expr_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99389:If_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99389:Expr_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99389:If_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99389:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99389:If_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99389:Assign_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99389:If_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99389:Assign_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99389:If_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99389:Expr_L109_C4"}]
#! /usr/bin/python import roslib; roslib.load_manifest('rfid_people_following') roslib.load_manifest('std_srvs') roslib.load_manifest('explore_hrl') roslib.load_manifest('move_base_msgs') roslib.load_manifest('actionlib') roslib.load_manifest('geometry_msgs') roslib.load_manifest('tf') roslib.load_manifest('hrl_rfid') import rospy import tf import tf.transformations as tft import actionlib from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal import hrl_rfid.ros_M5e_client as rmc from rfid_people_following.srv import StringInt32_Int32 from rfid_people_following.srv import String_Int32 from rfid_people_following.srv import Int32_Int32 from rfid_people_following.srv import String_StringArr from std_srvs.srv import Empty from geometry_msgs.msg import PointStamped import actionlib import explore_hrl.msg from geometry_msgs.msg import PoseStamped from geometry_msgs.msg import Quaternion import numpy as np, math import time from threading import Thread import os # A more general form of this should be folded back into ros_M5e_client! # It also appears in new_servo_node (rfid_people_following) class rfid_poller( Thread ): def __init__( self, tagid ): Thread.__init__( self ) self.reader = rmc.ROS_M5e_Client('ears') self.listener = tf.TransformListener() self.listener.waitForTransform('/ear_antenna_left', '/map', rospy.Time(0), timeout = rospy.Duration(100) ) self.listener.waitForTransform('/ear_antenna_right', '/map', rospy.Time(0), timeout = rospy.Duration(100) ) self.should_run = True self.should_poll = False self.data = [] self.tagid = tagid self.start() def transform( self, antname ): ps = PointStamped() ps2 = PointStamped() ps2.point.x = 0.1 if antname == 'EleLeftEar': ps.header.frame_id = '/ear_antenna_left' ps.header.stamp = rospy.Time( 0 ) ps2.header.frame_id = '/ear_antenna_left' ps2.header.stamp = rospy.Time( 0 ) elif antname == 'EleRightEar': ps.header.frame_id = '/ear_antenna_right' ps.header.stamp = rospy.Time( 0 ) ps2.header.frame_id = '/ear_antenna_right' ps2.header.stamp = rospy.Time( 0 ) else: rospy.logout( 'Bad ear' ) return False, 0.0, 0.0, 0.0 try: ps_map = self.listener.transformPoint( '/map', ps ) x = ps_map.point.x y = ps_map.point.y #rospy.logout( 'Done 1' ) ps2_map = self.listener.transformPoint( '/map', ps2 ) x2 = ps2_map.point.x y2 = ps2_map.point.y #rospy.logout( 'Done 1' ) # We'll pass back the position of the base (which will be a "safe" place to traverse, whereas the antenna pos not necessarily in the clear) ps_base = PointStamped() ps_base.header.frame_id = '/base_link' ps_base.header.stamp = rospy.Time( 0 ) ps_base_map = self.listener.transformPoint( '/map', ps_base ) x_base = ps_base_map.point.x y_base = ps_base_map.point.y #rospy.logout( 'Transform Success ' + ps.header.frame_id ) return True, x_base, y_base, np.arctan2( y2 - y, x2 - x ) except: rospy.logout( 'Transform failed! ' + ps.header.frame_id ) return False, 0.0, 0.0, 0.0 def start_poller( self ): # Start appending into self.data #self.reader.track_mode( self.tagid ) self.should_poll = True def stop_poller( self ): # Stop appending into self.data #self.reader.stop() self.should_poll = False def run( self ): rospy.logout( 'rfid_poller: Starting' ) while self.should_run and not rospy.is_shutdown(): if self.should_poll: left = self.reader.read('EleLeftEar')[-1] success, x, y, ang = self.transform( 'EleLeftEar' ) if success: self.data.append( [left, [x,y,ang]] ) right = self.reader.read('EleRightEar')[-1] success, x, y, ang = self.transform( 'EleRightEar' ) if success: self.data.append( [right, [x,y,ang]] ) else: rospy.sleep( 0.050 ) try: # Shut it down to conserve power. Something of a race condition (exception) self.reader.stop() except: pass rospy.logout( 'rfid_poller: Exiting' ) def stop( self ): # Kill off the poller thread. self.should_run = False self.join(5) # if (self.isAlive()): # raise RuntimeError("rfid_poller: Unable to stop thread") # A more general form of this should be folded back into orient_node (rfid_people_following)! class Flapper( Thread ): def __init__( self, tagid = 'person '): Thread.__init__( self ) rospy.logout('Flapper: Initializing' ) rospy.wait_for_service( '/rfid_orient/flap' ) rospy.logout('Flapper: flap service ready.' ) self._flap = rospy.ServiceProxy( '/rfid_orient/flap', String_StringArr ) self.flap = lambda : self._flap( tagid ) self.should_run = True self.should_flap = False self.start() def start_flapper( self ): # Start appending into self.data #self.reader.track_mode( self.tagid ) self.should_flap = True def stop_flapper( self ): # Stop appending into self.data #self.reader.stop() self.should_flap = False def run( self ): rospy.logout( 'Flapper: Starting' ) r = rospy.Rate( 10 ) while self.should_run and not rospy.is_shutdown(): if self.should_flap: self.flap() else: r.sleep() rospy.logout( 'Flapper: Exiting' ) def stop( self ): # Kill off the poller thread. self.should_run = False self.join(15) if (self.isAlive()): raise RuntimeError("Flapper: Unable to stop thread") def navstack( x, y, ang ): try: rospy.logout( 'Requesting navstack move to <x,y,ang-deg> %3.3f %3.3f %3.3f.' % (x, y, math.degrees(ang)) ) client = actionlib.SimpleActionClient( 'move_base', MoveBaseAction ) client.wait_for_server() ps = PoseStamped() ps.header.frame_id = '/map' ps.header.stamp = rospy.Time(0) ps.pose.position.x = x ps.pose.position.y = y ps.pose.orientation = Quaternion( *tft.quaternion_from_euler( 0.0, 0.0, ang )) goal = MoveBaseGoal( ps ) client.send_goal( goal ) rospy.logout( 'Waiting for base to stop moving.' ) client.wait_for_result() rospy.logout( 'Successfully navigated to desired position.' ) return True except: rospy.logout( 'Navstack did not achieve desired position.' ) return False class RFIDSearch(): def __init__( self ): try: rospy.init_node( 'rfid_search' ) except: pass rospy.logout( 'rfid_search: Initializing.' ) #rospy.wait_for_service( '/rfid_servo/servo' ) rospy.wait_for_service( '/rfid_orient/orient' ) rospy.wait_for_service( '/rfid_orient/flap' ) #rospy.wait_for_service( '/rfid_demo/demo' ) #rospy.wait_for_service( '/rfid_gui/select' ) self.explore_act = actionlib.SimpleActionClient('explore', explore_hrl.msg.ExploreAction) rospy.logout( 'rfid_search: Waiting for explore.' ) self.explore_act.wait_for_server() rospy.logout( 'rfid_search: Done Initializing.' ) #self._servo = rospy.ServiceProxy( '/rfid_servo/servo', StringInt32_Int32 ) #self.follow1 = lambda : self._servo( 'person ', 1 ) # Stops at first obs #self.follow = lambda : self._servo( 'person ', 0 ) # Runs forever #self._demo = rospy.ServiceProxy( '/rfid_demo/demo', Empty ) #self.demo = lambda : self._demo() #self._servo_stop = rospy.ServiceProxy( '/rfid_servo/stop_next_obs', Int32_Int32 ) #self.servo_toggle = lambda : self._servo_stop( 1 ) self._orient = rospy.ServiceProxy( '/rfid_orient/orient', String_Int32 ) self.orient = lambda tagid: self._orient( tagid ) self.rp = rfid_poller('person ') self.flapper = Flapper() rospy.logout( 'rfid_search: ready to go!' ) def wait_for_finish( self, radius = 2.0 ): print 'Starting RFID tag scanning' self.rp.start_poller() self.flapper.start_flapper() rospy.sleep( 0.3 ) print 'Starting Search' goal = explore_hrl.msg.ExploreGoal( radius = radius ) self.explore_act.send_goal(goal) rospy.sleep( 0.5 ) self.explore_act.wait_for_result() res = self.explore_act.get_result() print 'Search Complete: ', res status = self.explore_act.get_state() print 'Disabling RFID scanning' self.flapper.stop_flapper() self.rp.stop_poller() print 'Computing Best Position' readings = self.rp.data print readings rr = list( self.rp.data ) # rfid_reads: [ [rssi,[x,y,ang]], ...] rssi = [ r for r,vec in rr ] max_rssi, max_pose = rr[ np.argmax( rssi ) ] print 'Moving to best Position: ', max_pose, ' RSSI: ', max_rssi navstack( *max_pose ) print 'Executing Remainder of Demo' # if (os.environ.has_key('ROBOT') and os.environ['ROBOT'] == 'sim'): # self.follow1() # Only do servoing in simulation # else: # try: # self.demo() # Run the full demo IRL # except: # for some reason, NoneType throws exception... # pass print 'Shutting down threads' self.rp.stop() self.flapper.stop() if status == actionlib.GoalStatus.SUCCEEDED: return 'succeeded' else: return 'aborted' if __name__ == '__main__': rs = RFIDSearch() time.sleep( 3 ) rs.wait_for_finish( radius = 1.7 ) #print rs.flap() # while True: # print 'DoneSearching: ', rs.doneSearching()
ajibawa-2023/Python-Code-Large/train/row_99390
193
302
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0099, 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_99390:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0132, 0.0033, 0, 0.66, 0.0303, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('rfid_people_following')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0166, 0.0033, 0, 0.66, 0.0606, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('std_srvs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0199, 0.0033, 0, 0.66, 0.0909, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('explore_hrl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0232, 0.0033, 0, 0.66, 0.1212, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('move_base_msgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0265, 0.0033, 0, 0.66, 0.1515, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('actionlib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L9_C0", "label": "load_manifest()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0298, 0.0033, 0, 0.66, 0.1818, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('geometry_msgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L10_C0", "label": "load_manifest()", "type": "expression", "loc": [10, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0331, 0.0033, 0, 0.66, 0.2121, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('tf')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L11_C0", "label": "load_manifest()", "type": "expression", "loc": [11, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0364, 0.0033, 0, 0.66, 0.2424, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('hrl_rfid')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Import_L12_C0", "label": "rospy import rospy", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0397, 0.0033, 0, 0.66, 0.2727, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Import_L14_C0", "label": "tf import tf", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0464, 0.0033, 0, 0.66, 0.303, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "tf", "arg_names": [], "import_names": ["tf"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Import_L15_C0", "label": "tf.transformations import tft", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0497, 0.0033, 0, 0.66, 0.3333, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tft"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tft"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Import_L16_C0", "label": "actionlib import actionlib", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.053, 0.0033, 0, 0.66, 0.3636, 694, 0, 1, 0, 0, 694, 0, 0], "semantic": {"name": "actionlib", "arg_names": [], "import_names": ["actionlib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import actionlib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:ImportFrom_L17_C0", "label": "from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0563, 0.0033, 0, 0.66, 0.3939, 440, 0, 2, 0, 0, 440, 0, 0], "semantic": {"name": "move_base_msgs.msg", "arg_names": [], "import_names": ["MoveBaseAction", "MoveBaseGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Import_L18_C0", "label": "hrl_rfid.ros_M5e_client import rmc", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0596, 0.0033, 0, 0.66, 0.4242, 460, 0, 1, 0, 0, 460, 0, 0], "semantic": {"name": "hrl_rfid.ros_M5e_client", "arg_names": [], "import_names": ["rmc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_rfid.ros_M5e_client as rmc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:ImportFrom_L20_C0", "label": "from rfid_people_following.srv import StringInt32_Int32", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0662, 0.0033, 0, 0.66, 0.4545, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["StringInt32_Int32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import StringInt32_Int32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:ImportFrom_L21_C0", "label": "from rfid_people_following.srv import String_Int32", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0695, 0.0033, 0, 0.66, 0.4848, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["String_Int32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import String_Int32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:ImportFrom_L22_C0", "label": "from rfid_people_following.srv import Int32_Int32", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0728, 0.0033, 0, 0.66, 0.5152, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["Int32_Int32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import Int32_Int32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:ImportFrom_L23_C0", "label": "from rfid_people_following.srv import String_StringArr", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.0762, 0.0033, 0, 0.66, 0.5455, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["String_StringArr"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import String_StringArr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:ImportFrom_L24_C0", "label": "from std_srvs.srv import Empty", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0795, 0.0033, 0, 0.66, 0.5758, 261, 0, 1, 0, 0, 261, 0, 0], "semantic": {"name": "std_srvs.srv", "arg_names": [], "import_names": ["Empty"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_srvs.srv import Empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:ImportFrom_L25_C0", "label": "from geometry_msgs.msg import PointStamped", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.0828, 0.0033, 0, 0.66, 0.6061, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["PointStamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import PointStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Import_L26_C0", "label": "actionlib import actionlib", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.0861, 0.0033, 0, 0.66, 0.6364, 694, 0, 1, 0, 0, 694, 0, 0], "semantic": {"name": "actionlib", "arg_names": [], "import_names": ["actionlib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import actionlib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Import_L27_C0", "label": "explore_hrl.msg import explore_hrl.msg", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.0894, 0.0033, 0, 0.66, 0.6667, 232, 0, 1, 0, 0, 232, 0, 0], "semantic": {"name": "explore_hrl.msg", "arg_names": [], "import_names": ["explore_hrl.msg"], "rhs_call_name": "", "annotation": ""}, "snippet": "import explore_hrl.msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:ImportFrom_L29_C0", "label": "from geometry_msgs.msg import PoseStamped", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.096, 0.0033, 0, 0.66, 0.697, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["PoseStamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import PoseStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:ImportFrom_L30_C0", "label": "from geometry_msgs.msg import Quaternion", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.0993, 0.0033, 0, 0.66, 0.7273, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Quaternion"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Quaternion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Import_L32_C0", "label": "numpy import np, math", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.106, 0.0033, 0, 0.66, 0.7576, 954, 0, 2, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np", "math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np, math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Import_L33_C0", "label": "time import time", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.1093, 0.0033, 0, 0.66, 0.7879, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:ImportFrom_L34_C0", "label": "from threading import Thread", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.1126, 0.0033, 0, 0.66, 0.8182, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["Thread"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import Thread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Import_L35_C0", "label": "os import os", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.1159, 0.0033, 0, 0.66, 0.8485, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L40_C0", "label": "rfid_poller", "type": "class", "loc": [40, 138], "level": 0, "parent": null, "vector": [3, 0, 0.2947, 0.3278, 0, 0.66, 0.8788, 763, 0, 6, 0, 0, 134, 0, 36], "semantic": {"name": "rfid_poller", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class rfid_poller( Thread ):\n def __init__( self, tagid ):\n Thread.__init__( self )\n self.reader = rmc.ROS_M5e_Client('ears')\n self.listener = tf.TransformListener()\n self.listener.waitForTransform('/ear_antenna_left', '/map',\n rospy.Time(0), timeout = rospy.Duration(100) )\n self.listener.waitForTransform('/ear_antenna_right', '/map',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L41_C4", "label": "__init__", "type": "function", "loc": [41, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L40_C0", "vector": [2, 1, 0.1573, 0.0464, 1, 0.73, 0.0, 555, 0, 2, 0, 0, 0, 0, 10], "semantic": {"name": "__init__", "arg_names": ["self", "tagid"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, tagid ):\n Thread.__init__( self )\n self.reader = rmc.ROS_M5e_Client('ears')\n self.listener = tf.TransformListener()\n self.listener.waitForTransform('/ear_antenna_left', '/map',\n rospy.Time(0), timeout = rospy.Duration(100) )\n self.listener.waitForTransform('/ear_antenna_right', '/map',\n rospy.Time(0), timeout = rospy.Duration(100) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L42_C8", "label": "__init__()", "type": "expression", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L41_C4", "vector": [8, 2, 0.1391, 0.0033, 2, 0.26, 0.0, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Thread.__init__( self )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L43_C8", "label": "self.reader = ROS_M5e_Client()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L41_C4", "vector": [14, 2, 0.1424, 0.0033, 2, 0.26, 0.1111, 536, 3, 1, 0, 0, 479, 10, 1], "semantic": {"name": "self.reader", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_M5e_Client", "annotation": ""}, "snippet": " self.reader = rmc.ROS_M5e_Client('ears')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L44_C8", "label": "self.listener = TransformListener()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L41_C4", "vector": [14, 2, 0.1457, 0.0033, 2, 0.26, 0.2222, 686, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.listener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L45_C8", "label": "waitForTransform()", "type": "expression", "loc": [45, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L41_C4", "vector": [8, 2, 0.1507, 0.0066, 2, 0.26, 0.3333, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.listener.waitForTransform('/ear_antenna_left', '/map',\n rospy.Time(0), timeout = rospy.Duration(100) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L47_C8", "label": "waitForTransform()", "type": "expression", "loc": [47, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L41_C4", "vector": [8, 2, 0.1573, 0.0066, 2, 0.26, 0.4444, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.listener.waitForTransform('/ear_antenna_right', '/map',\n rospy.Time(0), timeout = rospy.Duration(100) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L50_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L41_C4", "vector": [14, 2, 0.1656, 0.0033, 2, 0.26, 0.5556, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L51_C8", "label": "self.should_poll =", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L41_C4", "vector": [14, 2, 0.1689, 0.0033, 2, 0.26, 0.6667, 471, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_poll", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_poll = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L52_C8", "label": "self.data =", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L41_C4", "vector": [14, 2, 0.1722, 0.0033, 2, 0.26, 0.7778, 838, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.data = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L53_C8", "label": "self.tagid =", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L41_C4", "vector": [14, 2, 0.1755, 0.0033, 2, 0.26, 0.8889, 251, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tagid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tagid = tagid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L54_C8", "label": "start()", "type": "expression", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L41_C4", "vector": [8, 2, 0.1788, 0.0033, 2, 0.26, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L56_C4", "label": "transform", "type": "function", "loc": [56, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L40_C0", "vector": [2, 1, 0.2583, 0.149, 1, 0.73, 0.2, 48, 0, 2, 1, 0, 0, 0, 14], "semantic": {"name": "transform", "arg_names": ["self", "antname"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def transform( self, antname ):\n ps = PointStamped()\n ps2 = PointStamped()\n ps2.point.x = 0.1\n\n if antname == 'EleLeftEar':\n ps.header.frame_id = '/ear_antenna_left'\n ps.header.stamp = rospy.Time( 0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L57_C8", "label": "ps = PointStamped()", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L56_C4", "vector": [14, 2, 0.1887, 0.0033, 2, 0.08, 0.0, 232, 3, 0, 0, 0, 969, 10, 1], "semantic": {"name": "ps", "arg_names": [], "import_names": [], "rhs_call_name": "PointStamped", "annotation": ""}, "snippet": " ps = PointStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L58_C8", "label": "ps2 = PointStamped()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L56_C4", "vector": [14, 2, 0.1921, 0.0033, 2, 0.08, 0.25, 298, 3, 0, 0, 0, 969, 10, 1], "semantic": {"name": "ps2", "arg_names": [], "import_names": [], "rhs_call_name": "PointStamped", "annotation": ""}, "snippet": " ps2 = PointStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L59_C8", "label": "ps2.point.x =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L56_C4", "vector": [14, 2, 0.1954, 0.0033, 2, 0.08, 0.5, 634, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "ps2.point.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps2.point.x = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L61_C8", "label": "if", "type": "if", "loc": [61, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L56_C4", "vector": [4, 2, 0.2252, 0.0497, 2, 0.08, 0.75, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if antname == 'EleLeftEar':\n ps.header.frame_id = '/ear_antenna_left'\n ps.header.stamp = rospy.Time( 0 )\n\n ps2.header.frame_id = '/ear_antenna_left'\n ps2.header.stamp = rospy.Time( 0 )\n elif antname == 'EleRightEar':\n ps.header.frame_id = '/ear_antenna_right'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L62_C12", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L61_C8", "vector": [14, 3, 0.2053, 0.0033, 3, 0.26, 0.0, 293, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ps.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.header.frame_id = '/ear_antenna_left'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L63_C12", "label": "ps.header.stamp = Time()", "type": "assigned_variable", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L61_C8", "vector": [14, 3, 0.2086, 0.0033, 3, 0.26, 0.25, 161, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " ps.header.stamp = rospy.Time( 0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L65_C12", "label": "ps2.header.frame_id =", "type": "assigned_variable", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L61_C8", "vector": [14, 3, 0.2152, 0.0033, 3, 0.26, 0.5, 869, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ps2.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps2.header.frame_id = '/ear_antenna_left'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L66_C12", "label": "ps2.header.stamp = Time()", "type": "assigned_variable", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L61_C8", "vector": [14, 3, 0.2185, 0.0033, 3, 0.26, 0.75, 334, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "ps2.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " ps2.header.stamp = rospy.Time( 0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L67_C8", "label": "if", "type": "if", "loc": [67, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L61_C8", "vector": [4, 3, 0.2351, 0.0298, 3, 0.26, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif antname == 'EleRightEar':\n ps.header.frame_id = '/ear_antenna_right'\n ps.header.stamp = rospy.Time( 0 )\n\n ps2.header.frame_id = '/ear_antenna_right'\n ps2.header.stamp = rospy.Time( 0 )\n else:\n rospy.logout( 'Bad ear' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L68_C12", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [68, 68], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L67_C8", "vector": [14, 4, 0.2252, 0.0033, 4, 0.54, 0.0, 293, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ps.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.header.frame_id = '/ear_antenna_right'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L69_C12", "label": "ps.header.stamp = Time()", "type": "assigned_variable", "loc": [69, 69], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L67_C8", "vector": [14, 4, 0.2285, 0.0033, 4, 0.54, 0.2, 161, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " ps.header.stamp = rospy.Time( 0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L71_C12", "label": "ps2.header.frame_id =", "type": "assigned_variable", "loc": [71, 71], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L67_C8", "vector": [14, 4, 0.2351, 0.0033, 4, 0.54, 0.4, 869, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ps2.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps2.header.frame_id = '/ear_antenna_right'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L72_C12", "label": "ps2.header.stamp = Time()", "type": "assigned_variable", "loc": [72, 72], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L67_C8", "vector": [14, 4, 0.2384, 0.0033, 4, 0.54, 0.6, 334, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "ps2.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " ps2.header.stamp = rospy.Time( 0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L74_C12", "label": "logout()", "type": "expression", "loc": [74, 74], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L67_C8", "vector": [8, 4, 0.245, 0.0033, 4, 0.54, 0.8, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'Bad ear' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Return_L75_C12", "label": "return", "type": "return", "loc": [75, 75], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L67_C8", "vector": [13, 4, 0.2483, 0.0033, 4, 0.54, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False, 0.0, 0.0, 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "label": "try", "type": "try", "loc": [77, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L56_C4", "vector": [7, 2, 0.293, 0.0795, 2, 0.08, 1.0, 0, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n ps_map = self.listener.transformPoint( '/map', ps )\n x = ps_map.point.x\n y = ps_map.point.y\n #rospy.logout( 'Done 1' )\n\n ps2_map = self.listener.transformPoint( '/map', ps2 )\n x2 = ps2_map.point.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L78_C12", "label": "ps_map = transformPoint()", "type": "assigned_variable", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "vector": [14, 3, 0.2583, 0.0033, 3, 0.95, 0.0, 938, 3, 2, 0, 0, 987, 10, 1], "semantic": {"name": "ps_map", "arg_names": [], "import_names": [], "rhs_call_name": "transformPoint", "annotation": ""}, "snippet": " ps_map = self.listener.transformPoint( '/map', ps )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L79_C12", "label": "x =", "type": "assigned_variable", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "vector": [14, 3, 0.2616, 0.0033, 3, 0.95, 0.0833, 190, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = ps_map.point.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L80_C12", "label": "y =", "type": "assigned_variable", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "vector": [14, 3, 0.2649, 0.0033, 3, 0.95, 0.1667, 304, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = ps_map.point.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L83_C12", "label": "ps2_map = transformPoint()", "type": "assigned_variable", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "vector": [14, 3, 0.2748, 0.0033, 3, 0.95, 0.25, 537, 3, 2, 0, 0, 987, 10, 1], "semantic": {"name": "ps2_map", "arg_names": [], "import_names": [], "rhs_call_name": "transformPoint", "annotation": ""}, "snippet": " ps2_map = self.listener.transformPoint( '/map', ps2 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L84_C12", "label": "x2 =", "type": "assigned_variable", "loc": [84, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "vector": [14, 3, 0.2781, 0.0033, 3, 0.95, 0.3333, 837, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x2 = ps2_map.point.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L85_C12", "label": "y2 =", "type": "assigned_variable", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "vector": [14, 3, 0.2815, 0.0033, 3, 0.95, 0.4167, 160, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y2 = ps2_map.point.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L89_C12", "label": "ps_base = PointStamped()", "type": "assigned_variable", "loc": [89, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "vector": [14, 3, 0.2947, 0.0033, 3, 0.95, 0.5, 802, 3, 0, 0, 0, 969, 10, 1], "semantic": {"name": "ps_base", "arg_names": [], "import_names": [], "rhs_call_name": "PointStamped", "annotation": ""}, "snippet": " ps_base = PointStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L90_C12", "label": "ps_base.header.frame_id =", "type": "assigned_variable", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "vector": [14, 3, 0.298, 0.0033, 3, 0.95, 0.5833, 445, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ps_base.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps_base.header.frame_id = '/base_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L91_C12", "label": "ps_base.header.stamp = Time()", "type": "assigned_variable", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "vector": [14, 3, 0.3013, 0.0033, 3, 0.95, 0.6667, 800, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "ps_base.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " ps_base.header.stamp = rospy.Time( 0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L92_C12", "label": "ps_base_map = transformPoint()", "type": "assigned_variable", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "vector": [14, 3, 0.3046, 0.0033, 3, 0.95, 0.75, 679, 3, 2, 0, 0, 987, 10, 1], "semantic": {"name": "ps_base_map", "arg_names": [], "import_names": [], "rhs_call_name": "transformPoint", "annotation": ""}, "snippet": " ps_base_map = self.listener.transformPoint( '/map', ps_base )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L93_C12", "label": "x_base =", "type": "assigned_variable", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "vector": [14, 3, 0.3079, 0.0033, 3, 0.95, 0.8333, 223, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_base", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_base = ps_base_map.point.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L94_C12", "label": "y_base =", "type": "assigned_variable", "loc": [94, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "vector": [14, 3, 0.3113, 0.0033, 3, 0.95, 0.9167, 536, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y_base", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_base = ps_base_map.point.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Return_L97_C12", "label": "return", "type": "return", "loc": [97, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "vector": [13, 3, 0.3212, 0.0033, 3, 0.95, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True, x_base, y_base, np.arctan2( y2 - y, x2 - x )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L99_C12", "label": "logout()", "type": "expression", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "vector": [8, 3, 0.3278, 0.0033, 3, 0.95, 0.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'Transform failed! ' + ps.header.frame_id )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Return_L100_C12", "label": "return", "type": "return", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "vector": [13, 3, 0.3311, 0.0033, 3, 0.95, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False, 0.0, 0.0, 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L103_C4", "label": "start_poller", "type": "function", "loc": [103, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L40_C0", "vector": [2, 1, 0.346, 0.0132, 1, 0.73, 0.4, 550, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "start_poller", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_poller( self ):\n # Start appending into self.data\n #self.reader.track_mode( self.tagid )\n self.should_poll = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L106_C8", "label": "self.should_poll =", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L103_C4", "vector": [14, 2, 0.351, 0.0033, 2, 0.05, 0.0, 471, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_poll", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_poll = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L108_C4", "label": "stop_poller", "type": "function", "loc": [108, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L40_C0", "vector": [2, 1, 0.3626, 0.0132, 1, 0.73, 0.6, 692, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "stop_poller", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop_poller( self ):\n # Stop appending into self.data\n #self.reader.stop()\n self.should_poll = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L111_C8", "label": "self.should_poll =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L108_C4", "vector": [14, 2, 0.3675, 0.0033, 2, 0.76, 0.0, 471, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_poll", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_poll = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L113_C4", "label": "run", "type": "function", "loc": [113, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L40_C0", "vector": [2, 1, 0.4073, 0.0695, 1, 0.73, 0.8, 679, 0, 1, 0, 0, 0, 0, 11], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run( self ):\n rospy.logout( 'rfid_poller: Starting' )\n while self.should_run and not rospy.is_shutdown():\n if self.should_poll:\n left = self.reader.read('EleLeftEar')[-1]\n success, x, y, ang = self.transform( 'EleLeftEar' )\n if success:\n self.data.append( [left, [x,y,ang]] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L114_C8", "label": "logout()", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L113_C4", "vector": [8, 2, 0.3775, 0.0033, 2, 0.7, 0.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'rfid_poller: Starting' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:While_L115_C8", "label": "while", "type": "while", "loc": [115, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L113_C4", "vector": [5, 2, 0.4007, 0.043, 2, 0.7, 0.3333, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.should_run and not rospy.is_shutdown():\n if self.should_poll:\n left = self.reader.read('EleLeftEar')[-1]\n success, x, y, ang = self.transform( 'EleLeftEar' )\n if success:\n self.data.append( [left, [x,y,ang]] )\n\n right = self.reader.read('EleRightEar')[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L116_C12", "label": "if", "type": "if", "loc": [116, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:While_L115_C8", "vector": [4, 3, 0.4023, 0.0397, 3, 0.95, 0.0, 0, 7, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.should_poll:\n left = self.reader.read('EleLeftEar')[-1]\n success, x, y, ang = self.transform( 'EleLeftEar' )\n if success:\n self.data.append( [left, [x,y,ang]] )\n\n right = self.reader.read('EleRightEar')[-1]\n success, x, y, ang = self.transform( 'EleRightEar' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L117_C16", "label": "left =", "type": "assigned_variable", "loc": [117, 117], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L116_C12", "vector": [14, 4, 0.3874, 0.0033, 4, 0.2, 0.0, 605, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "left", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " left = self.reader.read('EleLeftEar')[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L118_C16", "label": "success, x, y, ang = transform()", "type": "assigned_variable", "loc": [118, 118], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L116_C12", "vector": [14, 4, 0.3907, 0.0033, 4, 0.2, 0.1667, 475, 3, 1, 0, 0, 48, 10, 1], "semantic": {"name": "success, x, y, ang", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " success, x, y, ang = self.transform( 'EleLeftEar' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L119_C16", "label": "if", "type": "if", "loc": [119, 120], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L116_C12", "vector": [4, 4, 0.3957, 0.0066, 4, 0.2, 0.3333, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if success:\n self.data.append( [left, [x,y,ang]] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L120_C20", "label": "append()", "type": "expression", "loc": [120, 120], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L119_C16", "vector": [8, 5, 0.3974, 0.0033, 5, 0.66, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.data.append( [left, [x,y,ang]] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L122_C16", "label": "right =", "type": "assigned_variable", "loc": [122, 122], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L116_C12", "vector": [14, 4, 0.404, 0.0033, 4, 0.2, 0.5, 724, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "right", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " right = self.reader.read('EleRightEar')[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L123_C16", "label": "success, x, y, ang = transform()", "type": "assigned_variable", "loc": [123, 123], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L116_C12", "vector": [14, 4, 0.4073, 0.0033, 4, 0.2, 0.6667, 475, 3, 1, 0, 0, 48, 10, 1], "semantic": {"name": "success, x, y, ang", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " success, x, y, ang = self.transform( 'EleRightEar' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L124_C16", "label": "if", "type": "if", "loc": [124, 125], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L116_C12", "vector": [4, 4, 0.4123, 0.0066, 4, 0.2, 0.8333, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if success:\n self.data.append( [right, [x,y,ang]] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L125_C20", "label": "append()", "type": "expression", "loc": [125, 125], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L124_C16", "vector": [8, 5, 0.4139, 0.0033, 5, 0.88, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.data.append( [right, [x,y,ang]] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L127_C16", "label": "sleep()", "type": "expression", "loc": [127, 127], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L116_C12", "vector": [8, 4, 0.4205, 0.0033, 4, 0.2, 1.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( 0.050 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L129_C8", "label": "try", "type": "try", "loc": [129, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L113_C4", "vector": [7, 2, 0.4321, 0.0132, 2, 0.7, 0.6667, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try: # Shut it down to conserve power. Something of a race condition (exception)\n self.reader.stop()\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L130_C12", "label": "stop()", "type": "expression", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L129_C8", "vector": [8, 3, 0.4305, 0.0033, 3, 0.57, 0.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " self.reader.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L133_C8", "label": "logout()", "type": "expression", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L113_C4", "vector": [8, 2, 0.4404, 0.0033, 2, 0.7, 1.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'rfid_poller: Exiting' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L135_C4", "label": "stop", "type": "function", "loc": [135, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L40_C0", "vector": [2, 1, 0.452, 0.0132, 1, 0.73, 1.0, 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 # Kill off the poller thread.\n self.should_run = False\n self.join(5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L137_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L135_C4", "vector": [14, 2, 0.4536, 0.0033, 2, 0.06, 0.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L138_C8", "label": "join()", "type": "expression", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L135_C4", "vector": [8, 2, 0.457, 0.0033, 2, 0.06, 1.0, 933, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.join(5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L144_C0", "label": "Flapper", "type": "class", "loc": [144, 184], "level": 0, "parent": null, "vector": [3, 0, 0.543, 0.1358, 0, 0.66, 0.9091, 540, 0, 5, 0, 0, 134, 0, 16], "semantic": {"name": "Flapper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Flapper( Thread ):\n def __init__( self, tagid = 'person '):\n Thread.__init__( self )\n rospy.logout('Flapper: Initializing' )\n rospy.wait_for_service( '/rfid_orient/flap' )\n rospy.logout('Flapper: flap service ready.' )\n\n self._flap = rospy.ServiceProxy( '/rfid_orient/flap', String_StringArr )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L145_C4", "label": "__init__", "type": "function", "loc": [145, 156], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L144_C0", "vector": [2, 1, 0.4983, 0.0397, 1, 0.76, 0.0, 555, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "__init__", "arg_names": ["self", "tagid"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, tagid = 'person '):\n Thread.__init__( self )\n rospy.logout('Flapper: Initializing' )\n rospy.wait_for_service( '/rfid_orient/flap' )\n rospy.logout('Flapper: flap service ready.' )\n\n self._flap = rospy.ServiceProxy( '/rfid_orient/flap', String_StringArr )\n self.flap = lambda : self._flap( tagid )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L146_C8", "label": "__init__()", "type": "expression", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L145_C4", "vector": [8, 2, 0.4834, 0.0033, 2, 0.45, 0.0, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Thread.__init__( self )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L147_C8", "label": "logout()", "type": "expression", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L145_C4", "vector": [8, 2, 0.4868, 0.0033, 2, 0.45, 0.125, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('Flapper: Initializing' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L148_C8", "label": "wait_for_service()", "type": "expression", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L145_C4", "vector": [8, 2, 0.4901, 0.0033, 2, 0.45, 0.25, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service( '/rfid_orient/flap' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L149_C8", "label": "logout()", "type": "expression", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L145_C4", "vector": [8, 2, 0.4934, 0.0033, 2, 0.45, 0.375, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('Flapper: flap service ready.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L151_C8", "label": "self._flap = ServiceProxy()", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L145_C4", "vector": [14, 2, 0.5, 0.0033, 2, 0.45, 0.5, 835, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._flap", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._flap = rospy.ServiceProxy( '/rfid_orient/flap', String_StringArr )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L152_C8", "label": "self.flap =", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L145_C4", "vector": [14, 2, 0.5033, 0.0033, 2, 0.45, 0.625, 124, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.flap", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.flap = lambda : self._flap( tagid )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L154_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L145_C4", "vector": [14, 2, 0.5099, 0.0033, 2, 0.45, 0.75, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L155_C8", "label": "self.should_flap =", "type": "assigned_variable", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L145_C4", "vector": [14, 2, 0.5132, 0.0033, 2, 0.45, 0.875, 547, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_flap", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_flap = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L156_C8", "label": "start()", "type": "expression", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L145_C4", "vector": [8, 2, 0.5166, 0.0033, 2, 0.45, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L158_C4", "label": "start_flapper", "type": "function", "loc": [158, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L144_C0", "vector": [2, 1, 0.5281, 0.0132, 1, 0.76, 0.25, 112, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "start_flapper", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_flapper( self ):\n # Start appending into self.data\n #self.reader.track_mode( self.tagid )\n self.should_flap = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L161_C8", "label": "self.should_flap =", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L158_C4", "vector": [14, 2, 0.5331, 0.0033, 2, 0.91, 0.0, 547, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_flap", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_flap = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L163_C4", "label": "stop_flapper", "type": "function", "loc": [163, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L144_C0", "vector": [2, 1, 0.5447, 0.0132, 1, 0.76, 0.5, 417, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "stop_flapper", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop_flapper( self ):\n # Stop appending into self.data\n #self.reader.stop()\n self.should_flap = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L166_C8", "label": "self.should_flap =", "type": "assigned_variable", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L163_C4", "vector": [14, 2, 0.5497, 0.0033, 2, 0.73, 0.0, 547, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_flap", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_flap = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L168_C4", "label": "run", "type": "function", "loc": [168, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L144_C0", "vector": [2, 1, 0.5712, 0.0331, 1, 0.76, 0.75, 679, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run( self ):\n rospy.logout( 'Flapper: Starting' )\n r = rospy.Rate( 10 )\n while self.should_run and not rospy.is_shutdown():\n if self.should_flap:\n self.flap()\n else:\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L169_C8", "label": "logout()", "type": "expression", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L168_C4", "vector": [8, 2, 0.5596, 0.0033, 2, 0.73, 0.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'Flapper: Starting' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L170_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L168_C4", "vector": [14, 2, 0.5629, 0.0033, 2, 0.73, 0.3333, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " r = rospy.Rate( 10 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:While_L171_C8", "label": "while", "type": "while", "loc": [171, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L168_C4", "vector": [5, 2, 0.5728, 0.0166, 2, 0.73, 0.6667, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.should_run and not rospy.is_shutdown():\n if self.should_flap:\n self.flap()\n else:\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L172_C12", "label": "if", "type": "if", "loc": [172, 175], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:While_L171_C8", "vector": [4, 3, 0.5745, 0.0132, 3, 0.88, 0.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.should_flap:\n self.flap()\n else:\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L173_C16", "label": "flap()", "type": "expression", "loc": [173, 173], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L172_C12", "vector": [8, 4, 0.5728, 0.0033, 4, 0.42, 0.0, 845, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "flap", "arg_names": [], "import_names": [], "rhs_call_name": "flap", "annotation": ""}, "snippet": " self.flap()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L175_C16", "label": "sleep()", "type": "expression", "loc": [175, 175], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L172_C12", "vector": [8, 4, 0.5795, 0.0033, 4, 0.42, 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_99390:Expr_L177_C8", "label": "logout()", "type": "expression", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L168_C4", "vector": [8, 2, 0.5861, 0.0033, 2, 0.73, 1.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'Flapper: Exiting' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L179_C4", "label": "stop", "type": "function", "loc": [179, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L144_C0", "vector": [2, 1, 0.601, 0.0199, 1, 0.76, 1.0, 343, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "stop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop( self ):\n # Kill off the poller thread.\n self.should_run = False\n self.join(15)\n if (self.isAlive()):\n raise RuntimeError(\"Flapper: Unable to stop thread\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L181_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L179_C4", "vector": [14, 2, 0.5993, 0.0033, 2, 0.58, 0.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L182_C8", "label": "join()", "type": "expression", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L179_C4", "vector": [8, 2, 0.6026, 0.0033, 2, 0.58, 0.5, 933, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.join(15)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L183_C8", "label": "if", "type": "if", "loc": [183, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L179_C4", "vector": [4, 2, 0.6076, 0.0066, 2, 0.58, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.isAlive()):\n raise RuntimeError(\"Flapper: Unable to stop thread\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L187_C0", "label": "navstack", "type": "function", "loc": [187, 209], "level": 0, "parent": null, "vector": [2, 0, 0.6556, 0.0762, 0, 0.66, 0.9394, 791, 0, 3, 1, 0, 0, 0, 14], "semantic": {"name": "navstack", "arg_names": ["x", "y", "ang"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def navstack( x, y, ang ):\n try:\n rospy.logout( 'Requesting navstack move to <x,y,ang-deg> %3.3f %3.3f %3.3f.' % (x, y, math.degrees(ang)) )\n\n client = actionlib.SimpleActionClient( 'move_base', MoveBaseAction )\n client.wait_for_server()\n\n ps = PoseStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "label": "try", "type": "try", "loc": [188, 209], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L187_C0", "vector": [7, 1, 0.6573, 0.0728, 1, 0.2, 0.0, 0, 0, 1, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.logout( 'Requesting navstack move to <x,y,ang-deg> %3.3f %3.3f %3.3f.' % (x, y, math.degrees(ang)) )\n\n client = actionlib.SimpleActionClient( 'move_base', MoveBaseAction )\n client.wait_for_server()\n\n ps = PoseStamped()\n ps.header.frame_id = '/map'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L189_C8", "label": "logout()", "type": "expression", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "vector": [8, 2, 0.6258, 0.0033, 2, 0.84, 0.0, 525, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'Requesting navstack move to <x,y,ang-deg> %3.3f %3.3f %3.3f.' % (x, y, math.degrees(ang)) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L191_C8", "label": "client = SimpleActionClient()", "type": "assigned_variable", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "vector": [14, 2, 0.6325, 0.0033, 2, 0.84, 0.0714, 608, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " client = actionlib.SimpleActionClient( 'move_base', MoveBaseAction )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L192_C8", "label": "wait_for_server()", "type": "expression", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "vector": [8, 2, 0.6358, 0.0033, 2, 0.84, 0.1429, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_server", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_server", "annotation": ""}, "snippet": " client.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L194_C8", "label": "ps = PoseStamped()", "type": "assigned_variable", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "vector": [14, 2, 0.6424, 0.0033, 2, 0.84, 0.2143, 232, 3, 0, 0, 0, 226, 10, 1], "semantic": {"name": "ps", "arg_names": [], "import_names": [], "rhs_call_name": "PoseStamped", "annotation": ""}, "snippet": " ps = PoseStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L195_C8", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "vector": [14, 2, 0.6457, 0.0033, 2, 0.84, 0.2857, 293, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ps.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.header.frame_id = '/map'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L196_C8", "label": "ps.header.stamp = Time()", "type": "assigned_variable", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "vector": [14, 2, 0.649, 0.0033, 2, 0.84, 0.3571, 161, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " ps.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L197_C8", "label": "ps.pose.position.x =", "type": "assigned_variable", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "vector": [14, 2, 0.6523, 0.0033, 2, 0.84, 0.4286, 782, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.position.x = x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L198_C8", "label": "ps.pose.position.y =", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "vector": [14, 2, 0.6556, 0.0033, 2, 0.84, 0.5, 661, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.position.y = y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L199_C8", "label": "ps.pose.orientation = Quaternion()", "type": "assigned_variable", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "vector": [14, 2, 0.6589, 0.0033, 2, 0.84, 0.5714, 670, 3, 1, 0, 0, 747, 10, 2], "semantic": {"name": "ps.pose.orientation", "arg_names": [], "import_names": [], "rhs_call_name": "Quaternion", "annotation": ""}, "snippet": " ps.pose.orientation = Quaternion( *tft.quaternion_from_euler( 0.0, 0.0, ang ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L201_C8", "label": "goal = MoveBaseGoal()", "type": "assigned_variable", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "vector": [14, 2, 0.6656, 0.0033, 2, 0.84, 0.6429, 914, 3, 1, 0, 0, 968, 10, 1], "semantic": {"name": "goal", "arg_names": [], "import_names": [], "rhs_call_name": "MoveBaseGoal", "annotation": ""}, "snippet": " goal = MoveBaseGoal( ps )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L202_C8", "label": "send_goal()", "type": "expression", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "vector": [8, 2, 0.6689, 0.0033, 2, 0.84, 0.7143, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " client.send_goal( goal )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L203_C8", "label": "logout()", "type": "expression", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "vector": [8, 2, 0.6722, 0.0033, 2, 0.84, 0.7857, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'Waiting for base to stop moving.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L204_C8", "label": "wait_for_result()", "type": "expression", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "vector": [8, 2, 0.6755, 0.0033, 2, 0.84, 0.8571, 328, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_result", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_result", "annotation": ""}, "snippet": " client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L205_C8", "label": "logout()", "type": "expression", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "vector": [8, 2, 0.6788, 0.0033, 2, 0.84, 0.9286, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'Successfully navigated to desired position.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Return_L206_C8", "label": "return", "type": "return", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "vector": [13, 2, 0.6821, 0.0033, 2, 0.84, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L208_C8", "label": "logout()", "type": "expression", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "vector": [8, 2, 0.6887, 0.0033, 2, 0.84, 0.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'Navstack did not achieve desired position.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Return_L209_C8", "label": "return", "type": "return", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "vector": [13, 2, 0.6921, 0.0033, 2, 0.84, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L212_C0", "label": "RFIDSearch", "type": "class", "loc": [212, 293], "level": 0, "parent": null, "vector": [3, 0, 0.8361, 0.2715, 0, 0.66, 0.9697, 848, 0, 2, 0, 0, 0, 0, 38], "semantic": {"name": "RFIDSearch", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RFIDSearch():\n def __init__( self ):\n try:\n rospy.init_node( 'rfid_search' )\n except:\n pass\n \n rospy.logout( 'rfid_search: Initializing.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "label": "__init__", "type": "function", "loc": [213, 246], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L212_C0", "vector": [2, 1, 0.7599, 0.1126, 1, 0.64, 0.0, 555, 0, 1, 0, 0, 0, 0, 13], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self ):\n try:\n rospy.init_node( 'rfid_search' )\n except:\n pass\n \n rospy.logout( 'rfid_search: Initializing.' )\n #rospy.wait_for_service( '/rfid_servo/servo' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L214_C8", "label": "try", "type": "try", "loc": [214, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "vector": [7, 2, 0.7136, 0.0132, 2, 0.98, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node( 'rfid_search' )\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L215_C12", "label": "init_node()", "type": "expression", "loc": [215, 215], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L214_C8", "vector": [8, 3, 0.7119, 0.0033, 3, 0.82, 0.0, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node( 'rfid_search' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L219_C8", "label": "logout()", "type": "expression", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "vector": [8, 2, 0.7252, 0.0033, 2, 0.98, 0.0833, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'rfid_search: Initializing.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L221_C8", "label": "wait_for_service()", "type": "expression", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "vector": [8, 2, 0.7318, 0.0033, 2, 0.98, 0.1667, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service( '/rfid_orient/orient' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L222_C8", "label": "wait_for_service()", "type": "expression", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "vector": [8, 2, 0.7351, 0.0033, 2, 0.98, 0.25, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service( '/rfid_orient/flap' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L225_C8", "label": "self.explore_act = SimpleActionClient()", "type": "assigned_variable", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "vector": [14, 2, 0.745, 0.0033, 2, 0.98, 0.3333, 635, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "self.explore_act", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.explore_act = actionlib.SimpleActionClient('explore', explore_hrl.msg.ExploreAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L226_C8", "label": "logout()", "type": "expression", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "vector": [8, 2, 0.7483, 0.0033, 2, 0.98, 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( 'rfid_search: Waiting for explore.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L227_C8", "label": "wait_for_server()", "type": "expression", "loc": [227, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "vector": [8, 2, 0.7517, 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.explore_act.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L228_C8", "label": "logout()", "type": "expression", "loc": [228, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "vector": [8, 2, 0.755, 0.0033, 2, 0.98, 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( 'rfid_search: Done Initializing.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L240_C8", "label": "self._orient = ServiceProxy()", "type": "assigned_variable", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "vector": [14, 2, 0.7947, 0.0033, 2, 0.98, 0.6667, 142, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._orient", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._orient = rospy.ServiceProxy( '/rfid_orient/orient', String_Int32 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L241_C8", "label": "self.orient =", "type": "assigned_variable", "loc": [241, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "vector": [14, 2, 0.798, 0.0033, 2, 0.98, 0.75, 883, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.orient", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.orient = lambda tagid: self._orient( tagid )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L243_C8", "label": "self.rp = rfid_poller()", "type": "assigned_variable", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "vector": [14, 2, 0.8046, 0.0033, 2, 0.98, 0.8333, 429, 3, 1, 0, 0, 763, 10, 1], "semantic": {"name": "self.rp", "arg_names": [], "import_names": [], "rhs_call_name": "rfid_poller", "annotation": ""}, "snippet": " self.rp = rfid_poller('person ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L244_C8", "label": "self.flapper = Flapper()", "type": "assigned_variable", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "vector": [14, 2, 0.8079, 0.0033, 2, 0.98, 0.9167, 227, 3, 0, 0, 0, 540, 10, 1], "semantic": {"name": "self.flapper", "arg_names": [], "import_names": [], "rhs_call_name": "Flapper", "annotation": ""}, "snippet": " self.flapper = Flapper()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L246_C8", "label": "logout()", "type": "expression", "loc": [246, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "vector": [8, 2, 0.8146, 0.0033, 2, 0.98, 1.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'rfid_search: ready to go!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "label": "wait_for_finish", "type": "function", "loc": [248, 293], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L212_C0", "vector": [2, 1, 0.8957, 0.1523, 1, 0.64, 1.0, 249, 0, 2, 1, 0, 0, 0, 25], "semantic": {"name": "wait_for_finish", "arg_names": ["self", "radius"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def wait_for_finish( self, radius = 2.0 ):\n print('Starting RFID tag scanning')\n self.rp.start_poller()\n self.flapper.start_flapper()\n rospy.sleep( 0.3 )\n\n print('Starting Search')\n goal = explore_hrl.msg.ExploreGoal( radius = radius )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L249_C8", "label": "print()", "type": "expression", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [8, 2, 0.8245, 0.0033, 2, 0.88, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Starting RFID tag scanning')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L250_C8", "label": "start_poller()", "type": "expression", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [8, 2, 0.8278, 0.0033, 2, 0.88, 0.037, 550, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start_poller", "arg_names": [], "import_names": [], "rhs_call_name": "start_poller", "annotation": ""}, "snippet": " self.rp.start_poller()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L251_C8", "label": "start_flapper()", "type": "expression", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [8, 2, 0.8311, 0.0033, 2, 0.88, 0.0741, 112, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start_flapper", "arg_names": [], "import_names": [], "rhs_call_name": "start_flapper", "annotation": ""}, "snippet": " self.flapper.start_flapper()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L252_C8", "label": "sleep()", "type": "expression", "loc": [252, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [8, 2, 0.8344, 0.0033, 2, 0.88, 0.1111, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( 0.3 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L254_C8", "label": "print()", "type": "expression", "loc": [254, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [8, 2, 0.8411, 0.0033, 2, 0.88, 0.1481, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Starting Search')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L255_C8", "label": "goal = ExploreGoal()", "type": "assigned_variable", "loc": [255, 255], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [14, 2, 0.8444, 0.0033, 2, 0.88, 0.1852, 914, 3, 1, 0, 0, 717, 10, 1], "semantic": {"name": "goal", "arg_names": [], "import_names": [], "rhs_call_name": "ExploreGoal", "annotation": ""}, "snippet": " goal = explore_hrl.msg.ExploreGoal( radius = radius )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L256_C8", "label": "send_goal()", "type": "expression", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [8, 2, 0.8477, 0.0033, 2, 0.88, 0.2222, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.explore_act.send_goal(goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L257_C8", "label": "sleep()", "type": "expression", "loc": [257, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [8, 2, 0.851, 0.0033, 2, 0.88, 0.2593, 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_99390:Expr_L258_C8", "label": "wait_for_result()", "type": "expression", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [8, 2, 0.8543, 0.0033, 2, 0.88, 0.2963, 328, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_result", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_result", "annotation": ""}, "snippet": " self.explore_act.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L259_C8", "label": "res = get_result()", "type": "assigned_variable", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [14, 2, 0.8576, 0.0033, 2, 0.88, 0.3333, 413, 3, 0, 0, 0, 569, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "get_result", "annotation": ""}, "snippet": " res = self.explore_act.get_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L260_C8", "label": "print()", "type": "expression", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [8, 2, 0.8609, 0.0033, 2, 0.88, 0.3704, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Search Complete: ', res)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L261_C8", "label": "status = get_state()", "type": "assigned_variable", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [14, 2, 0.8642, 0.0033, 2, 0.88, 0.4074, 699, 3, 0, 0, 0, 650, 10, 1], "semantic": {"name": "status", "arg_names": [], "import_names": [], "rhs_call_name": "get_state", "annotation": ""}, "snippet": " status = self.explore_act.get_state()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L263_C8", "label": "print()", "type": "expression", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [8, 2, 0.8709, 0.0033, 2, 0.88, 0.4444, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Disabling RFID scanning')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L264_C8", "label": "stop_flapper()", "type": "expression", "loc": [264, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [8, 2, 0.8742, 0.0033, 2, 0.88, 0.4815, 417, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop_flapper", "arg_names": [], "import_names": [], "rhs_call_name": "stop_flapper", "annotation": ""}, "snippet": " self.flapper.stop_flapper()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L265_C8", "label": "stop_poller()", "type": "expression", "loc": [265, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [8, 2, 0.8775, 0.0033, 2, 0.88, 0.5185, 692, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop_poller", "arg_names": [], "import_names": [], "rhs_call_name": "stop_poller", "annotation": ""}, "snippet": " self.rp.stop_poller()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L267_C8", "label": "print()", "type": "expression", "loc": [267, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [8, 2, 0.8841, 0.0033, 2, 0.88, 0.5556, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Computing Best Position')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L268_C8", "label": "readings =", "type": "assigned_variable", "loc": [268, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [14, 2, 0.8874, 0.0033, 2, 0.88, 0.5926, 608, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "readings", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " readings = self.rp.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L269_C8", "label": "print()", "type": "expression", "loc": [269, 269], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [8, 2, 0.8907, 0.0033, 2, 0.88, 0.6296, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(readings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L270_C8", "label": "rr = list()", "type": "assigned_variable", "loc": [270, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [14, 2, 0.894, 0.0033, 2, 0.88, 0.6667, 220, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "rr", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " rr = list( self.rp.data ) # rfid_reads: [ [rssi,[x,y,ang]], ...]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L271_C8", "label": "rssi =", "type": "assigned_variable", "loc": [271, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [14, 2, 0.8974, 0.0033, 2, 0.88, 0.7037, 906, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rssi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rssi = [ r for r,vec in rr ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L272_C8", "label": "max_rssi, max_pose =", "type": "assigned_variable", "loc": [272, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [14, 2, 0.9007, 0.0033, 2, 0.88, 0.7407, 14, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "max_rssi, max_pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_rssi, max_pose = rr[ np.argmax( rssi ) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L274_C8", "label": "print()", "type": "expression", "loc": [274, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [8, 2, 0.9073, 0.0033, 2, 0.88, 0.7778, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Moving to best Position: ', max_pose, ' RSSI: ', max_rssi)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L275_C8", "label": "navstack()", "type": "expression", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [8, 2, 0.9106, 0.0033, 2, 0.88, 0.8148, 791, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "navstack", "arg_names": [], "import_names": [], "rhs_call_name": "navstack", "annotation": ""}, "snippet": " navstack( *max_pose )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L277_C8", "label": "print()", "type": "expression", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [8, 2, 0.9172, 0.0033, 2, 0.88, 0.8519, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Executing Remainder of Demo')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L286_C8", "label": "print()", "type": "expression", "loc": [286, 286], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [8, 2, 0.947, 0.0033, 2, 0.88, 0.8889, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Shutting down threads')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L287_C8", "label": "stop()", "type": "expression", "loc": [287, 287], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [8, 2, 0.9503, 0.0033, 2, 0.88, 0.9259, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " self.rp.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L288_C8", "label": "stop()", "type": "expression", "loc": [288, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [8, 2, 0.9536, 0.0033, 2, 0.88, 0.963, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " self.flapper.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L290_C8", "label": "if", "type": "if", "loc": [290, 293], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "vector": [4, 2, 0.9652, 0.0132, 2, 0.88, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if status == actionlib.GoalStatus.SUCCEEDED:\n return 'succeeded'\n else:\n return 'aborted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Return_L291_C12", "label": "return", "type": "return", "loc": [291, 291], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L290_C8", "vector": [13, 3, 0.9636, 0.0033, 3, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'succeeded'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Return_L293_C12", "label": "return", "type": "return", "loc": [293, 293], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L290_C8", "vector": [13, 3, 0.9702, 0.0033, 3, 0.55, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'aborted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L295_C0", "label": "if", "type": "if", "loc": [295, 298], "level": 0, "parent": null, "vector": [4, 0, 0.9818, 0.0132, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n rs = RFIDSearch()\n time.sleep( 3 )\n rs.wait_for_finish( radius = 1.7 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L296_C4", "label": "rs = RFIDSearch()", "type": "assigned_variable", "loc": [296, 296], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L295_C0", "vector": [14, 1, 0.9801, 0.0033, 1, 0.77, 0.0, 594, 3, 0, 0, 0, 848, 10, 1], "semantic": {"name": "rs", "arg_names": [], "import_names": [], "rhs_call_name": "RFIDSearch", "annotation": ""}, "snippet": " rs = RFIDSearch()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L297_C4", "label": "sleep()", "type": "expression", "loc": [297, 297], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L295_C0", "vector": [8, 1, 0.9834, 0.0033, 1, 0.77, 0.5, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep( 3 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L298_C4", "label": "wait_for_finish()", "type": "expression", "loc": [298, 298], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L295_C0", "vector": [8, 1, 0.9868, 0.0033, 1, 0.77, 1.0, 249, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_finish", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_finish", "annotation": ""}, "snippet": " rs.wait_for_finish( radius = 1.7 )"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Return_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L94_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Return_L97_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Return_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:While_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:While_L115_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L116_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L117_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L116_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L118_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L116_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L119_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L119_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L120_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L116_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L122_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L116_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L123_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L116_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L124_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L124_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L125_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L116_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L127_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L144_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L144_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L144_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L144_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:While_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:While_L171_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L172_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L173_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L172_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L175_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L144_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L187_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Return_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Return_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L212_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:Try_L214_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L215_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:ClassDef_L212_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L254_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L255_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L257_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L259_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L265_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L267_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L270_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L272_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L274_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L286_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L287_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L288_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L290_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L290_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Return_L291_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L290_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Return_L293_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Assign_L296_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L297_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99390:If_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99390:Expr_L298_C4"}]
#! /usr/bin/python import roslib roslib.load_manifest('rfid_demos') import rospy import smach from smach_ros import SimpleActionState, ServiceState, IntrospectionServer import actionlib from rfid_servoing.msg import ServoAction, ServoGoal from rfid_artoolkit.msg import UpCloseAction, UpCloseGoal from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal from explore_hrl.msg import ExploreAction, ExploreActionGoal from rfid_behaviors.srv import HandoffSrv from rfid_behaviors.srv import FlapEarsSrv from rfid_behaviors.srv import OrientSrv, OrientSrvRequest from robotis.srv import MoveAng, MoveAngRequest # import rfid_search import yaml def sm_delivery(): # Create a SMACH state machine sm = smach.StateMachine( outcomes = ['succeeded','aborted','preempted'], input_keys = ['tagid']) # Open the container with sm: # smach.StateMachine.add( # 'EXPLORE', # Explore(), # transitions = { 'succeeded' : 'FLAP_EARS', # 'aborted' : 'RECOVER_ONCE' }) # smach.StateMachine.add( # 'RECOVER_ONCE', # RecoverOnce(), # transitions = { 'succeeded' : 'EXPLORE', # 'aborted' : 'aborted' }) # Initial RFID Ear Flapping smach.StateMachine.add( 'FLAP_EARS', ServiceState( '/rfid_orient/flap', FlapEarsSrv ), transitions = { 'succeeded' : 'ORIENT' }) # Orient towards tag smach.StateMachine.add( 'ORIENT', ServiceState( '/rfid_orient/orient', OrientSrv, request_slots = ['data'], input_keys=['data']), # tagid (string) transitions = { 'succeeded' : 'SERVO' }, remapping = {'data':'tagid'}) # input # Servoing is a basic state machine. Success means servoing finished @ obs. smach.StateMachine.add( 'SERVO', SimpleActionState( '/rfid_servo/servo_act', ServoAction, goal_slots = ['tagid']), #goal = ServoGoal( 'person ' ), transitions = { 'succeeded': 'TUCK_LEFT' }, remapping = {'tagid':'tagid'}) # input # # ARTag scanner. Result is actually stored in result message "status" # # Remap based on upclose_action result # def ar_detect_cb( userdata, status, result ): # if result.status == 'SUCCEEDED': # Actionlib Succeeded: Found the tag! # userdata.tag_pos = result.ps # return 'succeeded' # elif result.status == 'FAILED': # Actionlib Succeed, but no tag found. # return 'recover' # elif result.status == 'PREEMPTED': # Actionlib was preempted (higher level) # return 'preempted' # else: # result.status == 'RESERVO' # Obstacle from servo cleared. Self-preempt to reservo. # return 'reservo' # smach.StateMachine.add( # 'ARTAG', # SimpleActionState( '/rfid_artoolkit/upclose_act', # UpCloseAction, # goal_slots = ['tagid'], #goal = UpCloseGoal( 'person ' ) # output_keys = ['tag_pos'], # outcomes = ['succeeded', 'recover', 'preempted', 'reservo'], # result_cb = ar_detect_cb ), # transitions = { 'recover' : 'aborted', # 'reservo' : 'HEAD_REPOS', # 'succeeded': 'TUCK_LEFT' }, # remapping = {'tagid':'tagid'}) # input # # Reposition the head: # goal = PointHeadGoal() # goal.target.header.frame_id = '/torso_lift_link' # goal.target.point.x = 0.54 # goal.target.point.z = 0.35 # goal.min_duration = rospy.Duration(0.6) # smach.StateMachine.add( # 'HEAD_REPOS', # SimpleActionState( '/head_traj_controller/point_head_action', # PointHeadAction, # goal = goal ), # transitions = { 'succeeded' : 'SERVO' }) # Tuck Left (non-blocking) smach.StateMachine.add( 'TUCK_LEFT', ServiceState( 'robotis/servo_left_pan_moveangle', MoveAng, request = MoveAngRequest( 1.350, 0.2, 0 )), # ang (float), angvel (float), blocking (bool) transitions = {'succeeded':'TUCK_RIGHT'}) # Tuck Right (non-blocking) smach.StateMachine.add( 'TUCK_RIGHT', ServiceState( 'robotis/servo_right_pan_moveangle', MoveAng, request = MoveAngRequest( -1.350, 0.2, 0 )), # ang (float), angvel (float), blocking (bool) transitions = {'succeeded':'HANDOFF'}) # Handoff if tag found smach.StateMachine.add( 'HANDOFF', ServiceState( '/rfid_handoff/handoff', HandoffSrv ), transitions = { 'succeeded' : 'succeeded' }) # Execute SMACH plan return sm if __name__ == '__main__': rospy.init_node('smach_example_state_machine') sm = sm_delivery() sis = IntrospectionServer('RFID_delivery', sm, '/SM_ROOT') sis.start() sm.userdata.tagid = 'person ' outcome = sm.execute() rospy.spin() sis.stop()
ajibawa-2023/Python-Code-Large/train/row_99391
33
153
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99391:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0131, 0.0065, 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_99391:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0196, 0.0065, 0, 0.66, 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": "roslib.load_manifest('rfid_demos')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0261, 0.0065, 0, 0.66, 0.125, 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_99391:Import_L6_C0", "label": "smach import smach", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0392, 0.0065, 0, 0.66, 0.1875, 345, 0, 1, 0, 0, 345, 0, 0], "semantic": {"name": "smach", "arg_names": [], "import_names": ["smach"], "rhs_call_name": "", "annotation": ""}, "snippet": "import smach"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:ImportFrom_L7_C0", "label": "from smach_ros import SimpleActionState, ServiceState, IntrospectionServer", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0458, 0.0065, 0, 0.66, 0.25, 716, 0, 3, 0, 0, 716, 0, 0], "semantic": {"name": "smach_ros", "arg_names": [], "import_names": ["SimpleActionState", "ServiceState", "IntrospectionServer"], "rhs_call_name": "", "annotation": ""}, "snippet": "from smach_ros import SimpleActionState, ServiceState, IntrospectionServer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:Import_L8_C0", "label": "actionlib import actionlib", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0523, 0.0065, 0, 0.66, 0.3125, 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_99391:ImportFrom_L10_C0", "label": "from rfid_servoing.msg import ServoAction, ServoGoal", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0654, 0.0065, 0, 0.66, 0.375, 317, 0, 2, 0, 0, 317, 0, 0], "semantic": {"name": "rfid_servoing.msg", "arg_names": [], "import_names": ["ServoAction", "ServoGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_servoing.msg import ServoAction, ServoGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:ImportFrom_L11_C0", "label": "from rfid_artoolkit.msg import UpCloseAction, UpCloseGoal", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0719, 0.0065, 0, 0.66, 0.4375, 547, 0, 2, 0, 0, 547, 0, 0], "semantic": {"name": "rfid_artoolkit.msg", "arg_names": [], "import_names": ["UpCloseAction", "UpCloseGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_artoolkit.msg import UpCloseAction, UpCloseGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:ImportFrom_L12_C0", "label": "from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0784, 0.0065, 0, 0.66, 0.5, 457, 0, 2, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["PointHeadAction", "PointHeadGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:ImportFrom_L13_C0", "label": "from explore_hrl.msg import ExploreAction, ExploreActionGoal", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.085, 0.0065, 0, 0.66, 0.5625, 232, 0, 2, 0, 0, 232, 0, 0], "semantic": {"name": "explore_hrl.msg", "arg_names": [], "import_names": ["ExploreAction", "ExploreActionGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from explore_hrl.msg import ExploreAction, ExploreActionGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:ImportFrom_L14_C0", "label": "from rfid_behaviors.srv import HandoffSrv", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0915, 0.0065, 0, 0.66, 0.625, 647, 0, 1, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["HandoffSrv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import HandoffSrv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:ImportFrom_L15_C0", "label": "from rfid_behaviors.srv import FlapEarsSrv", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.098, 0.0065, 0, 0.66, 0.6875, 647, 0, 1, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["FlapEarsSrv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import FlapEarsSrv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:ImportFrom_L16_C0", "label": "from rfid_behaviors.srv import OrientSrv, OrientSrvRequest", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1046, 0.0065, 0, 0.66, 0.75, 647, 0, 2, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["OrientSrv", "OrientSrvRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import OrientSrv, OrientSrvRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:ImportFrom_L17_C0", "label": "from robotis.srv import MoveAng, MoveAngRequest", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.0065, 0, 0.66, 0.8125, 727, 0, 2, 0, 0, 727, 0, 0], "semantic": {"name": "robotis.srv", "arg_names": [], "import_names": ["MoveAng", "MoveAngRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robotis.srv import MoveAng, MoveAngRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:Import_L20_C0", "label": "yaml import yaml", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.1307, 0.0065, 0, 0.66, 0.875, 960, 0, 1, 0, 0, 960, 0, 0], "semantic": {"name": "yaml", "arg_names": [], "import_names": ["yaml"], "rhs_call_name": "", "annotation": ""}, "snippet": "import yaml"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:FunctionDef_L24_C0", "label": "sm_delivery", "type": "function", "loc": [24, 135], "level": 0, "parent": null, "vector": [2, 0, 0.5196, 0.732, 0, 0.66, 0.9375, 298, 0, 0, 1, 0, 0, 0, 15], "semantic": {"name": "sm_delivery", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def sm_delivery():\n # Create a SMACH state machine\n sm = smach.StateMachine( outcomes = ['succeeded','aborted','preempted'],\n input_keys = ['tagid'])\n\n # Open the container\n with sm:\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:Assign_L26_C4", "label": "sm = StateMachine()", "type": "assigned_variable", "loc": [26, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99391:FunctionDef_L24_C0", "vector": [14, 1, 0.1732, 0.0131, 1, 0.05, 0.0, 21, 3, 2, 0, 0, 174, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "StateMachine", "annotation": ""}, "snippet": " sm = smach.StateMachine( outcomes = ['succeeded','aborted','preempted'],\n input_keys = ['tagid'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:Expr_L45_C8", "label": "add()", "type": "expression", "loc": [45, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99391:FunctionDef_L24_C0", "vector": [8, 1, 0.3039, 0.0261, 1, 0.05, 0.0, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'FLAP_EARS',\n ServiceState( '/rfid_orient/flap', FlapEarsSrv ),\n transitions = { 'succeeded' : 'ORIENT' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:Expr_L51_C8", "label": "add()", "type": "expression", "loc": [51, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99391:FunctionDef_L24_C0", "vector": [8, 1, 0.3562, 0.0523, 1, 0.05, 0.2, 241, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'ORIENT',\n ServiceState( '/rfid_orient/orient',\n OrientSrv,\n request_slots = ['data'], \n input_keys=['data']), # tagid (string)\n transitions = { 'succeeded' : 'SERVO' },\n remapping = {'data':'tagid'}) # input"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:Expr_L61_C8", "label": "add()", "type": "expression", "loc": [61, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99391:FunctionDef_L24_C0", "vector": [8, 1, 0.4183, 0.0458, 1, 0.05, 0.4, 241, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'SERVO',\n SimpleActionState( '/rfid_servo/servo_act',\n ServoAction,\n goal_slots = ['tagid']), #goal = ServoGoal( 'person ' ),\n transitions = { 'succeeded': 'TUCK_LEFT' },\n remapping = {'tagid':'tagid'}) # input"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:Expr_L112_C8", "label": "add()", "type": "expression", "loc": [112, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99391:FunctionDef_L24_C0", "vector": [8, 1, 0.7484, 0.0392, 1, 0.05, 0.6, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'TUCK_LEFT',\n ServiceState( 'robotis/servo_left_pan_moveangle',\n MoveAng,\n request = MoveAngRequest( 1.350, 0.2, 0 )), # ang (float), angvel (float), blocking (bool)\n transitions = {'succeeded':'TUCK_RIGHT'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:Expr_L120_C8", "label": "add()", "type": "expression", "loc": [120, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99391:FunctionDef_L24_C0", "vector": [8, 1, 0.8007, 0.0392, 1, 0.05, 0.8, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'TUCK_RIGHT',\n ServiceState( 'robotis/servo_right_pan_moveangle',\n MoveAng,\n request = MoveAngRequest( -1.350, 0.2, 0 )), # ang (float), angvel (float), blocking (bool)\n transitions = {'succeeded':'HANDOFF'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:Expr_L128_C8", "label": "add()", "type": "expression", "loc": [128, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99391:FunctionDef_L24_C0", "vector": [8, 1, 0.8464, 0.0261, 1, 0.05, 1.0, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'HANDOFF',\n ServiceState( '/rfid_handoff/handoff', HandoffSrv ),\n transitions = { 'succeeded' : 'succeeded' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:Return_L135_C4", "label": "return", "type": "return", "loc": [135, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99391:FunctionDef_L24_C0", "vector": [13, 1, 0.8824, 0.0065, 1, 0.05, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:If_L138_C0", "label": "if", "type": "if", "loc": [138, 150], "level": 0, "parent": null, "vector": [4, 0, 0.9412, 0.085, 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 rospy.init_node('smach_example_state_machine')\n\n sm = sm_delivery()\n\n sis = IntrospectionServer('RFID_delivery', sm, '/SM_ROOT')\n sis.start()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:Expr_L139_C4", "label": "init_node()", "type": "expression", "loc": [139, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99391:If_L138_C0", "vector": [8, 1, 0.9085, 0.0065, 1, 0.89, 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('smach_example_state_machine')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:Assign_L141_C4", "label": "sm = sm_delivery()", "type": "assigned_variable", "loc": [141, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99391:If_L138_C0", "vector": [14, 1, 0.9216, 0.0065, 1, 0.89, 0.1429, 21, 3, 0, 0, 0, 298, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "sm_delivery", "annotation": ""}, "snippet": " sm = sm_delivery()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:Assign_L143_C4", "label": "sis = IntrospectionServer()", "type": "assigned_variable", "loc": [143, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99391:If_L138_C0", "vector": [14, 1, 0.9346, 0.0065, 1, 0.89, 0.2857, 608, 3, 3, 0, 0, 702, 10, 1], "semantic": {"name": "sis", "arg_names": [], "import_names": [], "rhs_call_name": "IntrospectionServer", "annotation": ""}, "snippet": " sis = IntrospectionServer('RFID_delivery', sm, '/SM_ROOT')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:Expr_L144_C4", "label": "start()", "type": "expression", "loc": [144, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99391:If_L138_C0", "vector": [8, 1, 0.9412, 0.0065, 1, 0.89, 0.4286, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " sis.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:Assign_L146_C4", "label": "sm.userdata.tagid =", "type": "assigned_variable", "loc": [146, 146], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99391:If_L138_C0", "vector": [14, 1, 0.9542, 0.0065, 1, 0.89, 0.5714, 452, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "sm.userdata.tagid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sm.userdata.tagid = 'person '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:Assign_L147_C4", "label": "outcome = execute()", "type": "assigned_variable", "loc": [147, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99391:If_L138_C0", "vector": [14, 1, 0.9608, 0.0065, 1, 0.89, 0.7143, 805, 3, 0, 0, 0, 569, 10, 1], "semantic": {"name": "outcome", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " outcome = sm.execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99391:Expr_L149_C4", "label": "spin()", "type": "expression", "loc": [149, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99391:If_L138_C0", "vector": [8, 1, 0.9739, 0.0065, 1, 0.89, 0.8571, 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_99391:Expr_L150_C4", "label": "stop()", "type": "expression", "loc": [150, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99391:If_L138_C0", "vector": [8, 1, 0.9804, 0.0065, 1, 0.89, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " sis.stop()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99391:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99391:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99391:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99391:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99391:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99391:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99391:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99391:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99391:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99391:Expr_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99391:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99391:Expr_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99391:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99391:Expr_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99391:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99391:Return_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99391:If_L138_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99391:Expr_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99391:If_L138_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99391:Assign_L141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99391:If_L138_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99391:Assign_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99391:If_L138_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99391:Expr_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99391:If_L138_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99391:Assign_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99391:If_L138_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99391:Assign_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99391:If_L138_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99391:Expr_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99391:If_L138_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99391:Expr_L150_C4"}]
#! /usr/bin/python import roslib roslib.load_manifest('rfid_demos') roslib.load_manifest('hrl_object_fetching') roslib.load_manifest('hrl_table_detect') roslib.load_manifest('hrl_trajectory_playback') roslib.load_manifest('pr2_overhead_grasping') import rospy import smach import actionlib from smach_ros import SimpleActionState, ServiceState, IntrospectionServer # from hrl_object_fetching.srv import DetectTable from hrl_table_detect.srv import DetectTableInst, DetectTableInstRequest from hrl_table_detect.srv import DetectTableStart, DetectTableStop from rfid_behaviors.srv import FloatFloat_Int32 as RotateBackupSrv from rfid_behaviors.srv import FloatFloat_Int32Request as RotateBackupSrvRequest from rfid_behaviors.srv import HandoffSrv, HandoffSrvRequest from hrl_trajectory_playback.srv import TrajPlaybackSrv, TrajPlaybackSrvRequest import pr2_overhead_grasping.sm_overhead_grasp as sm_overhead_grasp from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal from geometry_msgs.msg import PointStamped import sm_rfid_servo_approach import approach_table.sm_approach as sm_approach # Overhead grasping requres: # run: hrl_pr2_gains/change_gains_grasp.py # roslaunch pr2_overhead_grasping overhead_grasping_server.launch # Perception requires: # roslaunch hrl_pr2_lib openni_kinect.launch # roslaunch hrl_object_fetching tabletop_detect.launch def sm_fetch_object(): # Create a SMACH state machine sm = smach.StateMachine(outcomes=['succeeded','aborted','preempted'], input_keys = [ 'tagid' ]) with sm: # Servo in towards table approach = sm_rfid_servo_approach.sm_rfid_servo_approach() smach.StateMachine.add( 'SERVO_APPROACH', # outcomes: succeeded, aborted, preempted approach, remapping = { 'tagid' : 'tagid'}, #input transitions = { 'succeeded': 'POINT_HEAD' }) # Point Head Down (eventaully roll this and perceive table into own sm?) pgoal = PointHeadGoal() pgoal.target.header.frame_id = '/torso_lift_link' pgoal.target.point.x = 0.50 pgoal.min_duration = rospy.Duration(0.6) pgoal.max_velocity = 1.0 smach.StateMachine.add( 'POINT_HEAD', SimpleActionState( '/head_traj_controller/point_head_action', PointHeadAction, goal = pgoal ), transitions = { 'succeeded' : 'PERCEIVE_TABLE' }) # Detect table and determine possible approach directions! # requires: # roslaunch hrl_pr2_lib openni_kinect.launch # roslaunch hrl_object_fetching tabletop_detect.launch smach.StateMachine.add( 'PERCEIVE_TABLE', ServiceState( '/table_detect_inst', DetectTableInst, request = DetectTableInstRequest( 1.0 ), response_slots = ['grasp_points']), # PoseArray transitions = {'succeeded':'PERCEIVE_OBJECT'}, remapping = {'grasp_points':'approach_poses'}) # Setment objects smach.StateMachine.add( 'PERCEIVE_OBJECT', ServiceState( '/obj_segment_inst', DetectTableInst, request = DetectTableInstRequest( 1.0 ), response_slots = ['grasp_points']), # PoseArray transitions = {'succeeded':'APPROACH_TABLE'}, remapping = {'grasp_points':'object_poses'}) #output # Move to the desired approach vector sm_table = sm_approach.sm_approach_table() smach.StateMachine.add( 'APPROACH_TABLE', sm_table, remapping = {'table_edge_poses':'approach_poses', # input (PoseArray) 'movebase_pose_global':'approach_movebase_pose', # output (PoseStamped) 'table_edge_global':'table_edge_global'}, # output (PoseStamped) transitions = {'succeeded':'REPOINT_HEAD'}) # Re-Point Head to table's edge. def repoint_goal_cb(userdata, goal): # Convert PoseStamped in userdata to PointHeadGoal # mobj = userdata.look_points.poses[0] # We'll have head point to first object. # pgoal = PointHeadGoal() # pgoal.target.header.frame_id = userdata.look_points.header.frame_id # pgoal.target.point.x = mobj.pose.position.x # pgoal.target.point.y = mobj.pose.position.y # pgoal.target.point.z = mobj.pose.position.z # pgoal.min_duration = rospy.Duration(0.6) # pgoal.max_velocity = 1.0 pgoal = PointHeadGoal() pgoal.target.header.frame_id = '/torso_lift_link' pgoal.target.point.x = 0.50 pgoal.target.point.y = 0.0 pgoal.target.point.z = -0.35 pgoal.min_duration = rospy.Duration(0.6) pgoal.max_velocity = 1.0 return pgoal smach.StateMachine.add( 'REPOINT_HEAD', SimpleActionState( '/head_traj_controller/point_head_action', PointHeadAction, goal_cb = repoint_goal_cb, input_keys = ['look_points']), remapping = {'look_points':'object_poses'}, # input (PoseStamped) transitions = { 'succeeded' : 'PREP_UNFOLD' }) # Prep unfold smach.StateMachine.add( 'PREP_UNFOLD', ServiceState( 'rfid_handoff/stow', HandoffSrv, request = HandoffSrvRequest()), transitions = { 'succeeded':'UNFOLD' }) # Unfold smach.StateMachine.add( 'UNFOLD', ServiceState( 'traj_playback/unfold', TrajPlaybackSrv, request = TrajPlaybackSrvRequest( 0 )), transitions = { 'succeeded':'MANIPULATE' }) # Manipulate sm_grasp = sm_overhead_grasp.sm_grasp() smach.StateMachine.add( 'MANIPULATE', sm_grasp, transitions = {'succeeded':'BACKUP'}) # Backup (60cm) smach.StateMachine.add( 'BACKUP', ServiceState( '/rotate_backup', RotateBackupSrv, request = RotateBackupSrvRequest(0.0, -0.50)), transitions = { 'succeeded':'PRE_STOW' }) smach.StateMachine.add( 'PRE_STOW', ServiceState( 'rfid_handoff/stow_grasp', HandoffSrv, request = HandoffSrvRequest()), transitions = { 'succeeded':'succeeded' }) # # Setup robot for further navigation: # # fold arms, position head, position ear antennas. # smach.StateMachine.add( # 'PRE_STOW', # ServiceState( 'rfid_handoff/pre_stow', # HandoffSrv, # request = HandoffSrvRequest()), # transitions = { 'succeeded':'STOW' }) # smach.StateMachine.add( # 'STOW', # ServiceState( 'rfid_handoff/stow', # HandoffSrv, # request = HandoffSrvRequest()), # transitions = { 'succeeded':'succeeded' }) return sm if __name__ == '__main__': rospy.init_node('smach_sm_fetch') sm = sm_fetch_object() sis = IntrospectionServer('RFID_fetching', sm, '/SM_FETCHING') sis.start() #sm.userdata.tagid = 'person ' #sm.userdata.tagid = 'OrangeMedBot' sm.userdata.tagid = 'SpectrMedBot' outcome = sm.execute() sis.stop()
ajibawa-2023/Python-Code-Large/train/row_99392
60
204
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0098, 0.0049, 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_99392:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0147, 0.0049, 0, 0.66, 0.0455, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('rfid_demos')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0196, 0.0049, 0, 0.66, 0.0909, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('hrl_object_fetching')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0245, 0.0049, 0, 0.66, 0.1364, 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_table_detect')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0294, 0.0049, 0, 0.66, 0.1818, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('hrl_trajectory_playback')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0343, 0.0049, 0, 0.66, 0.2273, 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_overhead_grasping')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Import_L8_C0", "label": "rospy import rospy", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0392, 0.0049, 0, 0.66, 0.2727, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Import_L10_C0", "label": "smach import smach", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.049, 0.0049, 0, 0.66, 0.3182, 345, 0, 1, 0, 0, 345, 0, 0], "semantic": {"name": "smach", "arg_names": [], "import_names": ["smach"], "rhs_call_name": "", "annotation": ""}, "snippet": "import smach"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Import_L11_C0", "label": "actionlib import actionlib", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0539, 0.0049, 0, 0.66, 0.3636, 694, 0, 1, 0, 0, 694, 0, 0], "semantic": {"name": "actionlib", "arg_names": [], "import_names": ["actionlib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import actionlib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:ImportFrom_L13_C0", "label": "from smach_ros import SimpleActionState, ServiceState, IntrospectionServer", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0637, 0.0049, 0, 0.66, 0.4091, 716, 0, 3, 0, 0, 716, 0, 0], "semantic": {"name": "smach_ros", "arg_names": [], "import_names": ["SimpleActionState", "ServiceState", "IntrospectionServer"], "rhs_call_name": "", "annotation": ""}, "snippet": "from smach_ros import SimpleActionState, ServiceState, IntrospectionServer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:ImportFrom_L15_C0", "label": "from hrl_table_detect.srv import DetectTableInst, DetectTableInstRequest", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0735, 0.0049, 0, 0.66, 0.4545, 778, 0, 2, 0, 0, 778, 0, 0], "semantic": {"name": "hrl_table_detect.srv", "arg_names": [], "import_names": ["DetectTableInst", "DetectTableInstRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_table_detect.srv import DetectTableInst, DetectTableInstRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:ImportFrom_L16_C0", "label": "from hrl_table_detect.srv import DetectTableStart, DetectTableStop", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0784, 0.0049, 0, 0.66, 0.5, 778, 0, 2, 0, 0, 778, 0, 0], "semantic": {"name": "hrl_table_detect.srv", "arg_names": [], "import_names": ["DetectTableStart", "DetectTableStop"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_table_detect.srv import DetectTableStart, DetectTableStop"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:ImportFrom_L17_C0", "label": "from rfid_behaviors.srv import RotateBackupSrv", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0049, 0, 0.66, 0.5455, 647, 0, 1, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["RotateBackupSrv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import FloatFloat_Int32 as RotateBackupSrv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:ImportFrom_L18_C0", "label": "from rfid_behaviors.srv import RotateBackupSrvRequest", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0882, 0.0049, 0, 0.66, 0.5909, 647, 0, 1, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["RotateBackupSrvRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import FloatFloat_Int32Request as RotateBackupSrvRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:ImportFrom_L19_C0", "label": "from rfid_behaviors.srv import HandoffSrv, HandoffSrvRequest", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0931, 0.0049, 0, 0.66, 0.6364, 647, 0, 2, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["HandoffSrv", "HandoffSrvRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import HandoffSrv, HandoffSrvRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:ImportFrom_L20_C0", "label": "from hrl_trajectory_playback.srv import TrajPlaybackSrv, TrajPlaybackSrvRequest", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.098, 0.0049, 0, 0.66, 0.6818, 12, 0, 2, 0, 0, 12, 0, 0], "semantic": {"name": "hrl_trajectory_playback.srv", "arg_names": [], "import_names": ["TrajPlaybackSrv", "TrajPlaybackSrvRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_trajectory_playback.srv import TrajPlaybackSrv, TrajPlaybackSrvRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Import_L21_C0", "label": "pr2_overhead_grasping.sm_overhead_grasp import sm_overhead_grasp", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.1029, 0.0049, 0, 0.66, 0.7273, 693, 0, 1, 0, 0, 693, 0, 0], "semantic": {"name": "pr2_overhead_grasping.sm_overhead_grasp", "arg_names": [], "import_names": ["sm_overhead_grasp"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pr2_overhead_grasping.sm_overhead_grasp as sm_overhead_grasp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:ImportFrom_L22_C0", "label": "from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.1078, 0.0049, 0, 0.66, 0.7727, 457, 0, 2, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["PointHeadAction", "PointHeadGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:ImportFrom_L23_C0", "label": "from geometry_msgs.msg import PointStamped", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.1127, 0.0049, 0, 0.66, 0.8182, 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_99392:Import_L25_C0", "label": "sm_rfid_servo_approach import sm_rfid_servo_approach", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.1225, 0.0049, 0, 0.66, 0.8636, 183, 0, 1, 0, 0, 183, 0, 0], "semantic": {"name": "sm_rfid_servo_approach", "arg_names": [], "import_names": ["sm_rfid_servo_approach"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sm_rfid_servo_approach"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Import_L26_C0", "label": "approach_table.sm_approach import sm_approach", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.1275, 0.0049, 0, 0.66, 0.9091, 45, 0, 1, 0, 0, 45, 0, 0], "semantic": {"name": "approach_table.sm_approach", "arg_names": [], "import_names": ["sm_approach"], "rhs_call_name": "", "annotation": ""}, "snippet": "import approach_table.sm_approach as sm_approach"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "label": "sm_fetch_object", "type": "function", "loc": [37, 184], "level": 0, "parent": null, "vector": [2, 0, 0.5417, 0.7255, 0, 0.66, 0.9545, 819, 0, 0, 1, 0, 0, 0, 33], "semantic": {"name": "sm_fetch_object", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def sm_fetch_object():\n # Create a SMACH state machine\n sm = smach.StateMachine(outcomes=['succeeded','aborted','preempted'],\n input_keys = [ 'tagid' ])\n\n with sm:\n # Servo in towards table\n approach = sm_rfid_servo_approach.sm_rfid_servo_approach()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L39_C4", "label": "sm = StateMachine()", "type": "assigned_variable", "loc": [39, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "vector": [14, 1, 0.1936, 0.0098, 1, 0.92, 0.0, 21, 3, 2, 0, 0, 174, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "StateMachine", "annotation": ""}, "snippet": " sm = smach.StateMachine(outcomes=['succeeded','aborted','preempted'],\n input_keys = [ 'tagid' ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L44_C8", "label": "approach = sm_rfid_servo_approach()", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "vector": [14, 1, 0.2157, 0.0049, 1, 0.92, 0.0, 414, 3, 0, 0, 0, 183, 10, 1], "semantic": {"name": "approach", "arg_names": [], "import_names": [], "rhs_call_name": "sm_rfid_servo_approach", "annotation": ""}, "snippet": " approach = sm_rfid_servo_approach.sm_rfid_servo_approach()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L45_C8", "label": "add()", "type": "expression", "loc": [45, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "vector": [8, 1, 0.2304, 0.0245, 1, 0.92, 0.0526, 241, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'SERVO_APPROACH', # outcomes: succeeded, aborted, preempted\n approach,\n remapping = { 'tagid' : 'tagid'}, #input\n transitions = { 'succeeded': 'POINT_HEAD' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L53_C8", "label": "pgoal = PointHeadGoal()", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "vector": [14, 1, 0.2598, 0.0049, 1, 0.92, 0.1053, 882, 3, 0, 0, 0, 479, 10, 1], "semantic": {"name": "pgoal", "arg_names": [], "import_names": [], "rhs_call_name": "PointHeadGoal", "annotation": ""}, "snippet": " pgoal = PointHeadGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L54_C8", "label": "pgoal.target.header.frame_id =", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "vector": [14, 1, 0.2647, 0.0049, 1, 0.92, 0.1579, 99, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "pgoal.target.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pgoal.target.header.frame_id = '/torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L55_C8", "label": "pgoal.target.point.x =", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "vector": [14, 1, 0.2696, 0.0049, 1, 0.92, 0.2105, 801, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "pgoal.target.point.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pgoal.target.point.x = 0.50"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L56_C8", "label": "pgoal.min_duration = Duration()", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "vector": [14, 1, 0.2745, 0.0049, 1, 0.92, 0.2632, 457, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "pgoal.min_duration", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " pgoal.min_duration = rospy.Duration(0.6)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L57_C8", "label": "pgoal.max_velocity =", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "vector": [14, 1, 0.2794, 0.0049, 1, 0.92, 0.3158, 412, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "pgoal.max_velocity", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pgoal.max_velocity = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L58_C8", "label": "add()", "type": "expression", "loc": [58, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "vector": [8, 1, 0.2966, 0.0294, 1, 0.92, 0.3684, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'POINT_HEAD',\n SimpleActionState( '/head_traj_controller/point_head_action',\n PointHeadAction,\n goal = pgoal ),\n transitions = { 'succeeded' : 'PERCEIVE_TABLE' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L69_C8", "label": "add()", "type": "expression", "loc": [69, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "vector": [8, 1, 0.3554, 0.0392, 1, 0.92, 0.4211, 241, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'PERCEIVE_TABLE',\n ServiceState( '/table_detect_inst',\n DetectTableInst,\n request = DetectTableInstRequest( 1.0 ),\n response_slots = ['grasp_points']), # PoseArray\n transitions = {'succeeded':'PERCEIVE_OBJECT'},\n remapping = {'grasp_points':'approach_poses'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L79_C8", "label": "add()", "type": "expression", "loc": [79, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "vector": [8, 1, 0.4044, 0.0392, 1, 0.92, 0.4737, 241, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'PERCEIVE_OBJECT',\n ServiceState( '/obj_segment_inst',\n DetectTableInst,\n request = DetectTableInstRequest( 1.0 ),\n response_slots = ['grasp_points']), # PoseArray\n transitions = {'succeeded':'APPROACH_TABLE'},\n remapping = {'grasp_points':'object_poses'}) #output"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L90_C8", "label": "sm_table = sm_approach_table()", "type": "assigned_variable", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "vector": [14, 1, 0.4412, 0.0049, 1, 0.92, 0.5263, 814, 3, 0, 0, 0, 227, 10, 1], "semantic": {"name": "sm_table", "arg_names": [], "import_names": [], "rhs_call_name": "sm_approach_table", "annotation": ""}, "snippet": " sm_table = sm_approach.sm_approach_table()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L91_C8", "label": "add()", "type": "expression", "loc": [91, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "vector": [8, 1, 0.4608, 0.0343, 1, 0.92, 0.5789, 241, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'APPROACH_TABLE',\n sm_table,\n remapping = {'table_edge_poses':'approach_poses', # input (PoseArray)\n 'movebase_pose_global':'approach_movebase_pose', # output (PoseStamped)\n 'table_edge_global':'table_edge_global'}, # output (PoseStamped)\n transitions = {'succeeded':'REPOINT_HEAD'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L100_C8", "label": "repoint_goal_cb", "type": "function", "loc": [100, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "vector": [2, 1, 0.5368, 0.098, 1, 0.92, 0.6316, 112, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "repoint_goal_cb", "arg_names": ["userdata", "goal"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def repoint_goal_cb(userdata, goal):\n # Convert PoseStamped in userdata to PointHeadGoal\n # mobj = userdata.look_points.poses[0] # We'll have head point to first object.\n\n # pgoal = PointHeadGoal()\n # pgoal.target.header.frame_id = userdata.look_points.header.frame_id\n # pgoal.target.point.x = mobj.pose.position.x\n # pgoal.target.point.y = mobj.pose.position.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L112_C12", "label": "pgoal = PointHeadGoal()", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L100_C8", "vector": [14, 2, 0.549, 0.0049, 2, 0.15, 0.0, 882, 3, 0, 0, 0, 479, 10, 1], "semantic": {"name": "pgoal", "arg_names": [], "import_names": [], "rhs_call_name": "PointHeadGoal", "annotation": ""}, "snippet": " pgoal = PointHeadGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L113_C12", "label": "pgoal.target.header.frame_id =", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L100_C8", "vector": [14, 2, 0.5539, 0.0049, 2, 0.15, 0.1429, 99, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "pgoal.target.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pgoal.target.header.frame_id = '/torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L114_C12", "label": "pgoal.target.point.x =", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L100_C8", "vector": [14, 2, 0.5588, 0.0049, 2, 0.15, 0.2857, 801, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "pgoal.target.point.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pgoal.target.point.x = 0.50"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L115_C12", "label": "pgoal.target.point.y =", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L100_C8", "vector": [14, 2, 0.5637, 0.0049, 2, 0.15, 0.4286, 59, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "pgoal.target.point.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pgoal.target.point.y = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L116_C12", "label": "pgoal.target.point.z =", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L100_C8", "vector": [14, 2, 0.5686, 0.0049, 2, 0.15, 0.5714, 591, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pgoal.target.point.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pgoal.target.point.z = -0.35"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L117_C12", "label": "pgoal.min_duration = Duration()", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L100_C8", "vector": [14, 2, 0.5735, 0.0049, 2, 0.15, 0.7143, 457, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "pgoal.min_duration", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " pgoal.min_duration = rospy.Duration(0.6)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L118_C12", "label": "pgoal.max_velocity =", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L100_C8", "vector": [14, 2, 0.5784, 0.0049, 2, 0.15, 0.8571, 412, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "pgoal.max_velocity", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pgoal.max_velocity = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Return_L119_C12", "label": "return", "type": "return", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L100_C8", "vector": [13, 2, 0.5833, 0.0049, 2, 0.15, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pgoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L121_C8", "label": "add()", "type": "expression", "loc": [121, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "vector": [8, 1, 0.6103, 0.0392, 1, 0.92, 0.6842, 241, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'REPOINT_HEAD',\n SimpleActionState( '/head_traj_controller/point_head_action',\n PointHeadAction,\n goal_cb = repoint_goal_cb,\n input_keys = ['look_points']),\n remapping = {'look_points':'object_poses'}, # input (PoseStamped)\n transitions = { 'succeeded' : 'PREP_UNFOLD' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L131_C8", "label": "add()", "type": "expression", "loc": [131, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "vector": [8, 1, 0.6544, 0.0294, 1, 0.92, 0.7368, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'PREP_UNFOLD',\n ServiceState( 'rfid_handoff/stow',\n HandoffSrv,\n request = HandoffSrvRequest()), \n transitions = { 'succeeded':'UNFOLD' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L139_C8", "label": "add()", "type": "expression", "loc": [139, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "vector": [8, 1, 0.6936, 0.0294, 1, 0.92, 0.7895, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'UNFOLD',\n ServiceState( 'traj_playback/unfold',\n TrajPlaybackSrv,\n request = TrajPlaybackSrvRequest( 0 )), \n transitions = { 'succeeded':'MANIPULATE' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L147_C8", "label": "sm_grasp = sm_grasp()", "type": "assigned_variable", "loc": [147, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "vector": [14, 1, 0.7206, 0.0049, 1, 0.92, 0.8421, 619, 3, 0, 0, 0, 619, 10, 1], "semantic": {"name": "sm_grasp", "arg_names": [], "import_names": [], "rhs_call_name": "sm_grasp", "annotation": ""}, "snippet": " sm_grasp = sm_overhead_grasp.sm_grasp()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L148_C8", "label": "add()", "type": "expression", "loc": [148, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "vector": [8, 1, 0.7328, 0.0196, 1, 0.92, 0.8947, 241, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'MANIPULATE',\n sm_grasp,\n transitions = {'succeeded':'BACKUP'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L154_C8", "label": "add()", "type": "expression", "loc": [154, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "vector": [8, 1, 0.7672, 0.0294, 1, 0.92, 0.9474, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'BACKUP',\n ServiceState( '/rotate_backup',\n RotateBackupSrv,\n request = RotateBackupSrvRequest(0.0, -0.50)), \n transitions = { 'succeeded':'PRE_STOW' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L161_C8", "label": "add()", "type": "expression", "loc": [161, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "vector": [8, 1, 0.8015, 0.0294, 1, 0.92, 1.0, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'PRE_STOW',\n ServiceState( 'rfid_handoff/stow_grasp',\n HandoffSrv,\n request = HandoffSrvRequest()), \n transitions = { 'succeeded':'succeeded' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Return_L184_C4", "label": "return", "type": "return", "loc": [184, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "vector": [13, 1, 0.902, 0.0049, 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 sm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:If_L188_C0", "label": "if", "type": "if", "loc": [188, 201], "level": 0, "parent": null, "vector": [4, 0, 0.9534, 0.0686, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n rospy.init_node('smach_sm_fetch')\n\n sm = sm_fetch_object()\n\n sis = IntrospectionServer('RFID_fetching', sm, '/SM_FETCHING')\n sis.start()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L189_C4", "label": "init_node()", "type": "expression", "loc": [189, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:If_L188_C0", "vector": [8, 1, 0.9265, 0.0049, 1, 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('smach_sm_fetch')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L191_C4", "label": "sm = sm_fetch_object()", "type": "assigned_variable", "loc": [191, 191], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:If_L188_C0", "vector": [14, 1, 0.9363, 0.0049, 1, 0.29, 0.1667, 21, 3, 0, 0, 0, 819, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "sm_fetch_object", "annotation": ""}, "snippet": " sm = sm_fetch_object()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L193_C4", "label": "sis = IntrospectionServer()", "type": "assigned_variable", "loc": [193, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:If_L188_C0", "vector": [14, 1, 0.9461, 0.0049, 1, 0.29, 0.3333, 608, 3, 3, 0, 0, 702, 10, 1], "semantic": {"name": "sis", "arg_names": [], "import_names": [], "rhs_call_name": "IntrospectionServer", "annotation": ""}, "snippet": " sis = IntrospectionServer('RFID_fetching', sm, '/SM_FETCHING')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L194_C4", "label": "start()", "type": "expression", "loc": [194, 194], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:If_L188_C0", "vector": [8, 1, 0.951, 0.0049, 1, 0.29, 0.5, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " sis.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L198_C4", "label": "sm.userdata.tagid =", "type": "assigned_variable", "loc": [198, 198], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:If_L188_C0", "vector": [14, 1, 0.9706, 0.0049, 1, 0.29, 0.6667, 452, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "sm.userdata.tagid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sm.userdata.tagid = 'SpectrMedBot'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L199_C4", "label": "outcome = execute()", "type": "assigned_variable", "loc": [199, 199], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:If_L188_C0", "vector": [14, 1, 0.9755, 0.0049, 1, 0.29, 0.8333, 805, 3, 0, 0, 0, 569, 10, 1], "semantic": {"name": "outcome", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " outcome = sm.execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L201_C4", "label": "stop()", "type": "expression", "loc": [201, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99392:If_L188_C0", "vector": [8, 1, 0.9853, 0.0049, 1, 0.29, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " sis.stop()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L115_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L118_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Return_L119_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Return_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:If_L188_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:If_L188_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L191_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:If_L188_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L193_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:If_L188_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:If_L188_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L198_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:If_L188_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Assign_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99392:If_L188_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99392:Expr_L201_C4"}]
#! /usr/bin/python import roslib roslib.load_manifest('rfid_demos') roslib.load_manifest('robotis') import rospy import smach from smach_ros import SimpleActionState, ServiceState, IntrospectionServer import actionlib from rfid_servoing.msg import ServoAction, ServoGoal from rfid_artoolkit.msg import UpCloseAction, UpCloseGoal from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal from explore_hrl.msg import ExploreAction, ExploreActionGoal from rfid_behaviors.srv import HandoffSrv from rfid_behaviors.srv import FlapEarsSrv from rfid_behaviors.srv import String_Int32 as OrientSrv from rfid_behaviors.srv import String_Int32Request as OrientSrvRequest from robotis.srv import MoveAng, MoveAngRequest #import rfid_search import yaml def sm_rfid_servo_approach(): # Create a SMACH state machine sm = smach.StateMachine( outcomes = ['succeeded','aborted','preempted'], input_keys = ['tagid']) # Open the container with sm: # Initial RFID Ear Flapping smach.StateMachine.add( 'FLAP_EARS', ServiceState( '/rfid_orient/flap', FlapEarsSrv ), transitions = { 'succeeded' : 'ORIENT' }) # Orient towards tag smach.StateMachine.add( 'ORIENT', ServiceState( '/rfid_orient/orient', OrientSrv, request_slots = ['data']), #request = OrientSrvRequest( 'person ' ) transitions = { 'succeeded' : 'SERVO' }, remapping = {'data':'tagid'}) # input # Servoing is a basic state machine. Success means servoing finished @ obs. smach.StateMachine.add( 'SERVO', SimpleActionState( '/rfid_servo/servo_act', ServoAction, goal_slots = ['tagid']), #goal = ServoGoal( 'person ' ), transitions = { 'succeeded': 'TUCK_LEFT' }, remapping = {'tagid':'tagid'}) # input # Tuck Left (non-blocking) smach.StateMachine.add( 'TUCK_LEFT', ServiceState( 'robotis/servo_left_pan_moveangle', MoveAng, request = MoveAngRequest( 1.350, 0.2, 0 )), # ang (float), angvel (float), blocking (bool) transitions = {'succeeded':'TUCK_RIGHT'}) # Tuck Right (non-blocking) smach.StateMachine.add( 'TUCK_RIGHT', ServiceState( 'robotis/servo_right_pan_moveangle', MoveAng, request = MoveAngRequest( -1.350, 0.2, 0 )), # ang (float), angvel (float), blocking (bool) transitions = {'succeeded':'succeeded'}) return sm if __name__ == '__main__': import optparse p = optparse.OptionParser() p.add_option('--tag', action='store', type='string', dest='tagid', help='Tagid to approach', default='person ') opt, args = p.parse_args() print 'SERVO APPROACH to ID: \'%s\'' % (opt.tagid) rospy.init_node('smach_example_state_machine') sm = sm_rfid_servo_approach() sis = IntrospectionServer('RFID_servo_approach', sm, '/SM_RFID_SERVO_APPROACH') sis.start() sm.userdata.tagid = opt.tagid outcome = sm.execute() sis.stop()
ajibawa-2023/Python-Code-Large/train/row_99393
38
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_99393:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0208, 0.0104, 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_99393:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0312, 0.0104, 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('rfid_demos')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0417, 0.0104, 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": "roslib.load_manifest('robotis')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0521, 0.0104, 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_99393:Import_L7_C0", "label": "smach import smach", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0729, 0.0104, 0, 0.66, 0.2222, 345, 0, 1, 0, 0, 345, 0, 0], "semantic": {"name": "smach", "arg_names": [], "import_names": ["smach"], "rhs_call_name": "", "annotation": ""}, "snippet": "import smach"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:ImportFrom_L8_C0", "label": "from smach_ros import SimpleActionState, ServiceState, IntrospectionServer", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0104, 0, 0.66, 0.2778, 716, 0, 3, 0, 0, 716, 0, 0], "semantic": {"name": "smach_ros", "arg_names": [], "import_names": ["SimpleActionState", "ServiceState", "IntrospectionServer"], "rhs_call_name": "", "annotation": ""}, "snippet": "from smach_ros import SimpleActionState, ServiceState, IntrospectionServer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:Import_L9_C0", "label": "actionlib import actionlib", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0938, 0.0104, 0, 0.66, 0.3333, 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_99393:ImportFrom_L11_C0", "label": "from rfid_servoing.msg import ServoAction, ServoGoal", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1146, 0.0104, 0, 0.66, 0.3889, 317, 0, 2, 0, 0, 317, 0, 0], "semantic": {"name": "rfid_servoing.msg", "arg_names": [], "import_names": ["ServoAction", "ServoGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_servoing.msg import ServoAction, ServoGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:ImportFrom_L12_C0", "label": "from rfid_artoolkit.msg import UpCloseAction, UpCloseGoal", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.0104, 0, 0.66, 0.4444, 547, 0, 2, 0, 0, 547, 0, 0], "semantic": {"name": "rfid_artoolkit.msg", "arg_names": [], "import_names": ["UpCloseAction", "UpCloseGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_artoolkit.msg import UpCloseAction, UpCloseGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:ImportFrom_L13_C0", "label": "from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.1354, 0.0104, 0, 0.66, 0.5, 457, 0, 2, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["PointHeadAction", "PointHeadGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:ImportFrom_L14_C0", "label": "from explore_hrl.msg import ExploreAction, ExploreActionGoal", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.1458, 0.0104, 0, 0.66, 0.5556, 232, 0, 2, 0, 0, 232, 0, 0], "semantic": {"name": "explore_hrl.msg", "arg_names": [], "import_names": ["ExploreAction", "ExploreActionGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from explore_hrl.msg import ExploreAction, ExploreActionGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:ImportFrom_L15_C0", "label": "from rfid_behaviors.srv import HandoffSrv", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1562, 0.0104, 0, 0.66, 0.6111, 647, 0, 1, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["HandoffSrv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import HandoffSrv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:ImportFrom_L16_C0", "label": "from rfid_behaviors.srv import FlapEarsSrv", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.0104, 0, 0.66, 0.6667, 647, 0, 1, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["FlapEarsSrv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import FlapEarsSrv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:ImportFrom_L17_C0", "label": "from rfid_behaviors.srv import OrientSrv", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.1771, 0.0104, 0, 0.66, 0.7222, 647, 0, 1, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["OrientSrv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import String_Int32 as OrientSrv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:ImportFrom_L18_C0", "label": "from rfid_behaviors.srv import OrientSrvRequest", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1875, 0.0104, 0, 0.66, 0.7778, 647, 0, 1, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["OrientSrvRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import String_Int32Request as OrientSrvRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:ImportFrom_L19_C0", "label": "from robotis.srv import MoveAng, MoveAngRequest", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.1979, 0.0104, 0, 0.66, 0.8333, 727, 0, 2, 0, 0, 727, 0, 0], "semantic": {"name": "robotis.srv", "arg_names": [], "import_names": ["MoveAng", "MoveAngRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robotis.srv import MoveAng, MoveAngRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:Import_L22_C0", "label": "yaml import yaml", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.2292, 0.0104, 0, 0.66, 0.8889, 960, 0, 1, 0, 0, 960, 0, 0], "semantic": {"name": "yaml", "arg_names": [], "import_names": ["yaml"], "rhs_call_name": "", "annotation": ""}, "snippet": "import yaml"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:FunctionDef_L24_C0", "label": "sm_rfid_servo_approach", "type": "function", "loc": [24, 71], "level": 0, "parent": null, "vector": [2, 0, 0.4948, 0.5, 0, 0.66, 0.9444, 183, 0, 0, 1, 0, 0, 0, 13], "semantic": {"name": "sm_rfid_servo_approach", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def sm_rfid_servo_approach():\n # Create a SMACH state machine\n sm = smach.StateMachine( outcomes = ['succeeded','aborted','preempted'],\n input_keys = ['tagid'])\n\n # Open the container\n with sm:\n # Initial RFID Ear Flapping"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:Assign_L26_C4", "label": "sm = StateMachine()", "type": "assigned_variable", "loc": [26, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99393:FunctionDef_L24_C0", "vector": [14, 1, 0.276, 0.0208, 1, 0.4, 0.0, 21, 3, 2, 0, 0, 174, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "StateMachine", "annotation": ""}, "snippet": " sm = smach.StateMachine( outcomes = ['succeeded','aborted','preempted'],\n input_keys = ['tagid'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:Expr_L32_C8", "label": "add()", "type": "expression", "loc": [32, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99393:FunctionDef_L24_C0", "vector": [8, 1, 0.349, 0.0417, 1, 0.4, 0.0, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'FLAP_EARS',\n ServiceState( '/rfid_orient/flap', FlapEarsSrv ),\n transitions = { 'succeeded' : 'ORIENT' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:Expr_L38_C8", "label": "add()", "type": "expression", "loc": [38, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99393:FunctionDef_L24_C0", "vector": [8, 1, 0.4271, 0.0729, 1, 0.4, 0.25, 241, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'ORIENT',\n ServiceState( '/rfid_orient/orient',\n OrientSrv,\n request_slots = ['data']), #request = OrientSrvRequest( 'person ' )\n transitions = { 'succeeded' : 'SERVO' },\n remapping = {'data':'tagid'}) # input"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:Expr_L47_C8", "label": "add()", "type": "expression", "loc": [47, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99393:FunctionDef_L24_C0", "vector": [8, 1, 0.5208, 0.0729, 1, 0.4, 0.5, 241, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'SERVO',\n SimpleActionState( '/rfid_servo/servo_act',\n ServoAction,\n goal_slots = ['tagid']), #goal = ServoGoal( 'person ' ),\n transitions = { 'succeeded': 'TUCK_LEFT' },\n remapping = {'tagid':'tagid'}) # input"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:Expr_L56_C8", "label": "add()", "type": "expression", "loc": [56, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99393:FunctionDef_L24_C0", "vector": [8, 1, 0.6094, 0.0625, 1, 0.4, 0.75, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'TUCK_LEFT',\n ServiceState( 'robotis/servo_left_pan_moveangle',\n MoveAng,\n request = MoveAngRequest( 1.350, 0.2, 0 )), # ang (float), angvel (float), blocking (bool)\n transitions = {'succeeded':'TUCK_RIGHT'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:Expr_L64_C8", "label": "add()", "type": "expression", "loc": [64, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99393:FunctionDef_L24_C0", "vector": [8, 1, 0.6927, 0.0625, 1, 0.4, 1.0, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'TUCK_RIGHT',\n ServiceState( 'robotis/servo_right_pan_moveangle',\n MoveAng,\n request = MoveAngRequest( -1.350, 0.2, 0 )), # ang (float), angvel (float), blocking (bool)\n transitions = {'succeeded':'succeeded'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:Return_L71_C4", "label": "return", "type": "return", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99393:FunctionDef_L24_C0", "vector": [13, 1, 0.7396, 0.0104, 1, 0.4, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "label": "if", "type": "if", "loc": [74, 93], "level": 0, "parent": null, "vector": [4, 0, 0.8698, 0.2083, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 10], "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('--tag', action='store', type='string', dest='tagid',\n help='Tagid to approach', default='person ')\n opt, args = p.parse_args()\n\n print('SERVO APPROACH to ID: \\'%s\\'' % (opt.tagid))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:Import_L75_C4", "label": "optparse import optparse", "type": "import", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "vector": [1, 1, 0.7812, 0.0104, 1, 0.84, 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_99393:Assign_L76_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "vector": [14, 1, 0.7917, 0.0104, 1, 0.84, 0.0909, 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_99393:Expr_L77_C4", "label": "add_option()", "type": "expression", "loc": [77, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "vector": [8, 1, 0.8073, 0.0208, 1, 0.84, 0.1818, 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('--tag', action='store', type='string', dest='tagid',\n help='Tagid to approach', default='person ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:Assign_L79_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "vector": [14, 1, 0.8229, 0.0104, 1, 0.84, 0.2727, 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_99393:Expr_L81_C4", "label": "print()", "type": "expression", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "vector": [8, 1, 0.8438, 0.0104, 1, 0.84, 0.3636, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('SERVO APPROACH to ID: \\'%s\\'' % (opt.tagid))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:Expr_L83_C4", "label": "init_node()", "type": "expression", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "vector": [8, 1, 0.8646, 0.0104, 1, 0.84, 0.4545, 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('smach_example_state_machine')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:Assign_L85_C4", "label": "sm = sm_rfid_servo_approach()", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "vector": [14, 1, 0.8854, 0.0104, 1, 0.84, 0.5455, 21, 3, 0, 0, 0, 183, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "sm_rfid_servo_approach", "annotation": ""}, "snippet": " sm = sm_rfid_servo_approach()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:Assign_L87_C4", "label": "sis = IntrospectionServer()", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "vector": [14, 1, 0.9062, 0.0104, 1, 0.84, 0.6364, 608, 3, 3, 0, 0, 702, 10, 1], "semantic": {"name": "sis", "arg_names": [], "import_names": [], "rhs_call_name": "IntrospectionServer", "annotation": ""}, "snippet": " sis = IntrospectionServer('RFID_servo_approach', sm, '/SM_RFID_SERVO_APPROACH')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:Expr_L88_C4", "label": "start()", "type": "expression", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "vector": [8, 1, 0.9167, 0.0104, 1, 0.84, 0.7273, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " sis.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:Assign_L90_C4", "label": "sm.userdata.tagid =", "type": "assigned_variable", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "vector": [14, 1, 0.9375, 0.0104, 1, 0.84, 0.8182, 452, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sm.userdata.tagid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sm.userdata.tagid = opt.tagid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:Assign_L91_C4", "label": "outcome = execute()", "type": "assigned_variable", "loc": [91, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "vector": [14, 1, 0.9479, 0.0104, 1, 0.84, 0.9091, 805, 3, 0, 0, 0, 569, 10, 1], "semantic": {"name": "outcome", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " outcome = sm.execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99393:Expr_L93_C4", "label": "stop()", "type": "expression", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "vector": [8, 1, 0.9688, 0.0104, 1, 0.84, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " sis.stop()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99393:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99393:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99393:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99393:Expr_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99393:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99393:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99393:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99393:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99393:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99393:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99393:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99393:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99393:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99393:Return_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99393:Import_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99393:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99393:Expr_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99393:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99393:Expr_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99393:Expr_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99393:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99393:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99393:Expr_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99393:Assign_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99393:Assign_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99393:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99393:Expr_L93_C4"}]
#! /usr/bin/python import roslib roslib.load_manifest('rfid_demos') import rospy import smach from smach_ros import SimpleActionState, ServiceState, IntrospectionServer import actionlib import sm_rfid_explore import sm_next_best_vantage import sm_rfid_delivery from geometry_msgs.msg import PoseStamped from move_base_msgs.msg import MoveBaseAction def full_delivery(): # Create a SMACH state machine sm = smach.StateMachine(outcomes=['succeeded','aborted','preempted'], input_keys = [ 'tagid', 'explore_radius' ]) # Open the container with sm: sm_search = sm_rfid_explore.sm_search() smach.StateMachine.add( 'RFID_SEARCH', # outcomes: succeded, aborted, preempted sm_search, remapping = { 'tagid' : 'tagid', # input 'explore_radius' : 'explore_radius', # input 'explore_rfid_reads' : 'explore_rfid_reads' }, # output transitions={'succeeded':'BEST_VANTAGE'}) sm_vantage = sm_next_best_vantage.sm_best_vantage() smach.StateMachine.add( 'BEST_VANTAGE', # outcomes: succeeded, aborted, preempted sm_vantage, remapping = { 'tagid' : 'tagid', # input 'rfid_reads' : 'explore_rfid_reads' }, # input transitions = {'succeeded':'DELIVERY'}) sm_delivery = sm_rfid_delivery.sm_delivery() smach.StateMachine.add( 'DELIVERY', # outcomes: succeeded, aborted, preempted sm_delivery, remapping = { 'tagid' : 'tagid'}, #input transitions = { 'succeeded': 'succeeded' }) # Execute SMACH plan return sm if __name__ == '__main__': rospy.init_node('smach_example_state_machine') sm = full_delivery() sis = IntrospectionServer('RFID_full_delivery', sm, '/SM_ROOT_FULL_DELIVERY') sis.start() rospy.sleep(3.0) sm.userdata.tagid = 'person ' sm.userdata.explore_radius = 2.7 outcome = sm.execute() rospy.spin() sis.stop()
ajibawa-2023/Python-Code-Large/train/row_99394
31
70
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99394:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0286, 0.0143, 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_99394:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0429, 0.0143, 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('rfid_demos')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0571, 0.0143, 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_99394:Import_L6_C0", "label": "smach import smach", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0857, 0.0143, 0, 0.66, 0.25, 345, 0, 1, 0, 0, 345, 0, 0], "semantic": {"name": "smach", "arg_names": [], "import_names": ["smach"], "rhs_call_name": "", "annotation": ""}, "snippet": "import smach"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:ImportFrom_L7_C0", "label": "from smach_ros import SimpleActionState, ServiceState, IntrospectionServer", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.0143, 0, 0.66, 0.3333, 716, 0, 3, 0, 0, 716, 0, 0], "semantic": {"name": "smach_ros", "arg_names": [], "import_names": ["SimpleActionState", "ServiceState", "IntrospectionServer"], "rhs_call_name": "", "annotation": ""}, "snippet": "from smach_ros import SimpleActionState, ServiceState, IntrospectionServer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:Import_L8_C0", "label": "actionlib import actionlib", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1143, 0.0143, 0, 0.66, 0.4167, 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_99394:Import_L10_C0", "label": "sm_rfid_explore import sm_rfid_explore", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0143, 0, 0.66, 0.5, 972, 0, 1, 0, 0, 972, 0, 0], "semantic": {"name": "sm_rfid_explore", "arg_names": [], "import_names": ["sm_rfid_explore"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sm_rfid_explore"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:Import_L11_C0", "label": "sm_next_best_vantage import sm_next_best_vantage", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1571, 0.0143, 0, 0.66, 0.5833, 637, 0, 1, 0, 0, 637, 0, 0], "semantic": {"name": "sm_next_best_vantage", "arg_names": [], "import_names": ["sm_next_best_vantage"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sm_next_best_vantage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:Import_L12_C0", "label": "sm_rfid_delivery import sm_rfid_delivery", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1714, 0.0143, 0, 0.66, 0.6667, 55, 0, 1, 0, 0, 55, 0, 0], "semantic": {"name": "sm_rfid_delivery", "arg_names": [], "import_names": ["sm_rfid_delivery"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sm_rfid_delivery"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:ImportFrom_L13_C0", "label": "from geometry_msgs.msg import PoseStamped", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.1857, 0.0143, 0, 0.66, 0.75, 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_99394:ImportFrom_L14_C0", "label": "from move_base_msgs.msg import MoveBaseAction", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.0143, 0, 0.66, 0.8333, 440, 0, 1, 0, 0, 440, 0, 0], "semantic": {"name": "move_base_msgs.msg", "arg_names": [], "import_names": ["MoveBaseAction"], "rhs_call_name": "", "annotation": ""}, "snippet": "from move_base_msgs.msg import MoveBaseAction"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:FunctionDef_L17_C0", "label": "full_delivery", "type": "function", "loc": [17, 50], "level": 0, "parent": null, "vector": [2, 0, 0.4786, 0.4857, 0, 0.66, 0.9167, 11, 0, 0, 1, 0, 0, 0, 7], "semantic": {"name": "full_delivery", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def full_delivery():\n # Create a SMACH state machine\n sm = smach.StateMachine(outcomes=['succeeded','aborted','preempted'],\n input_keys = [ 'tagid', 'explore_radius' ])\n\n # Open the container\n with sm:\n sm_search = sm_rfid_explore.sm_search()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:Assign_L19_C4", "label": "sm = StateMachine()", "type": "assigned_variable", "loc": [19, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99394:FunctionDef_L17_C0", "vector": [14, 1, 0.2786, 0.0286, 1, 0.08, 0.0, 21, 3, 2, 0, 0, 174, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "StateMachine", "annotation": ""}, "snippet": " sm = smach.StateMachine(outcomes=['succeeded','aborted','preempted'],\n input_keys = [ 'tagid', 'explore_radius' ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:Assign_L24_C8", "label": "sm_search = sm_search()", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99394:FunctionDef_L17_C0", "vector": [14, 1, 0.3429, 0.0143, 1, 0.08, 0.0, 542, 3, 0, 0, 0, 542, 10, 1], "semantic": {"name": "sm_search", "arg_names": [], "import_names": [], "rhs_call_name": "sm_search", "annotation": ""}, "snippet": " sm_search = sm_rfid_explore.sm_search()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:Expr_L25_C8", "label": "add()", "type": "expression", "loc": [25, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99394:FunctionDef_L17_C0", "vector": [8, 1, 0.4, 0.1, 1, 0.08, 0.2, 241, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'RFID_SEARCH', # outcomes: succeded, aborted, preempted\n sm_search,\n remapping = { 'tagid' : 'tagid', # input\n 'explore_radius' : 'explore_radius', # input\n 'explore_rfid_reads' : 'explore_rfid_reads' }, # output\n transitions={'succeeded':'BEST_VANTAGE'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:Assign_L33_C8", "label": "sm_vantage = sm_best_vantage()", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99394:FunctionDef_L17_C0", "vector": [14, 1, 0.4714, 0.0143, 1, 0.08, 0.4, 126, 3, 0, 0, 0, 480, 10, 1], "semantic": {"name": "sm_vantage", "arg_names": [], "import_names": [], "rhs_call_name": "sm_best_vantage", "annotation": ""}, "snippet": " sm_vantage = sm_next_best_vantage.sm_best_vantage()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:Expr_L34_C8", "label": "add()", "type": "expression", "loc": [34, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99394:FunctionDef_L17_C0", "vector": [8, 1, 0.5214, 0.0857, 1, 0.08, 0.6, 241, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'BEST_VANTAGE', # outcomes: succeeded, aborted, preempted\n sm_vantage,\n remapping = { 'tagid' : 'tagid', # input\n 'rfid_reads' : 'explore_rfid_reads' }, # input\n transitions = {'succeeded':'DELIVERY'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:Assign_L41_C8", "label": "sm_delivery = sm_delivery()", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99394:FunctionDef_L17_C0", "vector": [14, 1, 0.5857, 0.0143, 1, 0.08, 0.8, 298, 3, 0, 0, 0, 298, 10, 1], "semantic": {"name": "sm_delivery", "arg_names": [], "import_names": [], "rhs_call_name": "sm_delivery", "annotation": ""}, "snippet": " sm_delivery = sm_rfid_delivery.sm_delivery()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:Expr_L42_C8", "label": "add()", "type": "expression", "loc": [42, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99394:FunctionDef_L17_C0", "vector": [8, 1, 0.6286, 0.0714, 1, 0.08, 1.0, 241, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'DELIVERY', # outcomes: succeeded, aborted, preempted\n sm_delivery,\n remapping = { 'tagid' : 'tagid'}, #input\n transitions = { 'succeeded': 'succeeded' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:Return_L50_C4", "label": "return", "type": "return", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99394:FunctionDef_L17_C0", "vector": [13, 1, 0.7143, 0.0143, 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 sm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:If_L53_C0", "label": "if", "type": "if", "loc": [53, 67], "level": 0, "parent": null, "vector": [4, 0, 0.8571, 0.2143, 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 rospy.init_node('smach_example_state_machine')\n\n sm = full_delivery()\n\n sis = IntrospectionServer('RFID_full_delivery', sm, '/SM_ROOT_FULL_DELIVERY')\n sis.start()\n rospy.sleep(3.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:Expr_L54_C4", "label": "init_node()", "type": "expression", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99394:If_L53_C0", "vector": [8, 1, 0.7714, 0.0143, 1, 0.26, 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('smach_example_state_machine')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:Assign_L56_C4", "label": "sm = full_delivery()", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99394:If_L53_C0", "vector": [14, 1, 0.8, 0.0143, 1, 0.26, 0.1111, 21, 3, 0, 0, 0, 11, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "full_delivery", "annotation": ""}, "snippet": " sm = full_delivery()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:Assign_L58_C4", "label": "sis = IntrospectionServer()", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99394:If_L53_C0", "vector": [14, 1, 0.8286, 0.0143, 1, 0.26, 0.2222, 608, 3, 3, 0, 0, 702, 10, 1], "semantic": {"name": "sis", "arg_names": [], "import_names": [], "rhs_call_name": "IntrospectionServer", "annotation": ""}, "snippet": " sis = IntrospectionServer('RFID_full_delivery', sm, '/SM_ROOT_FULL_DELIVERY')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:Expr_L59_C4", "label": "start()", "type": "expression", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99394:If_L53_C0", "vector": [8, 1, 0.8429, 0.0143, 1, 0.26, 0.3333, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " sis.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:Expr_L60_C4", "label": "sleep()", "type": "expression", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99394:If_L53_C0", "vector": [8, 1, 0.8571, 0.0143, 1, 0.26, 0.4444, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(3.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:Assign_L62_C4", "label": "sm.userdata.tagid =", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99394:If_L53_C0", "vector": [14, 1, 0.8857, 0.0143, 1, 0.26, 0.5556, 452, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "sm.userdata.tagid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sm.userdata.tagid = 'person '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:Assign_L63_C4", "label": "sm.userdata.explore_radius =", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99394:If_L53_C0", "vector": [14, 1, 0.9, 0.0143, 1, 0.26, 0.6667, 383, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "sm.userdata.explore_radius", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sm.userdata.explore_radius = 2.7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:Assign_L64_C4", "label": "outcome = execute()", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99394:If_L53_C0", "vector": [14, 1, 0.9143, 0.0143, 1, 0.26, 0.7778, 805, 3, 0, 0, 0, 569, 10, 1], "semantic": {"name": "outcome", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " outcome = sm.execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99394:Expr_L66_C4", "label": "spin()", "type": "expression", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99394:If_L53_C0", "vector": [8, 1, 0.9429, 0.0143, 1, 0.26, 0.8889, 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_99394:Expr_L67_C4", "label": "stop()", "type": "expression", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99394:If_L53_C0", "vector": [8, 1, 0.9571, 0.0143, 1, 0.26, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " sis.stop()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99394:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99394:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99394:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99394:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99394:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99394:Expr_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99394:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99394:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99394:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99394:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99394:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99394:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99394:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99394:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99394:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99394:Return_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99394:If_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99394:Expr_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99394:If_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99394:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99394:If_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99394:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99394:If_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99394:Expr_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99394:If_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99394:Expr_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99394:If_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99394:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99394:If_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99394:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99394:If_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99394:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99394:If_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99394:Expr_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99394:If_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99394:Expr_L67_C4"}]
#! /usr/bin/python import roslib roslib.load_manifest('rfid_demos') roslib.load_manifest('rfid_behaviors') roslib.load_manifest('hrl_object_fetching') roslib.load_manifest('hrl_trajectory_playback') roslib.load_manifest('pr2_overhead_grasping') roslib.load_manifest('pr2_controllers_msgs') import rospy import smach import actionlib from smach_ros import SimpleActionState, ServiceState, IntrospectionServer from geometry_msgs.msg import PoseStamped from move_base_msgs.msg import MoveBaseAction from rfid_behaviors.srv import NextBestVantage from rfid_behaviors.srv import HandoffSrv, HandoffSrvRequest from rfid_behaviors.srv import FloatFloat_Int32Request as RotateBackupSrvRequest from rfid_behaviors.srv import FloatFloat_Int32 as RotateBackupSrv from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal import sm_rfid_delivery #from sm_next_best_vantage import BestVantage import sm_fetch import sm_rfid_explore class PrintStr(smach.State): def __init__(self, ins = 'Hello'): smach.State.__init__(self, outcomes=['succeeded', 'aborted', 'preempted']) self.ins = ins def execute(self, userdata): rospy.logout( 'Executing PrintStr: %s' % self.ins ) rospy.sleep(4.0) return 'succeeded' def cousins_demo(): # Create a SMACH state machine sm = smach.StateMachine(outcomes=['succeeded','aborted','preempted'], input_keys = [ 'explore_id', # should be '' 'obj_id', 'person_id', 'explore_radius' ]) with sm: sm_search = sm_rfid_explore.sm_search() smach.StateMachine.add( 'RFID_SEARCH', # outcomes: succeded, aborted, preempted sm_search, remapping = { 'tagid' : 'explore_id', # input 'explore_radius' : 'explore_radius' }, transitions={'succeeded':'BEST_VANTAGE_OBJ'}) # Get best vantage for obj. # The NextBestVantage was initialized in the search. smach.StateMachine.add( 'BEST_VANTAGE_OBJ', ServiceState( '/rfid_recorder/best_vantage', NextBestVantage, request_slots = ['tagid'], response_slots = ['best_vantage']), remapping = {'best_vantage':'best_vantage_obj', # output 'tagid':'obj_id'}, # input transitions = {'succeeded':'MOVE_VANTAGE_OBJ'}) smach.StateMachine.add( 'MOVE_VANTAGE_OBJ', SimpleActionState( '/move_base', MoveBaseAction, goal_slots = [ 'target_pose' ]), remapping = { 'target_pose' : 'best_vantage_obj' }, # input transitions = {'aborted':'BEST_VANTAGE_OBJ', 'preempted':'aborted', 'succeeded':'FETCH'}) # # FETCH # smach.StateMachine.add('FETCH',PrintStr( 'Fetching object' ), # transitions = { 'succeeded' : 'BEST_VANTAGE_PERSON' }) # Fetch smach.StateMachine.add( 'FETCH', sm_fetch.sm_fetch_object(), remapping = {'tagid':'obj_id'}, transitions = {'succeeded':'POINT_HEAD', 'aborted':'BACKUP'}) # Backup (60cm) smach.StateMachine.add( 'BACKUP', ServiceState( '/rotate_backup', RotateBackupSrv, request = RotateBackupSrvRequest(0.0, -0.50)), transitions = { 'succeeded':'PRE_STOW' }) smach.StateMachine.add( 'PRE_STOW', ServiceState( 'rfid_handoff/stow_grasp', HandoffSrv, request = HandoffSrvRequest()), transitions = { 'succeeded':'POINT_HEAD' }) # Point Head Down (eventaully roll this and perceive table into own sm?) pgoal = PointHeadGoal() pgoal.target.header.frame_id = '/torso_lift_link' pgoal.target.point.x = 0.50 pgoal.target.point.z = 0.30 pgoal.min_duration = rospy.Duration(0.6) pgoal.max_velocity = 1.0 smach.StateMachine.add( 'POINT_HEAD', SimpleActionState( '/head_traj_controller/point_head_action', PointHeadAction, goal = pgoal ), transitions = { 'succeeded' : 'BEST_VANTAGE_PERSON' }) # Get best vantage for obj. # The NextBestVantage was initialized in the search. smach.StateMachine.add( 'BEST_VANTAGE_PERSON', ServiceState( '/rfid_recorder/best_vantage', NextBestVantage, request_slots = ['tagid'], response_slots = ['best_vantage']), remapping = {'best_vantage':'best_vantage_person', # output 'tagid':'person_id'}, # input transitions = {'succeeded':'MOVE_VANTAGE_PERSON'}) smach.StateMachine.add( 'MOVE_VANTAGE_PERSON', SimpleActionState( '/move_base', MoveBaseAction, goal_slots = [ 'target_pose' ]), remapping = { 'target_pose' : 'best_vantage_person' }, # input transitions = {'aborted':'BEST_VANTAGE_PERSON', 'preempted':'aborted', 'succeeded':'DELIVERY'}) sm_delivery = sm_rfid_delivery.sm_delivery() smach.StateMachine.add( 'DELIVERY', # outcomes: succeeded, aborted, preempted sm_delivery, remapping = { 'tagid' : 'person_id'}, #input transitions = { 'succeeded': 'succeeded' }) return sm if __name__ == '__main__': rospy.init_node('smach_rfid_explore') sm = cousins_demo() sis = IntrospectionServer('sm_cousins_demo', sm, '/SM_COUSINS_DEMO') sis.start() rospy.logout( 'READY TO RUN COUSINS DEMO' ) sm.userdata.explore_id = '' sm.userdata.obj_id = 'SpectrMedBot' sm.userdata.person_id = 'person ' sm.userdata.explore_radius = 1.8 # sm.userdata.explore_rfid_reads = [] outcome = sm.execute() rospy.spin() sis.stop()
ajibawa-2023/Python-Code-Large/train/row_99395
63
175
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0114, 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"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0171, 0.0057, 0, 0.66, 0.0435, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('rfid_demos')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0229, 0.0057, 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": "roslib.load_manifest('rfid_behaviors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0286, 0.0057, 0, 0.66, 0.1304, 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_object_fetching')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0343, 0.0057, 0, 0.66, 0.1739, 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_trajectory_playback')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.04, 0.0057, 0, 0.66, 0.2174, 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_overhead_grasping')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0457, 0.0057, 0, 0.66, 0.2609, 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_controllers_msgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Import_L9_C0", "label": "rospy import rospy", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0514, 0.0057, 0, 0.66, 0.3043, 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_99395:Import_L11_C0", "label": "smach import smach", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0629, 0.0057, 0, 0.66, 0.3478, 345, 0, 1, 0, 0, 345, 0, 0], "semantic": {"name": "smach", "arg_names": [], "import_names": ["smach"], "rhs_call_name": "", "annotation": ""}, "snippet": "import smach"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Import_L12_C0", "label": "actionlib import actionlib", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0686, 0.0057, 0, 0.66, 0.3913, 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_99395:ImportFrom_L14_C0", "label": "from smach_ros import SimpleActionState, ServiceState, IntrospectionServer", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.08, 0.0057, 0, 0.66, 0.4348, 716, 0, 3, 0, 0, 716, 0, 0], "semantic": {"name": "smach_ros", "arg_names": [], "import_names": ["SimpleActionState", "ServiceState", "IntrospectionServer"], "rhs_call_name": "", "annotation": ""}, "snippet": "from smach_ros import SimpleActionState, ServiceState, IntrospectionServer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:ImportFrom_L15_C0", "label": "from geometry_msgs.msg import PoseStamped", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0857, 0.0057, 0, 0.66, 0.4783, 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_99395:ImportFrom_L16_C0", "label": "from move_base_msgs.msg import MoveBaseAction", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0914, 0.0057, 0, 0.66, 0.5217, 440, 0, 1, 0, 0, 440, 0, 0], "semantic": {"name": "move_base_msgs.msg", "arg_names": [], "import_names": ["MoveBaseAction"], "rhs_call_name": "", "annotation": ""}, "snippet": "from move_base_msgs.msg import MoveBaseAction"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:ImportFrom_L17_C0", "label": "from rfid_behaviors.srv import NextBestVantage", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0971, 0.0057, 0, 0.66, 0.5652, 647, 0, 1, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["NextBestVantage"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import NextBestVantage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:ImportFrom_L18_C0", "label": "from rfid_behaviors.srv import HandoffSrv, HandoffSrvRequest", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1029, 0.0057, 0, 0.66, 0.6087, 647, 0, 2, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["HandoffSrv", "HandoffSrvRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import HandoffSrv, HandoffSrvRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:ImportFrom_L19_C0", "label": "from rfid_behaviors.srv import RotateBackupSrvRequest", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.1086, 0.0057, 0, 0.66, 0.6522, 647, 0, 1, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["RotateBackupSrvRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import FloatFloat_Int32Request as RotateBackupSrvRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:ImportFrom_L20_C0", "label": "from rfid_behaviors.srv import RotateBackupSrv", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.1143, 0.0057, 0, 0.66, 0.6957, 647, 0, 1, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["RotateBackupSrv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import FloatFloat_Int32 as RotateBackupSrv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:ImportFrom_L21_C0", "label": "from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.12, 0.0057, 0, 0.66, 0.7391, 457, 0, 2, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["PointHeadAction", "PointHeadGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Import_L23_C0", "label": "sm_rfid_delivery import sm_rfid_delivery", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.1314, 0.0057, 0, 0.66, 0.7826, 55, 0, 1, 0, 0, 55, 0, 0], "semantic": {"name": "sm_rfid_delivery", "arg_names": [], "import_names": ["sm_rfid_delivery"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sm_rfid_delivery"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Import_L25_C0", "label": "sm_fetch import sm_fetch", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0057, 0, 0.66, 0.8261, 695, 0, 1, 0, 0, 695, 0, 0], "semantic": {"name": "sm_fetch", "arg_names": [], "import_names": ["sm_fetch"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sm_fetch"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Import_L26_C0", "label": "sm_rfid_explore import sm_rfid_explore", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.1486, 0.0057, 0, 0.66, 0.8696, 972, 0, 1, 0, 0, 972, 0, 0], "semantic": {"name": "sm_rfid_explore", "arg_names": [], "import_names": ["sm_rfid_explore"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sm_rfid_explore"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:ClassDef_L28_C0", "label": "PrintStr", "type": "class", "loc": [28, 36], "level": 0, "parent": null, "vector": [3, 0, 0.1829, 0.0514, 0, 0.66, 0.913, 476, 0, 2, 0, 0, 892, 0, 3], "semantic": {"name": "PrintStr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PrintStr(smach.State):\n def __init__(self, ins = 'Hello'):\n smach.State.__init__(self, outcomes=['succeeded', 'aborted', 'preempted'])\n self.ins = ins\n\n def execute(self, userdata):\n rospy.logout( 'Executing PrintStr: %s' % self.ins )\n rospy.sleep(4.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L29_C4", "label": "__init__", "type": "function", "loc": [29, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:ClassDef_L28_C0", "vector": [2, 1, 0.1714, 0.0171, 1, 0.43, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "ins"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, ins = 'Hello'):\n smach.State.__init__(self, outcomes=['succeeded', 'aborted', 'preempted'])\n self.ins = ins"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L30_C8", "label": "__init__()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L29_C4", "vector": [8, 2, 0.1714, 0.0057, 2, 0.05, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " smach.State.__init__(self, outcomes=['succeeded', 'aborted', 'preempted'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L31_C8", "label": "self.ins =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L29_C4", "vector": [14, 2, 0.1771, 0.0057, 2, 0.05, 1.0, 485, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.ins", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ins = ins"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L33_C4", "label": "execute", "type": "function", "loc": [33, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:ClassDef_L28_C0", "vector": [2, 1, 0.1971, 0.0229, 1, 0.43, 1.0, 569, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "execute", "arg_names": ["self", "userdata"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute(self, userdata):\n rospy.logout( 'Executing PrintStr: %s' % self.ins )\n rospy.sleep(4.0)\n return 'succeeded'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L34_C8", "label": "logout()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L33_C4", "vector": [8, 2, 0.1943, 0.0057, 2, 0.82, 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( 'Executing PrintStr: %s' % self.ins )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L35_C8", "label": "sleep()", "type": "expression", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L33_C4", "vector": [8, 2, 0.2, 0.0057, 2, 0.82, 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(4.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Return_L36_C8", "label": "return", "type": "return", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L33_C4", "vector": [13, 2, 0.2057, 0.0057, 2, 0.82, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'succeeded'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "label": "cousins_demo", "type": "function", "loc": [40, 150], "level": 0, "parent": null, "vector": [2, 0, 0.5429, 0.6343, 0, 0.66, 0.9565, 546, 0, 0, 1, 0, 0, 0, 25], "semantic": {"name": "cousins_demo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def cousins_demo():\n # Create a SMACH state machine\n sm = smach.StateMachine(outcomes=['succeeded','aborted','preempted'],\n input_keys = [ 'explore_id', # should be ''\n 'obj_id',\n 'person_id',\n 'explore_radius' ])\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L42_C4", "label": "sm = StateMachine()", "type": "assigned_variable", "loc": [42, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "vector": [14, 1, 0.2514, 0.0286, 1, 0.82, 0.0, 21, 3, 2, 0, 0, 174, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "StateMachine", "annotation": ""}, "snippet": " sm = smach.StateMachine(outcomes=['succeeded','aborted','preempted'],\n input_keys = [ 'explore_id', # should be ''\n 'obj_id',\n 'person_id',\n 'explore_radius' ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L49_C8", "label": "sm_search = sm_search()", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "vector": [14, 1, 0.28, 0.0057, 1, 0.82, 0.0, 542, 3, 0, 0, 0, 542, 10, 1], "semantic": {"name": "sm_search", "arg_names": [], "import_names": [], "rhs_call_name": "sm_search", "annotation": ""}, "snippet": " sm_search = sm_rfid_explore.sm_search()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L50_C8", "label": "add()", "type": "expression", "loc": [50, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "vector": [8, 1, 0.3, 0.0343, 1, 0.82, 0.0588, 241, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'RFID_SEARCH', # outcomes: succeded, aborted, preempted\n sm_search,\n remapping = { 'tagid' : 'explore_id', # input\n 'explore_radius' : 'explore_radius' },\n transitions={'succeeded':'BEST_VANTAGE_OBJ'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L59_C8", "label": "add()", "type": "expression", "loc": [59, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "vector": [8, 1, 0.36, 0.0514, 1, 0.82, 0.1176, 241, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'BEST_VANTAGE_OBJ',\n ServiceState( '/rfid_recorder/best_vantage',\n NextBestVantage,\n request_slots = ['tagid'],\n response_slots = ['best_vantage']),\n remapping = {'best_vantage':'best_vantage_obj', # output\n 'tagid':'obj_id'}, # input"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L70_C8", "label": "add()", "type": "expression", "loc": [70, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "vector": [8, 1, 0.4229, 0.0514, 1, 0.82, 0.1765, 241, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'MOVE_VANTAGE_OBJ',\n SimpleActionState( '/move_base',\n MoveBaseAction,\n goal_slots = [ 'target_pose' ]),\n remapping = { 'target_pose' : 'best_vantage_obj' }, # input\n transitions = {'aborted':'BEST_VANTAGE_OBJ',\n 'preempted':'aborted',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L84_C8", "label": "add()", "type": "expression", "loc": [84, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "vector": [8, 1, 0.4943, 0.0343, 1, 0.82, 0.2353, 241, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'FETCH',\n sm_fetch.sm_fetch_object(),\n remapping = {'tagid':'obj_id'},\n transitions = {'succeeded':'POINT_HEAD',\n 'aborted':'BACKUP'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L92_C8", "label": "add()", "type": "expression", "loc": [92, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "vector": [8, 1, 0.54, 0.0343, 1, 0.82, 0.2941, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'BACKUP',\n ServiceState( '/rotate_backup',\n RotateBackupSrv,\n request = RotateBackupSrvRequest(0.0, -0.50)), \n transitions = { 'succeeded':'PRE_STOW' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L99_C8", "label": "add()", "type": "expression", "loc": [99, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "vector": [8, 1, 0.58, 0.0343, 1, 0.82, 0.3529, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'PRE_STOW',\n ServiceState( 'rfid_handoff/stow_grasp',\n HandoffSrv,\n request = HandoffSrvRequest()), \n transitions = { 'succeeded':'POINT_HEAD' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L107_C8", "label": "pgoal = PointHeadGoal()", "type": "assigned_variable", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "vector": [14, 1, 0.6114, 0.0057, 1, 0.82, 0.4118, 882, 3, 0, 0, 0, 479, 10, 1], "semantic": {"name": "pgoal", "arg_names": [], "import_names": [], "rhs_call_name": "PointHeadGoal", "annotation": ""}, "snippet": " pgoal = PointHeadGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L108_C8", "label": "pgoal.target.header.frame_id =", "type": "assigned_variable", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "vector": [14, 1, 0.6171, 0.0057, 1, 0.82, 0.4706, 99, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "pgoal.target.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pgoal.target.header.frame_id = '/torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L109_C8", "label": "pgoal.target.point.x =", "type": "assigned_variable", "loc": [109, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "vector": [14, 1, 0.6229, 0.0057, 1, 0.82, 0.5294, 801, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "pgoal.target.point.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pgoal.target.point.x = 0.50"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L110_C8", "label": "pgoal.target.point.z =", "type": "assigned_variable", "loc": [110, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "vector": [14, 1, 0.6286, 0.0057, 1, 0.82, 0.5882, 591, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "pgoal.target.point.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pgoal.target.point.z = 0.30"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L111_C8", "label": "pgoal.min_duration = Duration()", "type": "assigned_variable", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "vector": [14, 1, 0.6343, 0.0057, 1, 0.82, 0.6471, 457, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "pgoal.min_duration", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " pgoal.min_duration = rospy.Duration(0.6)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L112_C8", "label": "pgoal.max_velocity =", "type": "assigned_variable", "loc": [112, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "vector": [14, 1, 0.64, 0.0057, 1, 0.82, 0.7059, 412, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "pgoal.max_velocity", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pgoal.max_velocity = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L113_C8", "label": "add()", "type": "expression", "loc": [113, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "vector": [8, 1, 0.66, 0.0343, 1, 0.82, 0.7647, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'POINT_HEAD',\n SimpleActionState( '/head_traj_controller/point_head_action',\n PointHeadAction,\n goal = pgoal ),\n transitions = { 'succeeded' : 'BEST_VANTAGE_PERSON' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L123_C8", "label": "add()", "type": "expression", "loc": [123, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "vector": [8, 1, 0.7257, 0.0514, 1, 0.82, 0.8235, 241, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'BEST_VANTAGE_PERSON',\n ServiceState( '/rfid_recorder/best_vantage',\n NextBestVantage,\n request_slots = ['tagid'],\n response_slots = ['best_vantage']),\n remapping = {'best_vantage':'best_vantage_person', # output\n 'tagid':'person_id'}, # input"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L133_C8", "label": "add()", "type": "expression", "loc": [133, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "vector": [8, 1, 0.7829, 0.0514, 1, 0.82, 0.8824, 241, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'MOVE_VANTAGE_PERSON',\n SimpleActionState( '/move_base',\n MoveBaseAction,\n goal_slots = [ 'target_pose' ]),\n remapping = { 'target_pose' : 'best_vantage_person' }, # input\n transitions = {'aborted':'BEST_VANTAGE_PERSON',\n 'preempted':'aborted',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L143_C8", "label": "sm_delivery = sm_delivery()", "type": "assigned_variable", "loc": [143, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "vector": [14, 1, 0.8171, 0.0057, 1, 0.82, 0.9412, 298, 3, 0, 0, 0, 298, 10, 1], "semantic": {"name": "sm_delivery", "arg_names": [], "import_names": [], "rhs_call_name": "sm_delivery", "annotation": ""}, "snippet": " sm_delivery = sm_rfid_delivery.sm_delivery()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L144_C8", "label": "add()", "type": "expression", "loc": [144, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "vector": [8, 1, 0.8343, 0.0286, 1, 0.82, 1.0, 241, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'DELIVERY', # outcomes: succeeded, aborted, preempted\n sm_delivery,\n remapping = { 'tagid' : 'person_id'}, #input\n transitions = { 'succeeded': 'succeeded' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Return_L150_C4", "label": "return", "type": "return", "loc": [150, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "vector": [13, 1, 0.8571, 0.0057, 1, 0.82, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "label": "if", "type": "if", "loc": [154, 172], "level": 0, "parent": null, "vector": [4, 0, 0.9314, 0.1086, 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 rospy.init_node('smach_rfid_explore')\n\n sm = cousins_demo()\n\n sis = IntrospectionServer('sm_cousins_demo', sm, '/SM_COUSINS_DEMO')\n sis.start()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L155_C4", "label": "init_node()", "type": "expression", "loc": [155, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "vector": [8, 1, 0.8857, 0.0057, 1, 0.21, 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('smach_rfid_explore')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L157_C4", "label": "sm = cousins_demo()", "type": "assigned_variable", "loc": [157, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "vector": [14, 1, 0.8971, 0.0057, 1, 0.21, 0.0909, 21, 3, 0, 0, 0, 546, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "cousins_demo", "annotation": ""}, "snippet": " sm = cousins_demo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L159_C4", "label": "sis = IntrospectionServer()", "type": "assigned_variable", "loc": [159, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "vector": [14, 1, 0.9086, 0.0057, 1, 0.21, 0.1818, 608, 3, 3, 0, 0, 702, 10, 1], "semantic": {"name": "sis", "arg_names": [], "import_names": [], "rhs_call_name": "IntrospectionServer", "annotation": ""}, "snippet": " sis = IntrospectionServer('sm_cousins_demo', sm, '/SM_COUSINS_DEMO')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L160_C4", "label": "start()", "type": "expression", "loc": [160, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "vector": [8, 1, 0.9143, 0.0057, 1, 0.21, 0.2727, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " sis.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L162_C4", "label": "logout()", "type": "expression", "loc": [162, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "vector": [8, 1, 0.9257, 0.0057, 1, 0.21, 0.3636, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'READY TO RUN COUSINS DEMO' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L164_C4", "label": "sm.userdata.explore_id =", "type": "assigned_variable", "loc": [164, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "vector": [14, 1, 0.9371, 0.0057, 1, 0.21, 0.4545, 523, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "sm.userdata.explore_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sm.userdata.explore_id = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L165_C4", "label": "sm.userdata.obj_id =", "type": "assigned_variable", "loc": [165, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "vector": [14, 1, 0.9429, 0.0057, 1, 0.21, 0.5455, 506, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "sm.userdata.obj_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sm.userdata.obj_id = 'SpectrMedBot'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L166_C4", "label": "sm.userdata.person_id =", "type": "assigned_variable", "loc": [166, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "vector": [14, 1, 0.9486, 0.0057, 1, 0.21, 0.6364, 760, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "sm.userdata.person_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sm.userdata.person_id = 'person '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L167_C4", "label": "sm.userdata.explore_radius =", "type": "assigned_variable", "loc": [167, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "vector": [14, 1, 0.9543, 0.0057, 1, 0.21, 0.7273, 383, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "sm.userdata.explore_radius", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sm.userdata.explore_radius = 1.8"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L169_C4", "label": "outcome = execute()", "type": "assigned_variable", "loc": [169, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "vector": [14, 1, 0.9657, 0.0057, 1, 0.21, 0.8182, 805, 3, 0, 0, 0, 569, 10, 1], "semantic": {"name": "outcome", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " outcome = sm.execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L171_C4", "label": "spin()", "type": "expression", "loc": [171, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "vector": [8, 1, 0.9771, 0.0057, 1, 0.21, 0.9091, 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_99395:Expr_L172_C4", "label": "stop()", "type": "expression", "loc": [172, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "vector": [8, 1, 0.9829, 0.0057, 1, 0.21, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " sis.stop()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99395:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Return_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Return_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Assign_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99395:If_L154_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99395:Expr_L172_C4"}]
#! /usr/bin/python import roslib roslib.load_manifest('rfid_demos') import rospy import smach import tf from smach_ros import SimpleActionState, ServiceState, IntrospectionServer import actionlib from geometry_msgs.msg import PoseStamped from move_base_msgs.msg import MoveBaseAction from rfid_behaviors.srv import RecorderSrv from rfid_behaviors.msg import RecorderReads import numpy as np, math class BestVantage(smach.State): def __init__(self): smach.State.__init__(self, outcomes=['succeeded', 'aborted'], input_keys = ['tagid', 'rfid_reads'], output_keys = ['best_vantage', 'filtered_reads']) self.initialized = False self.orig_reads = [] # holds the original data self.curr_reads = [] # holds data after processing self.last_pose = None def execute(self, userdata): rospy.logout('BestVantage: Calculating' ) if not self.initialized: self.initialized = True # [ RFIDread, PoseStamped_Antenna(map frame), PoseStamped_BaseLink(map frame) self.orig_reads = userdata.rfid_reads # (RecorderReads[]) self.curr_reads = [ r for r in self.orig_reads if r != None and r.read.rssi != -1 and r.read.tagID == userdata.tagid ] else: rospy.logout( 'BestVantage: First try did not work, eh? Filtering and retrying a new vantage.' ) return 'aborted' if not self.curr_reads: rospy.logout( 'BestVantage: No more positive-read poses to consider.' ) return 'aborted' rssi = [ r.read.rssi for r in self.curr_reads ] ind = np.argmax( rssi ) best = self.curr_reads[ ind ] # RecorderRead best_read = best.read best_ant = best.ps_ant_map best_base = best.ps_base_map #print best_read, best_ant, best_base # We're going to keep the <x,y> location from the baselink (mapframe), # but keep <ang> (mapframe) from the antenna. ps = PoseStamped() ps.header.stamp = rospy.Time.now() ps.header.frame_id = best_base.header.frame_id ps.pose.position = best_base.pose.position ps.pose.orientation = best_ant.pose.orientation userdata.best_vantage = ps userdata.filtered_reads = self.curr_reads return 'succeeded' def sm_best_vantage(): sm = smach.StateMachine( outcomes = ['succeeded', 'aborted'], input_keys = ['rfid_reads', 'tagid']) with sm: smach.StateMachine.add( 'SELECT_BEST_VANTAGE', BestVantage(), remapping = { 'tagid' : 'tagid', # input (string) 'rfid_reads' : 'rfid_reads', # input (RecorderReads) 'best_vantage' : 'best_vantage', # output (PoseStamped) 'filtered_reads' : 'filtered_reads' }, # output (RecorderReads) transitions = {'succeeded':'MOVE_BEST_VANTAGE'}) smach.StateMachine.add( 'MOVE_BEST_VANTAGE', SimpleActionState( '/move_base', MoveBaseAction, goal_slots = [ 'target_pose' ]), remapping = { 'target_pose' : 'best_vantage' }, # input (PoseStamped) transitions = {'aborted':'SELECT_BEST_VANTAGE', 'preempted':'aborted', 'succeeded':'succeeded'}) return sm if __name__ == '__main__': import sm_rfid_explore rospy.init_node('smach_rfid_explore') sm = smach.StateMachine(outcomes=['succeeded','aborted','preempted'], input_keys = ['tagid','explore_radius']) # Open the container with sm: sm_search = sm_rfid_explore.sm_search() smach.StateMachine.add( 'RFID_SEARCH', # outcomes: succeded, aborted, preempted sm_search, remapping = { 'tagid' : 'tagid', # input 'explore_radius' : 'explore_radius', # input 'explore_rfid_reads' : 'explore_rfid_reads' }, # output # transitions={'succeeded':'succeeded'}) transitions={'succeeded':'BEST_VANTAGE'}) sm_vantage = sm_best_vantage() smach.StateMachine.add( 'BEST_VANTAGE', # outcomes: succeeded, aborted, preempted sm_vantage, remapping = { 'tagid' : 'tagid', # input 'rfid_reads' : 'explore_rfid_reads' }, # input transitions = {'succeeded':'succeeded'}) sis = IntrospectionServer('sm_rfid_explore', sm, '/SM_ROOT_RFID_EXPLORE') sis.start() rospy.sleep(3.0) sm.userdata.tagid = 'person ' sm.userdata.explore_radius = 2.7 # sm.userdata.explore_rfid_reads = [] outcome = sm.execute() # print sm.userdata.explore_rfid_reads rospy.spin() sis.stop()
ajibawa-2023/Python-Code-Large/train/row_99396
65
141
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0142, 0.0071, 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_99396:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0213, 0.0071, 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": "roslib.load_manifest('rfid_demos')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0284, 0.0071, 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_99396:Import_L6_C0", "label": "smach import smach", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0426, 0.0071, 0, 0.66, 0.2143, 345, 0, 1, 0, 0, 345, 0, 0], "semantic": {"name": "smach", "arg_names": [], "import_names": ["smach"], "rhs_call_name": "", "annotation": ""}, "snippet": "import smach"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Import_L7_C0", "label": "tf import tf", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0496, 0.0071, 0, 0.66, 0.2857, 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_99396:ImportFrom_L8_C0", "label": "from smach_ros import SimpleActionState, ServiceState, IntrospectionServer", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0567, 0.0071, 0, 0.66, 0.3571, 716, 0, 3, 0, 0, 716, 0, 0], "semantic": {"name": "smach_ros", "arg_names": [], "import_names": ["SimpleActionState", "ServiceState", "IntrospectionServer"], "rhs_call_name": "", "annotation": ""}, "snippet": "from smach_ros import SimpleActionState, ServiceState, IntrospectionServer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Import_L9_C0", "label": "actionlib import actionlib", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0638, 0.0071, 0, 0.66, 0.4286, 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_99396:ImportFrom_L11_C0", "label": "from geometry_msgs.msg import PoseStamped", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.078, 0.0071, 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_99396:ImportFrom_L12_C0", "label": "from move_base_msgs.msg import MoveBaseAction", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0851, 0.0071, 0, 0.66, 0.5714, 440, 0, 1, 0, 0, 440, 0, 0], "semantic": {"name": "move_base_msgs.msg", "arg_names": [], "import_names": ["MoveBaseAction"], "rhs_call_name": "", "annotation": ""}, "snippet": "from move_base_msgs.msg import MoveBaseAction"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:ImportFrom_L13_C0", "label": "from rfid_behaviors.srv import RecorderSrv", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0922, 0.0071, 0, 0.66, 0.6429, 647, 0, 1, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["RecorderSrv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import RecorderSrv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:ImportFrom_L14_C0", "label": "from rfid_behaviors.msg import RecorderReads", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0993, 0.0071, 0, 0.66, 0.7143, 903, 0, 1, 0, 0, 903, 0, 0], "semantic": {"name": "rfid_behaviors.msg", "arg_names": [], "import_names": ["RecorderReads"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.msg import RecorderReads"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Import_L16_C0", "label": "numpy import np, math", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1135, 0.0071, 0, 0.66, 0.7857, 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_99396:ClassDef_L19_C0", "label": "BestVantage", "type": "class", "loc": [19, 69], "level": 0, "parent": null, "vector": [3, 0, 0.3121, 0.3617, 0, 0.66, 0.8571, 421, 0, 2, 0, 0, 892, 0, 7], "semantic": {"name": "BestVantage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class BestVantage(smach.State):\n def __init__(self):\n smach.State.__init__(self,\n outcomes=['succeeded', 'aborted'],\n input_keys = ['tagid', 'rfid_reads'],\n output_keys = ['best_vantage', 'filtered_reads']) \n self.initialized = False\n self.orig_reads = [] # holds the original data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L20_C4", "label": "__init__", "type": "function", "loc": [20, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:ClassDef_L19_C0", "vector": [2, 1, 0.1702, 0.0638, 1, 0.64, 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 smach.State.__init__(self,\n outcomes=['succeeded', 'aborted'],\n input_keys = ['tagid', 'rfid_reads'],\n output_keys = ['best_vantage', 'filtered_reads']) \n self.initialized = False\n self.orig_reads = [] # holds the original data\n self.curr_reads = [] # holds data after processing"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L21_C8", "label": "__init__()", "type": "expression", "loc": [21, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L20_C4", "vector": [8, 2, 0.1596, 0.0284, 2, 0.71, 0.0, 555, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " smach.State.__init__(self,\n outcomes=['succeeded', 'aborted'],\n input_keys = ['tagid', 'rfid_reads'],\n output_keys = ['best_vantage', 'filtered_reads']) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L25_C8", "label": "self.initialized =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L20_C4", "vector": [14, 2, 0.1773, 0.0071, 2, 0.71, 0.25, 841, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.initialized", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.initialized = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L26_C8", "label": "self.orig_reads =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L20_C4", "vector": [14, 2, 0.1844, 0.0071, 2, 0.71, 0.5, 767, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.orig_reads", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.orig_reads = [] # holds the original data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L27_C8", "label": "self.curr_reads =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L20_C4", "vector": [14, 2, 0.1915, 0.0071, 2, 0.71, 0.75, 300, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.curr_reads", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.curr_reads = [] # holds data after processing"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L28_C8", "label": "self.last_pose =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L20_C4", "vector": [14, 2, 0.1986, 0.0071, 2, 0.71, 1.0, 85, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.last_pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.last_pose = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "label": "execute", "type": "function", "loc": [30, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:ClassDef_L19_C0", "vector": [2, 1, 0.3511, 0.2837, 1, 0.64, 1.0, 569, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "execute", "arg_names": ["self", "userdata"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute(self, userdata):\n rospy.logout('BestVantage: Calculating' )\n\n if not self.initialized:\n self.initialized = True\n # [ RFIDread, PoseStamped_Antenna(map frame), PoseStamped_BaseLink(map frame)\n self.orig_reads = userdata.rfid_reads # (RecorderReads[])\n self.curr_reads = [ r for r in self.orig_reads"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L31_C8", "label": "logout()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "vector": [8, 2, 0.2199, 0.0071, 2, 0.6, 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('BestVantage: Calculating' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L33_C8", "label": "if", "type": "if", "loc": [33, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "vector": [4, 2, 0.266, 0.0709, 2, 0.6, 0.0625, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.initialized:\n self.initialized = True\n # [ RFIDread, PoseStamped_Antenna(map frame), PoseStamped_BaseLink(map frame)\n self.orig_reads = userdata.rfid_reads # (RecorderReads[])\n self.curr_reads = [ r for r in self.orig_reads\n if r != None and r.read.rssi != -1 and\n r.read.tagID == userdata.tagid ]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L34_C12", "label": "self.initialized =", "type": "assigned_variable", "loc": [34, 34], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L33_C8", "vector": [14, 3, 0.2411, 0.0071, 3, 0.22, 0.0, 841, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.initialized", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.initialized = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L36_C12", "label": "self.orig_reads =", "type": "assigned_variable", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L33_C8", "vector": [14, 3, 0.2553, 0.0071, 3, 0.22, 0.25, 767, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.orig_reads", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.orig_reads = userdata.rfid_reads # (RecorderReads[])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L37_C12", "label": "self.curr_reads =", "type": "assigned_variable", "loc": [37, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L33_C8", "vector": [14, 3, 0.2695, 0.0213, 3, 0.22, 0.5, 300, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.curr_reads", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.curr_reads = [ r for r in self.orig_reads\n if r != None and r.read.rssi != -1 and\n r.read.tagID == userdata.tagid ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L41_C12", "label": "logout()", "type": "expression", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L33_C8", "vector": [8, 3, 0.2908, 0.0071, 3, 0.22, 0.75, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'BestVantage: First try did not work, eh? Filtering and retrying a new vantage.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Return_L42_C12", "label": "return", "type": "return", "loc": [42, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L33_C8", "vector": [13, 3, 0.2979, 0.0071, 3, 0.22, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'aborted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L44_C8", "label": "if", "type": "if", "loc": [44, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "vector": [4, 2, 0.3191, 0.0213, 2, 0.6, 0.125, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.curr_reads:\n rospy.logout( 'BestVantage: No more positive-read poses to consider.' )\n return 'aborted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L45_C12", "label": "logout()", "type": "expression", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L44_C8", "vector": [8, 3, 0.3191, 0.0071, 3, 0.16, 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( 'BestVantage: No more positive-read poses to consider.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Return_L46_C12", "label": "return", "type": "return", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L44_C8", "vector": [13, 3, 0.3262, 0.0071, 3, 0.16, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'aborted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L48_C8", "label": "rssi =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "vector": [14, 2, 0.3404, 0.0071, 2, 0.6, 0.1875, 906, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rssi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rssi = [ r.read.rssi for r in self.curr_reads ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L49_C8", "label": "ind = argmax()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "vector": [14, 2, 0.3475, 0.0071, 2, 0.6, 0.25, 680, 3, 1, 0, 0, 593, 10, 1], "semantic": {"name": "ind", "arg_names": [], "import_names": [], "rhs_call_name": "argmax", "annotation": ""}, "snippet": " ind = np.argmax( rssi )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L50_C8", "label": "best =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "vector": [14, 2, 0.3546, 0.0071, 2, 0.6, 0.3125, 676, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "best", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " best = self.curr_reads[ ind ] # RecorderRead"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L51_C8", "label": "best_read =", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "vector": [14, 2, 0.3617, 0.0071, 2, 0.6, 0.375, 445, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "best_read", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " best_read = best.read"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L52_C8", "label": "best_ant =", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "vector": [14, 2, 0.3688, 0.0071, 2, 0.6, 0.4375, 343, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "best_ant", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " best_ant = best.ps_ant_map"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L53_C8", "label": "best_base =", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "vector": [14, 2, 0.3759, 0.0071, 2, 0.6, 0.5, 221, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "best_base", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " best_base = best.ps_base_map"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L60_C8", "label": "ps = PoseStamped()", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "vector": [14, 2, 0.4255, 0.0071, 2, 0.6, 0.5625, 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_99396:Assign_L61_C8", "label": "ps.header.stamp = now()", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "vector": [14, 2, 0.4326, 0.0071, 2, 0.6, 0.625, 161, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " ps.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L62_C8", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "vector": [14, 2, 0.4397, 0.0071, 2, 0.6, 0.6875, 293, 7, 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 = best_base.header.frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L63_C8", "label": "ps.pose.position =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "vector": [14, 2, 0.4468, 0.0071, 2, 0.6, 0.75, 530, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.position = best_base.pose.position"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L64_C8", "label": "ps.pose.orientation =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "vector": [14, 2, 0.4539, 0.0071, 2, 0.6, 0.8125, 670, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation = best_ant.pose.orientation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L66_C8", "label": "userdata.best_vantage =", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "vector": [14, 2, 0.4681, 0.0071, 2, 0.6, 0.875, 537, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "userdata.best_vantage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " userdata.best_vantage = ps"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L67_C8", "label": "userdata.filtered_reads =", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "vector": [14, 2, 0.4752, 0.0071, 2, 0.6, 0.9375, 920, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "userdata.filtered_reads", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " userdata.filtered_reads = self.curr_reads"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Return_L69_C8", "label": "return", "type": "return", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "vector": [13, 2, 0.4894, 0.0071, 2, 0.6, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'succeeded'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L71_C0", "label": "sm_best_vantage", "type": "function", "loc": [71, 94], "level": 0, "parent": null, "vector": [2, 0, 0.5851, 0.1702, 0, 0.66, 0.9286, 480, 0, 0, 1, 0, 0, 0, 5], "semantic": {"name": "sm_best_vantage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def sm_best_vantage():\n sm = smach.StateMachine( outcomes = ['succeeded', 'aborted'],\n input_keys = ['rfid_reads', 'tagid'])\n with sm:\n smach.StateMachine.add(\n 'SELECT_BEST_VANTAGE',\n BestVantage(),\n remapping = { 'tagid' : 'tagid', # input (string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L72_C4", "label": "sm = StateMachine()", "type": "assigned_variable", "loc": [72, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L71_C0", "vector": [14, 1, 0.5142, 0.0142, 1, 0.84, 0.0, 21, 3, 2, 0, 0, 174, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "StateMachine", "annotation": ""}, "snippet": " sm = smach.StateMachine( outcomes = ['succeeded', 'aborted'],\n input_keys = ['rfid_reads', 'tagid'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L75_C8", "label": "add()", "type": "expression", "loc": [75, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L71_C0", "vector": [8, 1, 0.5567, 0.0567, 1, 0.84, 0.0, 241, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'SELECT_BEST_VANTAGE',\n BestVantage(),\n remapping = { 'tagid' : 'tagid', # input (string)\n 'rfid_reads' : 'rfid_reads', # input (RecorderReads)\n 'best_vantage' : 'best_vantage', # output (PoseStamped)\n 'filtered_reads' : 'filtered_reads' }, # output (RecorderReads)\n transitions = {'succeeded':'MOVE_BEST_VANTAGE'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L84_C8", "label": "add()", "type": "expression", "loc": [84, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L71_C0", "vector": [8, 1, 0.6241, 0.0638, 1, 0.84, 1.0, 241, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'MOVE_BEST_VANTAGE',\n SimpleActionState( '/move_base',\n MoveBaseAction,\n goal_slots = [ 'target_pose' ]),\n remapping = { 'target_pose' : 'best_vantage' }, # input (PoseStamped)\n transitions = {'aborted':'SELECT_BEST_VANTAGE',\n 'preempted':'aborted',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Return_L94_C4", "label": "return", "type": "return", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L71_C0", "vector": [13, 1, 0.6667, 0.0071, 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 sm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "label": "if", "type": "if", "loc": [98, 137], "level": 0, "parent": null, "vector": [4, 0, 0.8333, 0.2837, 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 sm_rfid_explore\n \n rospy.init_node('smach_rfid_explore')\n\n sm = smach.StateMachine(outcomes=['succeeded','aborted','preempted'],\n input_keys = ['tagid','explore_radius'])\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Import_L99_C4", "label": "sm_rfid_explore import sm_rfid_explore", "type": "import", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "vector": [1, 1, 0.7021, 0.0071, 1, 0.38, 0.0, 972, 0, 1, 0, 0, 972, 0, 0], "semantic": {"name": "sm_rfid_explore", "arg_names": [], "import_names": ["sm_rfid_explore"], "rhs_call_name": "", "annotation": ""}, "snippet": " import sm_rfid_explore"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L101_C4", "label": "init_node()", "type": "expression", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "vector": [8, 1, 0.7163, 0.0071, 1, 0.38, 0.1, 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('smach_rfid_explore')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L103_C4", "label": "sm = StateMachine()", "type": "assigned_variable", "loc": [103, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "vector": [14, 1, 0.734, 0.0142, 1, 0.38, 0.2, 21, 3, 2, 0, 0, 174, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "StateMachine", "annotation": ""}, "snippet": " sm = smach.StateMachine(outcomes=['succeeded','aborted','preempted'],\n input_keys = ['tagid','explore_radius'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L108_C8", "label": "sm_search = sm_search()", "type": "assigned_variable", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "vector": [14, 1, 0.766, 0.0071, 1, 0.38, 0.0, 542, 3, 0, 0, 0, 542, 10, 1], "semantic": {"name": "sm_search", "arg_names": [], "import_names": [], "rhs_call_name": "sm_search", "annotation": ""}, "snippet": " sm_search = sm_rfid_explore.sm_search()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L109_C8", "label": "add()", "type": "expression", "loc": [109, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "vector": [8, 1, 0.7979, 0.0567, 1, 0.38, 0.3333, 241, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'RFID_SEARCH', # outcomes: succeded, aborted, preempted\n sm_search,\n remapping = { 'tagid' : 'tagid', # input\n 'explore_radius' : 'explore_radius', # input\n 'explore_rfid_reads' : 'explore_rfid_reads' }, # output\n# transitions={'succeeded':'succeeded'})\n transitions={'succeeded':'BEST_VANTAGE'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L118_C8", "label": "sm_vantage = sm_best_vantage()", "type": "assigned_variable", "loc": [118, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "vector": [14, 1, 0.8369, 0.0071, 1, 0.38, 0.6667, 126, 3, 0, 0, 0, 480, 10, 1], "semantic": {"name": "sm_vantage", "arg_names": [], "import_names": [], "rhs_call_name": "sm_best_vantage", "annotation": ""}, "snippet": " sm_vantage = sm_best_vantage()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L119_C8", "label": "add()", "type": "expression", "loc": [119, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "vector": [8, 1, 0.8617, 0.0426, 1, 0.38, 1.0, 241, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'BEST_VANTAGE', # outcomes: succeeded, aborted, preempted\n sm_vantage,\n remapping = { 'tagid' : 'tagid', # input\n 'rfid_reads' : 'explore_rfid_reads' }, # input\n transitions = {'succeeded':'succeeded'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L126_C4", "label": "sis = IntrospectionServer()", "type": "assigned_variable", "loc": [126, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "vector": [14, 1, 0.8936, 0.0071, 1, 0.38, 0.3, 608, 3, 3, 0, 0, 702, 10, 1], "semantic": {"name": "sis", "arg_names": [], "import_names": [], "rhs_call_name": "IntrospectionServer", "annotation": ""}, "snippet": " sis = IntrospectionServer('sm_rfid_explore', sm, '/SM_ROOT_RFID_EXPLORE')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L127_C4", "label": "start()", "type": "expression", "loc": [127, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "vector": [8, 1, 0.9007, 0.0071, 1, 0.38, 0.4, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " sis.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L128_C4", "label": "sleep()", "type": "expression", "loc": [128, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "vector": [8, 1, 0.9078, 0.0071, 1, 0.38, 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(3.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L130_C4", "label": "sm.userdata.tagid =", "type": "assigned_variable", "loc": [130, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "vector": [14, 1, 0.922, 0.0071, 1, 0.38, 0.6, 452, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "sm.userdata.tagid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sm.userdata.tagid = 'person '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L131_C4", "label": "sm.userdata.explore_radius =", "type": "assigned_variable", "loc": [131, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "vector": [14, 1, 0.9291, 0.0071, 1, 0.38, 0.7, 383, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "sm.userdata.explore_radius", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sm.userdata.explore_radius = 2.7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L133_C4", "label": "outcome = execute()", "type": "assigned_variable", "loc": [133, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "vector": [14, 1, 0.9433, 0.0071, 1, 0.38, 0.8, 805, 3, 0, 0, 0, 569, 10, 1], "semantic": {"name": "outcome", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " outcome = sm.execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L136_C4", "label": "spin()", "type": "expression", "loc": [136, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "vector": [8, 1, 0.9645, 0.0071, 1, 0.38, 0.9, 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_99396:Expr_L137_C4", "label": "stop()", "type": "expression", "loc": [137, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "vector": [8, 1, 0.9716, 0.0071, 1, 0.38, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " sis.stop()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99396:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L34_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Return_L42_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Return_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Return_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Return_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Import_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Assign_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99396:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99396:Expr_L137_C4"}]
import subprocess as sb import os class CmdProcess: def __init__(self, cmd_list): self.cmd_list= cmd_list self.process = None def run(self): self.process = sb.Popen(self.cmd_list) def kill(self): os.system('kill -2 %d' % self.process.pid)
ajibawa-2023/Python-Code-Large/train/row_99397
10
14
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99397:Import_L1_C0", "label": "subprocess import sb", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0714, 0.0714, 0, 0.66, 0.0, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["sb"], "rhs_call_name": "", "annotation": ""}, "snippet": "import subprocess as sb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99397:Import_L2_C0", "label": "os import os", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0714, 0, 0.66, 0.5, 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_99397:ClassDef_L4_C0", "label": "CmdProcess", "type": "class", "loc": [4, 14], "level": 0, "parent": null, "vector": [3, 0, 0.6429, 0.7857, 0, 0.66, 1.0, 248, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "CmdProcess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CmdProcess:\n \n def __init__(self, cmd_list):\n self.cmd_list= cmd_list\n self.process = None\n\n def run(self):\n self.process = sb.Popen(self.cmd_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99397:FunctionDef_L6_C4", "label": "__init__", "type": "function", "loc": [6, 8], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99397:ClassDef_L4_C0", "vector": [2, 1, 0.5, 0.2143, 1, 0.08, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "cmd_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, cmd_list):\n self.cmd_list= cmd_list\n self.process = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99397:Assign_L7_C8", "label": "self.cmd_list =", "type": "assigned_variable", "loc": [7, 7], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99397:FunctionDef_L6_C4", "vector": [14, 2, 0.5, 0.0714, 2, 0.09, 0.0, 760, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cmd_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cmd_list= cmd_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99397:Assign_L8_C8", "label": "self.process =", "type": "assigned_variable", "loc": [8, 8], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99397:FunctionDef_L6_C4", "vector": [14, 2, 0.5714, 0.0714, 2, 0.09, 1.0, 789, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.process", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.process = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99397:FunctionDef_L10_C4", "label": "run", "type": "function", "loc": [10, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99397:ClassDef_L4_C0", "vector": [2, 1, 0.75, 0.1429, 1, 0.08, 0.5, 679, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run(self):\n self.process = sb.Popen(self.cmd_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99397:Assign_L11_C8", "label": "self.process = Popen()", "type": "assigned_variable", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99397:FunctionDef_L10_C4", "vector": [14, 2, 0.7857, 0.0714, 2, 0.71, 0.0, 789, 3, 1, 0, 0, 568, 10, 1], "semantic": {"name": "self.process", "arg_names": [], "import_names": [], "rhs_call_name": "Popen", "annotation": ""}, "snippet": " self.process = sb.Popen(self.cmd_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99397:FunctionDef_L13_C4", "label": "kill", "type": "function", "loc": [13, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99397:ClassDef_L4_C0", "vector": [2, 1, 0.9643, 0.1429, 1, 0.08, 1.0, 173, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "kill", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def kill(self):\n os.system('kill -2 %d' % self.process.pid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99397:Expr_L14_C8", "label": "system()", "type": "expression", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99397:FunctionDef_L13_C4", "vector": [8, 2, 1.0, 0.0714, 2, 0.44, 0.0, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": " os.system('kill -2 %d' % self.process.pid)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99397:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99397:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99397:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99397:Assign_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99397:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99397:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99397:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99397:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99397:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99397:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99397:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99397:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99397:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99397:Expr_L14_C8"}]
__all__ = [ 'demo_node', 'rfid_delivery', 'sm_test', 'rfid_search' ]
ajibawa-2023/Python-Code-Large/train/row_99398
1
9
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99398:Assign_L3_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [3, 8], "level": 0, "parent": null, "vector": [14, 0, 0.6111, 0.6667, 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'demo_node',\n'rfid_delivery',\n'sm_test',\n'rfid_search'\n]"}]
[]
#! /usr/bin/python import roslib roslib.load_manifest('rfid_demos') roslib.load_manifest('rfid_behaviors') roslib.load_manifest('pr2_grasp_behaviors') roslib.load_manifest('hrl_trajectory_playback') roslib.load_manifest('pr2_controllers_msgs') roslib.load_manifest('robotis') import rospy import smach import actionlib from smach_ros import SimpleActionState, ServiceState, IntrospectionServer from geometry_msgs.msg import PoseStamped, PoseWithCovarianceStamped from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal from rfid_behaviors.srv import NextBestVantage from rfid_behaviors.srv import HandoffSrv, HandoffSrvRequest from rfid_behaviors.srv import FloatFloat_Int32Request as RotateBackupSrvRequest from rfid_behaviors.srv import FloatFloat_Int32 as RotateBackupSrv from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal from pr2_controllers_msgs.msg import SingleJointPositionAction, SingleJointPositionGoal from robotis.srv import MoveAng, MoveAngRequest from hrl_trajectory_playback.srv import TrajPlaybackSrv, TrajPlaybackSrvRequest import sm_rfid_delivery import string #from sm_next_best_vantage import BestVantage # import sm_fetch # import sm_rfid_explore class PrintStr(smach.State): def __init__(self, ins = 'Hand me an object [ENTER]'): smach.State.__init__(self, outcomes=['succeeded', 'aborted', 'preempted']) self.ins = ins def execute(self, userdata): rospy.logout( 'Executing PrintStr: %s' % self.ins ) raw_input() return 'succeeded' class ConfirmObj(smach.State): def __init__(self, ins = 'Does the robot have the object [\'yes\' to proceed]?'): smach.State.__init__(self, outcomes=['succeeded', 'aborted', 'preempted']) self.ins = ins def execute(self, userdata): rospy.logout( 'Executing PrintStr: %s' % self.ins ) f = raw_input() if string.find( f, 'yes' ) == -1: return 'aborted' else: return 'succeeded' class InitLocalization(smach.State): def __init__(self, init_pose = None): smach.State.__init__(self, outcomes=['succeeded', 'aborted']) self.init_pose = init_pose def execute(self, userdata): rospy.logout( 'Initializing Localization' ) pub = rospy.Publisher( '/initialpose', PoseWithCovarianceStamped ) rospy.sleep( 0.5 ) if not self.init_pose: msg = PoseWithCovarianceStamped() msg.header.frame_id = '\map' msg.pose.pose.position.x = -1.565 msg.pose.pose.position.y = 0.807 msg.pose.pose.position.z = 0.000 msg.pose.pose.orientation.w = 1.000 msg.pose.covariance = [0.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.068, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] print 'RUNNING: ', msg raw_input( 'Drive the robot to the initial location (in kitchen by default). Hit [ENTER] when done.' ) msg.header.stamp = rospy.Time(0) pub.publish( msg ) # for i in xrange( 5 ): # msg.header.stamp = rospy.Time(0) # pub.publish( msg ) # rospy.sleep( 0.05 ) return 'succeeded' def init_local_test(): sm = smach.StateMachine( outcomes=['succeeded','aborted'] ) with sm: smach.StateMachine.add( 'INIT_LOCALIZATION', InitLocalization(), transitions = { 'succeeded':'succeeded' }) return sm def cousins_demo(): # Create a SMACH state machine sm = smach.StateMachine(outcomes=['succeeded','aborted','preempted'], input_keys = [ 'person_id' ]) with sm: # Just a precation tgoal = SingleJointPositionGoal() tgoal.position = 0.040 # all the way up is 0.200, mostly down is 0.040 tgoal.min_duration = rospy.Duration( 2.0 ) tgoal.max_velocity = 1.0 smach.StateMachine.add( 'TORSO_SETUP', SimpleActionState( 'torso_controller/position_joint_action', SingleJointPositionAction, goal = tgoal), transitions = { 'succeeded': 'INIT_ARM_POSE' }) smach.StateMachine.add( 'INIT_ARM_POSE', ServiceState( '/traj_playback/hfa_untuck', TrajPlaybackSrv, request = TrajPlaybackSrvRequest( False )), transitions = { 'succeeded':'MOVE_GET_OBJ' }) go = MoveBaseGoal() go.target_pose.header.frame_id = '/map' go.target_pose.header.stamp = rospy.Time(0) go.target_pose.pose.position.x = -5.07 go.target_pose.pose.position.y = 8.725 go.target_pose.pose.orientation.z = 0.926 go.target_pose.pose.orientation.w = 0.377 smach.StateMachine.add( 'MOVE_GET_OBJ', SimpleActionState( '/move_base', MoveBaseAction, goal = go ), transitions = {'succeeded':'READY_HANDOFF_INIT'}) smach.StateMachine.add( 'READY_HANDOFF_INIT', PrintStr('Hand me an object [ENTER]'), transitions = { 'succeeded':'HANDOFF_INIT' }) smach.StateMachine.add( 'HANDOFF_INIT', ServiceState( 'rfid_handoff/initialize', HandoffSrv, request = HandoffSrvRequest()), transitions = { 'succeeded':'CONFIRM_HANDOFF' }) smach.StateMachine.add( 'CONFIRM_HANDOFF', ConfirmObj('Does the robot have the object [\'yes\' to proceed]?'), transitions = { 'succeeded':'ROTATE_AFTER_HANDOFF', 'aborted':'READY_HANDOFF_INIT'} ) smach.StateMachine.add( 'ROTATE_AFTER_HANDOFF', ServiceState( '/rotate_backup', RotateBackupSrv, request = RotateBackupSrvRequest( 3.14, 0.0)), # Full 180-deg spin. transitions = { 'succeeded':'MOVE_DELIVERY' }) gd = MoveBaseGoal() gd.target_pose.header.frame_id = '/map' gd.target_pose.header.stamp = rospy.Time(0) gd.target_pose.pose.position.x = 2.956 gd.target_pose.pose.position.y = 3.047 gd.target_pose.pose.orientation.z = 0.349 gd.target_pose.pose.orientation.w = 0.937 smach.StateMachine.add( 'MOVE_DELIVERY', SimpleActionState( '/move_base', MoveBaseAction, goal = gd ), transitions = {'succeeded':'DELIVERY'}) sm_delivery = sm_rfid_delivery.sm_delivery() smach.StateMachine.add( 'DELIVERY', # outcomes: succeeded, aborted, preempted sm_delivery, remapping = { 'tagid' : 'person_id'}, #input transitions = { 'succeeded': 'TUCKL_SUCC', 'aborted': 'TUCKL_ABOR'}) smach.StateMachine.add( 'TUCKL_SUCC', ServiceState( '/robotis/servo_left_pan_moveangle', MoveAng, request = MoveAngRequest( 1.350, 0.3, 0)), transitions = { 'succeeded':'TUCKR_SUCC' }) smach.StateMachine.add( 'TUCKR_SUCC', ServiceState( '/robotis/servo_right_pan_moveangle', MoveAng, request = MoveAngRequest( -1.350, 0.3, 0)), transitions = { 'succeeded':'BACKUP_AFTER_DELIVERY' }) smach.StateMachine.add( 'TUCKL_ABOR', ServiceState( '/robotis/servo_left_pan_moveangle', MoveAng, request = MoveAngRequest( 1.350, 0.3, 0)), transitions = { 'succeeded':'TUCKR_ABOR' }) smach.StateMachine.add( 'TUCKR_ABOR', ServiceState( '/robotis/servo_right_pan_moveangle', MoveAng, request = MoveAngRequest( -1.350, 0.3, 0)), transitions = { 'succeeded':'aborted' }) smach.StateMachine.add( 'BACKUP_AFTER_DELIVERY', ServiceState( '/rotate_backup', RotateBackupSrv, request = RotateBackupSrvRequest(0.0, -0.50)), transitions = { 'succeeded':'ROTATE_AFTER_DELIVERY' }) smach.StateMachine.add( 'ROTATE_AFTER_DELIVERY', ServiceState( '/rotate_backup', RotateBackupSrv, request = RotateBackupSrvRequest( 3.14, 0.0)), transitions = { 'succeeded':'MOVE_FINAL' }) # Kitchen # gk = MoveBaseGoal() # gk.target_pose.header.frame_id = '/map' # gk.target_pose.header.stamp = rospy.Time(0) # gk.target_pose.pose.position.x = -1.61 # gk.target_pose.pose.position.y = 0.88 # gk.target_pose.pose.orientation.z = 0.91 # gk.target_pose.pose.orientation.w = 0.40 smach.StateMachine.add( 'MOVE_FINAL', SimpleActionState( '/move_base', MoveBaseAction, goal = go ), # Back down the hallway transitions = {'succeeded':'succeeded'}) return sm if False: rospy.init_node('localization_trial') sm = smach.StateMachine( outcomes=['succeeded','aborted','preempted'] ) with sm: # Just a precation tgoal = SingleJointPositionGoal() tgoal.position = 0.040 # all the way up is 0.200 tgoal.min_duration = rospy.Duration( 2.0 ) tgoal.max_velocity = 1.0 smach.StateMachine.add( 'TORSO_SETUP', SimpleActionState( 'torso_controller/position_joint_action', SingleJointPositionAction, goal = tgoal), transitions = { 'succeeded': 'succeeded' }) sm.execute() if __name__ == '__main__': # if False: rospy.init_node('smach_aware_home') sm = cousins_demo() sis = IntrospectionServer('sm_aware_home', sm, '/SM_AWARE_HOME') sis.start() rospy.logout( 'READY TO RUN AWARE_HOME DEMO' ) sm.userdata.person_id = 'person ' # sm.userdata.explore_radius = 1.5 # sm.userdata.explore_rfid_reads = [] outcome = sm.execute() # rospy.spin() sis.stop()
ajibawa-2023/Python-Code-Large/train/row_99399
122
305
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0066, 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_99399:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0098, 0.0033, 0, 0.66, 0.0345, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('rfid_demos')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0131, 0.0033, 0, 0.66, 0.069, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('rfid_behaviors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0164, 0.0033, 0, 0.66, 0.1034, 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_grasp_behaviors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0197, 0.0033, 0, 0.66, 0.1379, 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_trajectory_playback')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.023, 0.0033, 0, 0.66, 0.1724, 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_controllers_msgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0262, 0.0033, 0, 0.66, 0.2069, 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('robotis')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Import_L9_C0", "label": "rospy import rospy", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0295, 0.0033, 0, 0.66, 0.2414, 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_99399:Import_L11_C0", "label": "smach import smach", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0361, 0.0033, 0, 0.66, 0.2759, 345, 0, 1, 0, 0, 345, 0, 0], "semantic": {"name": "smach", "arg_names": [], "import_names": ["smach"], "rhs_call_name": "", "annotation": ""}, "snippet": "import smach"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Import_L12_C0", "label": "actionlib import actionlib", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0393, 0.0033, 0, 0.66, 0.3103, 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_99399:ImportFrom_L14_C0", "label": "from smach_ros import SimpleActionState, ServiceState, IntrospectionServer", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0459, 0.0033, 0, 0.66, 0.3448, 716, 0, 3, 0, 0, 716, 0, 0], "semantic": {"name": "smach_ros", "arg_names": [], "import_names": ["SimpleActionState", "ServiceState", "IntrospectionServer"], "rhs_call_name": "", "annotation": ""}, "snippet": "from smach_ros import SimpleActionState, ServiceState, IntrospectionServer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:ImportFrom_L15_C0", "label": "from geometry_msgs.msg import PoseStamped, PoseWithCovarianceStamped", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0492, 0.0033, 0, 0.66, 0.3793, 951, 0, 2, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["PoseStamped", "PoseWithCovarianceStamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import PoseStamped, PoseWithCovarianceStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:ImportFrom_L16_C0", "label": "from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0525, 0.0033, 0, 0.66, 0.4138, 440, 0, 2, 0, 0, 440, 0, 0], "semantic": {"name": "move_base_msgs.msg", "arg_names": [], "import_names": ["MoveBaseAction", "MoveBaseGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:ImportFrom_L17_C0", "label": "from rfid_behaviors.srv import NextBestVantage", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0557, 0.0033, 0, 0.66, 0.4483, 647, 0, 1, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["NextBestVantage"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import NextBestVantage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:ImportFrom_L18_C0", "label": "from rfid_behaviors.srv import HandoffSrv, HandoffSrvRequest", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.059, 0.0033, 0, 0.66, 0.4828, 647, 0, 2, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["HandoffSrv", "HandoffSrvRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import HandoffSrv, HandoffSrvRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:ImportFrom_L19_C0", "label": "from rfid_behaviors.srv import RotateBackupSrvRequest", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0623, 0.0033, 0, 0.66, 0.5172, 647, 0, 1, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["RotateBackupSrvRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import FloatFloat_Int32Request as RotateBackupSrvRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:ImportFrom_L20_C0", "label": "from rfid_behaviors.srv import RotateBackupSrv", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0656, 0.0033, 0, 0.66, 0.5517, 647, 0, 1, 0, 0, 647, 0, 0], "semantic": {"name": "rfid_behaviors.srv", "arg_names": [], "import_names": ["RotateBackupSrv"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_behaviors.srv import FloatFloat_Int32 as RotateBackupSrv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:ImportFrom_L21_C0", "label": "from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0689, 0.0033, 0, 0.66, 0.5862, 457, 0, 2, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["PointHeadAction", "PointHeadGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:ImportFrom_L22_C0", "label": "from pr2_controllers_msgs.msg import SingleJointPositionAction, SingleJointPositionGoal", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0721, 0.0033, 0, 0.66, 0.6207, 457, 0, 2, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["SingleJointPositionAction", "SingleJointPositionGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import SingleJointPositionAction, SingleJointPositionGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:ImportFrom_L23_C0", "label": "from robotis.srv import MoveAng, MoveAngRequest", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.0754, 0.0033, 0, 0.66, 0.6552, 727, 0, 2, 0, 0, 727, 0, 0], "semantic": {"name": "robotis.srv", "arg_names": [], "import_names": ["MoveAng", "MoveAngRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robotis.srv import MoveAng, MoveAngRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:ImportFrom_L24_C0", "label": "from hrl_trajectory_playback.srv import TrajPlaybackSrv, TrajPlaybackSrvRequest", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0787, 0.0033, 0, 0.66, 0.6897, 12, 0, 2, 0, 0, 12, 0, 0], "semantic": {"name": "hrl_trajectory_playback.srv", "arg_names": [], "import_names": ["TrajPlaybackSrv", "TrajPlaybackSrvRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_trajectory_playback.srv import TrajPlaybackSrv, TrajPlaybackSrvRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Import_L26_C0", "label": "sm_rfid_delivery import sm_rfid_delivery", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.0852, 0.0033, 0, 0.66, 0.7241, 55, 0, 1, 0, 0, 55, 0, 0], "semantic": {"name": "sm_rfid_delivery", "arg_names": [], "import_names": ["sm_rfid_delivery"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sm_rfid_delivery"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Import_L27_C0", "label": "string import string", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.0885, 0.0033, 0, 0.66, 0.7586, 890, 0, 1, 0, 0, 890, 0, 0], "semantic": {"name": "string", "arg_names": [], "import_names": ["string"], "rhs_call_name": "", "annotation": ""}, "snippet": "import string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:ClassDef_L32_C0", "label": "PrintStr", "type": "class", "loc": [32, 40], "level": 0, "parent": null, "vector": [3, 0, 0.118, 0.0295, 0, 0.66, 0.7931, 476, 0, 2, 0, 0, 892, 0, 3], "semantic": {"name": "PrintStr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PrintStr(smach.State):\n def __init__(self, ins = 'Hand me an object [ENTER]'):\n smach.State.__init__(self, outcomes=['succeeded', 'aborted', 'preempted'])\n self.ins = ins\n\n def execute(self, userdata):\n rospy.logout( 'Executing PrintStr: %s' % self.ins )\n raw_input()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L33_C4", "label": "__init__", "type": "function", "loc": [33, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:ClassDef_L32_C0", "vector": [2, 1, 0.1115, 0.0098, 1, 0.04, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "ins"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, ins = 'Hand me an object [ENTER]'):\n smach.State.__init__(self, outcomes=['succeeded', 'aborted', 'preempted'])\n self.ins = ins"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L34_C8", "label": "__init__()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L33_C4", "vector": [8, 2, 0.1115, 0.0033, 2, 0.65, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " smach.State.__init__(self, outcomes=['succeeded', 'aborted', 'preempted'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L35_C8", "label": "self.ins =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L33_C4", "vector": [14, 2, 0.1148, 0.0033, 2, 0.65, 1.0, 485, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.ins", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ins = ins"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L37_C4", "label": "execute", "type": "function", "loc": [37, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:ClassDef_L32_C0", "vector": [2, 1, 0.1262, 0.0131, 1, 0.04, 1.0, 569, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "execute", "arg_names": ["self", "userdata"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute(self, userdata):\n rospy.logout( 'Executing PrintStr: %s' % self.ins )\n raw_input()\n return 'succeeded'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L38_C8", "label": "logout()", "type": "expression", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L37_C4", "vector": [8, 2, 0.1246, 0.0033, 2, 0.24, 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( 'Executing PrintStr: %s' % self.ins )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L39_C8", "label": "raw_input()", "type": "expression", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L37_C4", "vector": [8, 2, 0.1279, 0.0033, 2, 0.24, 0.5, 821, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Return_L40_C8", "label": "return", "type": "return", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L37_C4", "vector": [13, 2, 0.1311, 0.0033, 2, 0.24, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'succeeded'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:ClassDef_L42_C0", "label": "ConfirmObj", "type": "class", "loc": [42, 53], "level": 0, "parent": null, "vector": [3, 0, 0.1557, 0.0393, 0, 0.66, 0.8276, 767, 0, 2, 0, 0, 892, 0, 4], "semantic": {"name": "ConfirmObj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ConfirmObj(smach.State):\n def __init__(self, ins = 'Does the robot have the object [\\'yes\\' to proceed]?'):\n smach.State.__init__(self, outcomes=['succeeded', 'aborted', 'preempted'])\n self.ins = ins\n\n def execute(self, userdata):\n rospy.logout( 'Executing PrintStr: %s' % self.ins )\n f = raw_input()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L43_C4", "label": "__init__", "type": "function", "loc": [43, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:ClassDef_L42_C0", "vector": [2, 1, 0.1443, 0.0098, 1, 0.59, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "ins"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, ins = 'Does the robot have the object [\\'yes\\' to proceed]?'):\n smach.State.__init__(self, outcomes=['succeeded', 'aborted', 'preempted'])\n self.ins = ins"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L44_C8", "label": "__init__()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L43_C4", "vector": [8, 2, 0.1443, 0.0033, 2, 0.49, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " smach.State.__init__(self, outcomes=['succeeded', 'aborted', 'preempted'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L45_C8", "label": "self.ins =", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L43_C4", "vector": [14, 2, 0.1475, 0.0033, 2, 0.49, 1.0, 485, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.ins", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ins = ins"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L47_C4", "label": "execute", "type": "function", "loc": [47, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:ClassDef_L42_C0", "vector": [2, 1, 0.1639, 0.023, 1, 0.59, 1.0, 569, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "execute", "arg_names": ["self", "userdata"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute(self, userdata):\n rospy.logout( 'Executing PrintStr: %s' % self.ins )\n f = raw_input()\n if string.find( f, 'yes' ) == -1:\n return 'aborted'\n else:\n return 'succeeded'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L48_C8", "label": "logout()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L47_C4", "vector": [8, 2, 0.1574, 0.0033, 2, 0.85, 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( 'Executing PrintStr: %s' % self.ins )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L49_C8", "label": "f = raw_input()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L47_C4", "vector": [14, 2, 0.1607, 0.0033, 2, 0.85, 0.5, 899, 3, 0, 0, 0, 821, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " f = raw_input()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L50_C8", "label": "if", "type": "if", "loc": [50, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L47_C4", "vector": [4, 2, 0.1689, 0.0131, 2, 0.85, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if string.find( f, 'yes' ) == -1:\n return 'aborted'\n else:\n return 'succeeded'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Return_L51_C12", "label": "return", "type": "return", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L50_C8", "vector": [13, 3, 0.1672, 0.0033, 3, 0.84, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'aborted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Return_L53_C12", "label": "return", "type": "return", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L50_C8", "vector": [13, 3, 0.1738, 0.0033, 3, 0.84, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'succeeded'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:ClassDef_L55_C0", "label": "InitLocalization", "type": "class", "loc": [55, 97], "level": 0, "parent": null, "vector": [3, 0, 0.2492, 0.141, 0, 0.66, 0.8621, 665, 0, 2, 0, 0, 892, 0, 9], "semantic": {"name": "InitLocalization", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class InitLocalization(smach.State):\n def __init__(self, init_pose = None):\n smach.State.__init__(self, outcomes=['succeeded', 'aborted'])\n self.init_pose = init_pose\n \n def execute(self, userdata):\n rospy.logout( 'Initializing Localization' )\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L56_C4", "label": "__init__", "type": "function", "loc": [56, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:ClassDef_L55_C0", "vector": [2, 1, 0.1869, 0.0098, 1, 0.92, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "init_pose"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, init_pose = None):\n smach.State.__init__(self, outcomes=['succeeded', 'aborted'])\n self.init_pose = init_pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L57_C8", "label": "__init__()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L56_C4", "vector": [8, 2, 0.1869, 0.0033, 2, 0.27, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " smach.State.__init__(self, outcomes=['succeeded', 'aborted'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L58_C8", "label": "self.init_pose =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L56_C4", "vector": [14, 2, 0.1902, 0.0033, 2, 0.27, 1.0, 255, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.init_pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.init_pose = init_pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L60_C4", "label": "execute", "type": "function", "loc": [60, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:ClassDef_L55_C0", "vector": [2, 1, 0.2574, 0.1246, 1, 0.92, 1.0, 569, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "execute", "arg_names": ["self", "userdata"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute(self, userdata):\n rospy.logout( 'Initializing Localization' )\n\n pub = rospy.Publisher( '/initialpose', PoseWithCovarianceStamped )\n rospy.sleep( 0.5 )\n\n if not self.init_pose:\n msg = PoseWithCovarianceStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L61_C8", "label": "logout()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L60_C4", "vector": [8, 2, 0.2, 0.0033, 2, 0.49, 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 Localization' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L63_C8", "label": "pub = Publisher()", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L60_C4", "vector": [14, 2, 0.2066, 0.0033, 2, 0.49, 0.1429, 41, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " pub = rospy.Publisher( '/initialpose', PoseWithCovarianceStamped )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L64_C8", "label": "sleep()", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L60_C4", "vector": [8, 2, 0.2098, 0.0033, 2, 0.49, 0.2857, 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_99399:If_L66_C8", "label": "if", "type": "if", "loc": [66, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L60_C4", "vector": [4, 2, 0.2492, 0.0689, 2, 0.49, 0.4286, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.init_pose:\n msg = PoseWithCovarianceStamped()\n msg.header.frame_id = '\\map'\n\n msg.pose.pose.position.x = -1.565\n msg.pose.pose.position.y = 0.807\n msg.pose.pose.position.z = 0.000\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L67_C12", "label": "msg = PoseWithCovarianceStamped()", "type": "assigned_variable", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L66_C8", "vector": [14, 3, 0.2197, 0.0033, 3, 0.73, 0.0, 712, 3, 0, 0, 0, 146, 10, 1], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "PoseWithCovarianceStamped", "annotation": ""}, "snippet": " msg = PoseWithCovarianceStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L68_C12", "label": "msg.header.frame_id =", "type": "assigned_variable", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L66_C8", "vector": [14, 3, 0.223, 0.0033, 3, 0.73, 0.1429, 11, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "msg.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg.header.frame_id = '\\map'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L70_C12", "label": "msg.pose.pose.position.x =", "type": "assigned_variable", "loc": [70, 70], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L66_C8", "vector": [14, 3, 0.2295, 0.0033, 3, 0.73, 0.2857, 19, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "msg.pose.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg.pose.pose.position.x = -1.565"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L71_C12", "label": "msg.pose.pose.position.y =", "type": "assigned_variable", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L66_C8", "vector": [14, 3, 0.2328, 0.0033, 3, 0.73, 0.4286, 775, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "msg.pose.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg.pose.pose.position.y = 0.807"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L72_C12", "label": "msg.pose.pose.position.z =", "type": "assigned_variable", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L66_C8", "vector": [14, 3, 0.2361, 0.0033, 3, 0.73, 0.5714, 104, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "msg.pose.pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg.pose.pose.position.z = 0.000"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L74_C12", "label": "msg.pose.pose.orientation.w =", "type": "assigned_variable", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L66_C8", "vector": [14, 3, 0.2426, 0.0033, 3, 0.73, 0.7143, 444, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "msg.pose.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg.pose.pose.orientation.w = 1.000"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L76_C12", "label": "msg.pose.covariance =", "type": "assigned_variable", "loc": [76, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L66_C8", "vector": [14, 3, 0.2623, 0.0295, 3, 0.73, 0.8571, 411, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "msg.pose.covariance", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg.pose.covariance = [0.25, 0.0, 0.0, 0.0,\n 0.0, 0.0, 0.0, 0.25,\n 0.0, 0.0, 0.0, 0.0,\n 0.0, 0.0, 0.0, 0.0,\n 0.0, 0.0, 0.0, 0.0,\n 0.0, 0.068, 0.0, 0.0,\n 0.0, 0.0, 0.0, 0.0,\n 0.0, 0.0, 0.0, 0.0,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L86_C12", "label": "print()", "type": "expression", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L66_C8", "vector": [8, 3, 0.282, 0.0033, 3, 0.73, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('RUNNING: ', msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L88_C8", "label": "raw_input()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L60_C4", "vector": [8, 2, 0.2885, 0.0033, 2, 0.49, 0.5714, 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( 'Drive the robot to the initial location (in kitchen by default). Hit [ENTER] when done.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L89_C8", "label": "msg.header.stamp = Time()", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L60_C4", "vector": [14, 2, 0.2918, 0.0033, 2, 0.49, 0.7143, 90, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "msg.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " msg.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L90_C8", "label": "publish()", "type": "expression", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L60_C4", "vector": [8, 2, 0.2951, 0.0033, 2, 0.49, 0.8571, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " pub.publish( msg )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Return_L97_C8", "label": "return", "type": "return", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L60_C4", "vector": [13, 2, 0.318, 0.0033, 2, 0.49, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'succeeded'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L100_C0", "label": "init_local_test", "type": "function", "loc": [100, 107], "level": 0, "parent": null, "vector": [2, 0, 0.3393, 0.0262, 0, 0.66, 0.8966, 817, 0, 0, 1, 0, 0, 0, 3], "semantic": {"name": "init_local_test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def init_local_test():\n sm = smach.StateMachine( outcomes=['succeeded','aborted'] )\n with sm:\n smach.StateMachine.add(\n 'INIT_LOCALIZATION',\n InitLocalization(),\n transitions = { 'succeeded':'succeeded' })\n return sm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L101_C4", "label": "sm = StateMachine()", "type": "assigned_variable", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L100_C0", "vector": [14, 1, 0.3311, 0.0033, 1, 0.65, 0.0, 21, 3, 1, 0, 0, 174, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "StateMachine", "annotation": ""}, "snippet": " sm = smach.StateMachine( outcomes=['succeeded','aborted'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L103_C8", "label": "add()", "type": "expression", "loc": [103, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L100_C0", "vector": [8, 1, 0.3426, 0.0131, 1, 0.65, 0.0, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'INIT_LOCALIZATION',\n InitLocalization(),\n transitions = { 'succeeded':'succeeded' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Return_L107_C4", "label": "return", "type": "return", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L100_C0", "vector": [13, 1, 0.3508, 0.0033, 1, 0.65, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "label": "cousins_demo", "type": "function", "loc": [110, 263], "level": 0, "parent": null, "vector": [2, 0, 0.6115, 0.5049, 0, 0.66, 0.931, 546, 0, 0, 1, 0, 0, 0, 48], "semantic": {"name": "cousins_demo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def cousins_demo():\n # Create a SMACH state machine\n sm = smach.StateMachine(outcomes=['succeeded','aborted','preempted'],\n input_keys = [ 'person_id' ])\n\n with sm:\n\n # Just a precation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L112_C4", "label": "sm = StateMachine()", "type": "assigned_variable", "loc": [112, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [14, 1, 0.3689, 0.0066, 1, 0.86, 0.0, 21, 3, 2, 0, 0, 174, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "StateMachine", "annotation": ""}, "snippet": " sm = smach.StateMachine(outcomes=['succeeded','aborted','preempted'],\n input_keys = [ 'person_id' ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L118_C8", "label": "tgoal = SingleJointPositionGoal()", "type": "assigned_variable", "loc": [118, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [14, 1, 0.3869, 0.0033, 1, 0.86, 0.0, 454, 3, 0, 0, 0, 974, 10, 1], "semantic": {"name": "tgoal", "arg_names": [], "import_names": [], "rhs_call_name": "SingleJointPositionGoal", "annotation": ""}, "snippet": " tgoal = SingleJointPositionGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L119_C8", "label": "tgoal.position =", "type": "assigned_variable", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [14, 1, 0.3902, 0.0033, 1, 0.86, 0.0294, 731, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "tgoal.position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tgoal.position = 0.040 # all the way up is 0.200, mostly down is 0.040"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L120_C8", "label": "tgoal.min_duration = Duration()", "type": "assigned_variable", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [14, 1, 0.3934, 0.0033, 1, 0.86, 0.0588, 779, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "tgoal.min_duration", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " tgoal.min_duration = rospy.Duration( 2.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L121_C8", "label": "tgoal.max_velocity =", "type": "assigned_variable", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [14, 1, 0.3967, 0.0033, 1, 0.86, 0.0882, 590, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "tgoal.max_velocity", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tgoal.max_velocity = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L122_C8", "label": "add()", "type": "expression", "loc": [122, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [8, 1, 0.4082, 0.0197, 1, 0.86, 0.1176, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'TORSO_SETUP',\n SimpleActionState( 'torso_controller/position_joint_action',\n SingleJointPositionAction,\n goal = tgoal),\n transitions = { 'succeeded': 'INIT_ARM_POSE' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L130_C8", "label": "add()", "type": "expression", "loc": [130, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [8, 1, 0.4344, 0.0197, 1, 0.86, 0.1471, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'INIT_ARM_POSE',\n ServiceState( '/traj_playback/hfa_untuck',\n TrajPlaybackSrv,\n request = TrajPlaybackSrvRequest( False )), \n transitions = { 'succeeded':'MOVE_GET_OBJ' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L138_C8", "label": "go = MoveBaseGoal()", "type": "assigned_variable", "loc": [138, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [14, 1, 0.4525, 0.0033, 1, 0.86, 0.1765, 917, 3, 0, 0, 0, 968, 10, 1], "semantic": {"name": "go", "arg_names": [], "import_names": [], "rhs_call_name": "MoveBaseGoal", "annotation": ""}, "snippet": " go = MoveBaseGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L140_C8", "label": "go.target_pose.header.frame_id =", "type": "assigned_variable", "loc": [140, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [14, 1, 0.459, 0.0033, 1, 0.86, 0.2059, 996, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "go.target_pose.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " go.target_pose.header.frame_id = '/map'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L141_C8", "label": "go.target_pose.header.stamp = Time()", "type": "assigned_variable", "loc": [141, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [14, 1, 0.4623, 0.0033, 1, 0.86, 0.2353, 498, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "go.target_pose.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " go.target_pose.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L142_C8", "label": "go.target_pose.pose.position.x =", "type": "assigned_variable", "loc": [142, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [14, 1, 0.4656, 0.0033, 1, 0.86, 0.2647, 102, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "go.target_pose.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " go.target_pose.pose.position.x = -5.07"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L143_C8", "label": "go.target_pose.pose.position.y =", "type": "assigned_variable", "loc": [143, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [14, 1, 0.4689, 0.0033, 1, 0.86, 0.2941, 165, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "go.target_pose.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " go.target_pose.pose.position.y = 8.725"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L144_C8", "label": "go.target_pose.pose.orientation.z =", "type": "assigned_variable", "loc": [144, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [14, 1, 0.4721, 0.0033, 1, 0.86, 0.3235, 875, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "go.target_pose.pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " go.target_pose.pose.orientation.z = 0.926"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L145_C8", "label": "go.target_pose.pose.orientation.w =", "type": "assigned_variable", "loc": [145, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [14, 1, 0.4754, 0.0033, 1, 0.86, 0.3529, 320, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "go.target_pose.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " go.target_pose.pose.orientation.w = 0.377"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L147_C8", "label": "add()", "type": "expression", "loc": [147, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [8, 1, 0.4902, 0.0197, 1, 0.86, 0.3824, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'MOVE_GET_OBJ',\n SimpleActionState( '/move_base',\n MoveBaseAction,\n goal = go ),\n transitions = {'succeeded':'READY_HANDOFF_INIT'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L155_C8", "label": "add()", "type": "expression", "loc": [155, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [8, 1, 0.5131, 0.0131, 1, 0.86, 0.4118, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'READY_HANDOFF_INIT',\n PrintStr('Hand me an object [ENTER]'), \n transitions = { 'succeeded':'HANDOFF_INIT' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L160_C8", "label": "add()", "type": "expression", "loc": [160, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [8, 1, 0.5328, 0.0197, 1, 0.86, 0.4412, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'HANDOFF_INIT',\n ServiceState( 'rfid_handoff/initialize',\n HandoffSrv,\n request = HandoffSrvRequest()), \n transitions = { 'succeeded':'CONFIRM_HANDOFF' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L167_C8", "label": "add()", "type": "expression", "loc": [167, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [8, 1, 0.5541, 0.0164, 1, 0.86, 0.4706, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'CONFIRM_HANDOFF',\n ConfirmObj('Does the robot have the object [\\'yes\\' to proceed]?'), \n transitions = { 'succeeded':'ROTATE_AFTER_HANDOFF',\n 'aborted':'READY_HANDOFF_INIT'} )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L173_C8", "label": "add()", "type": "expression", "loc": [173, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [8, 1, 0.5754, 0.0197, 1, 0.86, 0.5, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'ROTATE_AFTER_HANDOFF',\n ServiceState( '/rotate_backup',\n RotateBackupSrv,\n request = RotateBackupSrvRequest( 3.14, 0.0)), # Full 180-deg spin.\n transitions = { 'succeeded':'MOVE_DELIVERY' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L180_C8", "label": "gd = MoveBaseGoal()", "type": "assigned_variable", "loc": [180, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [14, 1, 0.5902, 0.0033, 1, 0.86, 0.5294, 558, 3, 0, 0, 0, 968, 10, 1], "semantic": {"name": "gd", "arg_names": [], "import_names": [], "rhs_call_name": "MoveBaseGoal", "annotation": ""}, "snippet": " gd = MoveBaseGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L181_C8", "label": "gd.target_pose.header.frame_id =", "type": "assigned_variable", "loc": [181, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [14, 1, 0.5934, 0.0033, 1, 0.86, 0.5588, 81, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "gd.target_pose.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " gd.target_pose.header.frame_id = '/map'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L182_C8", "label": "gd.target_pose.header.stamp = Time()", "type": "assigned_variable", "loc": [182, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [14, 1, 0.5967, 0.0033, 1, 0.86, 0.5882, 476, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "gd.target_pose.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " gd.target_pose.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L183_C8", "label": "gd.target_pose.pose.position.x =", "type": "assigned_variable", "loc": [183, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [14, 1, 0.6, 0.0033, 1, 0.86, 0.6176, 962, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "gd.target_pose.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " gd.target_pose.pose.position.x = 2.956"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L184_C8", "label": "gd.target_pose.pose.position.y =", "type": "assigned_variable", "loc": [184, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [14, 1, 0.6033, 0.0033, 1, 0.86, 0.6471, 610, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "gd.target_pose.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " gd.target_pose.pose.position.y = 3.047"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L185_C8", "label": "gd.target_pose.pose.orientation.z =", "type": "assigned_variable", "loc": [185, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [14, 1, 0.6066, 0.0033, 1, 0.86, 0.6765, 345, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "gd.target_pose.pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " gd.target_pose.pose.orientation.z = 0.349"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L186_C8", "label": "gd.target_pose.pose.orientation.w =", "type": "assigned_variable", "loc": [186, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [14, 1, 0.6098, 0.0033, 1, 0.86, 0.7059, 287, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "gd.target_pose.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " gd.target_pose.pose.orientation.w = 0.937"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L188_C8", "label": "add()", "type": "expression", "loc": [188, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [8, 1, 0.6246, 0.0197, 1, 0.86, 0.7353, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'MOVE_DELIVERY',\n SimpleActionState( '/move_base',\n MoveBaseAction,\n goal = gd ),\n transitions = {'succeeded':'DELIVERY'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L195_C8", "label": "sm_delivery = sm_delivery()", "type": "assigned_variable", "loc": [195, 195], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [14, 1, 0.6393, 0.0033, 1, 0.86, 0.7647, 298, 3, 0, 0, 0, 298, 10, 1], "semantic": {"name": "sm_delivery", "arg_names": [], "import_names": [], "rhs_call_name": "sm_delivery", "annotation": ""}, "snippet": " sm_delivery = sm_rfid_delivery.sm_delivery()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L196_C8", "label": "add()", "type": "expression", "loc": [196, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [8, 1, 0.6508, 0.0197, 1, 0.86, 0.7941, 241, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'DELIVERY', # outcomes: succeeded, aborted, preempted\n sm_delivery,\n remapping = { 'tagid' : 'person_id'}, #input\n transitions = { 'succeeded': 'TUCKL_SUCC',\n 'aborted': 'TUCKL_ABOR'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L203_C8", "label": "add()", "type": "expression", "loc": [203, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [8, 1, 0.6738, 0.0197, 1, 0.86, 0.8235, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'TUCKL_SUCC',\n ServiceState( '/robotis/servo_left_pan_moveangle',\n MoveAng,\n request = MoveAngRequest( 1.350, 0.3, 0)), \n transitions = { 'succeeded':'TUCKR_SUCC' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L209_C8", "label": "add()", "type": "expression", "loc": [209, 214], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [8, 1, 0.6934, 0.0197, 1, 0.86, 0.8529, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'TUCKR_SUCC',\n ServiceState( '/robotis/servo_right_pan_moveangle',\n MoveAng,\n request = MoveAngRequest( -1.350, 0.3, 0)), \n transitions = { 'succeeded':'BACKUP_AFTER_DELIVERY' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L216_C8", "label": "add()", "type": "expression", "loc": [216, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [8, 1, 0.7164, 0.0197, 1, 0.86, 0.8824, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'TUCKL_ABOR',\n ServiceState( '/robotis/servo_left_pan_moveangle',\n MoveAng,\n request = MoveAngRequest( 1.350, 0.3, 0)), \n transitions = { 'succeeded':'TUCKR_ABOR' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L222_C8", "label": "add()", "type": "expression", "loc": [222, 227], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [8, 1, 0.7361, 0.0197, 1, 0.86, 0.9118, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'TUCKR_ABOR',\n ServiceState( '/robotis/servo_right_pan_moveangle',\n MoveAng,\n request = MoveAngRequest( -1.350, 0.3, 0)), \n transitions = { 'succeeded':'aborted' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L230_C8", "label": "add()", "type": "expression", "loc": [230, 235], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [8, 1, 0.7623, 0.0197, 1, 0.86, 0.9412, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'BACKUP_AFTER_DELIVERY',\n ServiceState( '/rotate_backup',\n RotateBackupSrv,\n request = RotateBackupSrvRequest(0.0, -0.50)), \n transitions = { 'succeeded':'ROTATE_AFTER_DELIVERY' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L237_C8", "label": "add()", "type": "expression", "loc": [237, 242], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [8, 1, 0.7852, 0.0197, 1, 0.86, 0.9706, 241, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'ROTATE_AFTER_DELIVERY',\n ServiceState( '/rotate_backup',\n RotateBackupSrv,\n request = RotateBackupSrvRequest( 3.14, 0.0)), \n transitions = { 'succeeded':'MOVE_FINAL' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L253_C8", "label": "add()", "type": "expression", "loc": [253, 258], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [8, 1, 0.8377, 0.0197, 1, 0.86, 1.0, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'MOVE_FINAL',\n SimpleActionState( '/move_base',\n MoveBaseAction,\n goal = go ), # Back down the hallway\n transitions = {'succeeded':'succeeded'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Return_L263_C4", "label": "return", "type": "return", "loc": [263, 263], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "vector": [13, 1, 0.8623, 0.0033, 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 sm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L265_C0", "label": "if", "type": "if", "loc": [265, 282], "level": 0, "parent": null, "vector": [4, 0, 0.8967, 0.059, 0, 0.66, 0.9655, 0, 1, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if False:\n rospy.init_node('localization_trial')\n\n sm = smach.StateMachine( outcomes=['succeeded','aborted','preempted'] )\n with sm:\n # Just a precation\n tgoal = SingleJointPositionGoal()\n tgoal.position = 0.040 # all the way up is 0.200"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L266_C4", "label": "init_node()", "type": "expression", "loc": [266, 266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L265_C0", "vector": [8, 1, 0.8721, 0.0033, 1, 0.23, 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('localization_trial')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L268_C4", "label": "sm = StateMachine()", "type": "assigned_variable", "loc": [268, 268], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L265_C0", "vector": [14, 1, 0.8787, 0.0033, 1, 0.23, 0.5, 21, 3, 1, 0, 0, 174, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "StateMachine", "annotation": ""}, "snippet": " sm = smach.StateMachine( outcomes=['succeeded','aborted','preempted'] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L271_C8", "label": "tgoal = SingleJointPositionGoal()", "type": "assigned_variable", "loc": [271, 271], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L265_C0", "vector": [14, 1, 0.8885, 0.0033, 1, 0.23, 0.0, 454, 3, 0, 0, 0, 974, 10, 1], "semantic": {"name": "tgoal", "arg_names": [], "import_names": [], "rhs_call_name": "SingleJointPositionGoal", "annotation": ""}, "snippet": " tgoal = SingleJointPositionGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L272_C8", "label": "tgoal.position =", "type": "assigned_variable", "loc": [272, 272], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L265_C0", "vector": [14, 1, 0.8918, 0.0033, 1, 0.23, 0.25, 731, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "tgoal.position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tgoal.position = 0.040 # all the way up is 0.200"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L273_C8", "label": "tgoal.min_duration = Duration()", "type": "assigned_variable", "loc": [273, 273], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L265_C0", "vector": [14, 1, 0.8951, 0.0033, 1, 0.23, 0.5, 779, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "tgoal.min_duration", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " tgoal.min_duration = rospy.Duration( 2.0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L274_C8", "label": "tgoal.max_velocity =", "type": "assigned_variable", "loc": [274, 274], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L265_C0", "vector": [14, 1, 0.8984, 0.0033, 1, 0.23, 0.75, 590, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "tgoal.max_velocity", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tgoal.max_velocity = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L275_C8", "label": "add()", "type": "expression", "loc": [275, 280], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L265_C0", "vector": [8, 1, 0.9098, 0.0197, 1, 0.23, 1.0, 241, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " smach.StateMachine.add(\n 'TORSO_SETUP',\n SimpleActionState( 'torso_controller/position_joint_action',\n SingleJointPositionAction,\n goal = tgoal),\n transitions = { 'succeeded': 'succeeded' })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L282_C4", "label": "execute()", "type": "expression", "loc": [282, 282], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L265_C0", "vector": [8, 1, 0.9246, 0.0033, 1, 0.23, 1.0, 569, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " sm.execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L285_C0", "label": "if", "type": "if", "loc": [285, 302], "level": 0, "parent": null, "vector": [4, 0, 0.9623, 0.059, 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# if False:\n rospy.init_node('smach_aware_home')\n\n sm = cousins_demo()\n\n sis = IntrospectionServer('sm_aware_home', sm, '/SM_AWARE_HOME')\n sis.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L287_C4", "label": "init_node()", "type": "expression", "loc": [287, 287], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L285_C0", "vector": [8, 1, 0.941, 0.0033, 1, 0.46, 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('smach_aware_home')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L289_C4", "label": "sm = cousins_demo()", "type": "assigned_variable", "loc": [289, 289], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L285_C0", "vector": [14, 1, 0.9475, 0.0033, 1, 0.46, 0.1429, 21, 3, 0, 0, 0, 546, 10, 1], "semantic": {"name": "sm", "arg_names": [], "import_names": [], "rhs_call_name": "cousins_demo", "annotation": ""}, "snippet": " sm = cousins_demo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L291_C4", "label": "sis = IntrospectionServer()", "type": "assigned_variable", "loc": [291, 291], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L285_C0", "vector": [14, 1, 0.9541, 0.0033, 1, 0.46, 0.2857, 608, 3, 3, 0, 0, 702, 10, 1], "semantic": {"name": "sis", "arg_names": [], "import_names": [], "rhs_call_name": "IntrospectionServer", "annotation": ""}, "snippet": " sis = IntrospectionServer('sm_aware_home', sm, '/SM_AWARE_HOME')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L292_C4", "label": "start()", "type": "expression", "loc": [292, 292], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L285_C0", "vector": [8, 1, 0.9574, 0.0033, 1, 0.46, 0.4286, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " sis.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L294_C4", "label": "logout()", "type": "expression", "loc": [294, 294], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L285_C0", "vector": [8, 1, 0.9639, 0.0033, 1, 0.46, 0.5714, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'READY TO RUN AWARE_HOME DEMO' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L296_C4", "label": "sm.userdata.person_id =", "type": "assigned_variable", "loc": [296, 296], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L285_C0", "vector": [14, 1, 0.9705, 0.0033, 1, 0.46, 0.7143, 760, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "sm.userdata.person_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sm.userdata.person_id = 'person '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L299_C4", "label": "outcome = execute()", "type": "assigned_variable", "loc": [299, 299], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L285_C0", "vector": [14, 1, 0.9803, 0.0033, 1, 0.46, 0.8571, 805, 3, 0, 0, 0, 569, 10, 1], "semantic": {"name": "outcome", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " outcome = sm.execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L302_C4", "label": "stop()", "type": "expression", "loc": [302, 302], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L285_C0", "vector": [8, 1, 0.9902, 0.0033, 1, 0.46, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " sis.stop()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99399:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Return_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Return_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Return_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:ClassDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:ClassDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L70_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Return_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Return_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Return_L263_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L265_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L266_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L265_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L268_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L265_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L265_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L272_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L265_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L265_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L274_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L265_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L265_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L282_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L285_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L287_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L285_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L289_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L285_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L291_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L285_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L292_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L285_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L294_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L285_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L296_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L285_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Assign_L299_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99399:If_L285_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99399:Expr_L302_C4"}]